From 82b7eaba8cbdc386489e78e93e27bb2f13939a2f Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Mon, 26 Jul 2021 18:09:29 +0100 Subject: [PATCH] Discord notification (#16351) --- code/modules/mob/logout.dm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index fa490c05f0c..fd1d7579d08 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -7,14 +7,18 @@ create_log(MISC_LOG, "Logged out") // `holder` is nil'd out by now, so we check the `admin_datums` array directly //Only report this stuff if we are currently playing. - if(GLOB.admin_datums[ckey] && SSticker && SSticker.current_state == GAME_STATE_PLAYING) + if(GLOB.admin_datums[ckey] && SSticker.current_state == GAME_STATE_PLAYING) var/datum/admins/temp_admin = GLOB.admin_datums[ckey] - // Triggers on people with banhammer power only - no mentors tripping the alarm - if(temp_admin.rights & R_BAN) + if(temp_admin.rights & R_MENTOR) + var/list/mentorcounter = staff_countup(R_MENTOR) + if(mentorcounter[1] == 0) // No active mentors + SSdiscord.send2discord_simple(DISCORD_WEBHOOK_MENTOR, "[key_name(src)] logged out - 0 active mentors, [mentorcounter[2]] non-mentor staff, [mentorcounter[3]] inactive mentors.") + + else if(temp_admin.rights & R_BAN) message_admins("Admin logout: [key_name_admin(src)]") var/list/admincounter = staff_countup(R_BAN) if(admincounter[1] == 0) // No active admins - SSdiscord.send2discord_simple(DISCORD_WEBHOOK_ADMIN, "[key_name(src)] logged out - No active admins, [admincounter[2]] non-admin staff, [admincounter[3]] inactive staff.") + SSdiscord.send2discord_simple(DISCORD_WEBHOOK_ADMIN, "[key_name(src)] logged out - 0 active admins, [admincounter[2]] non-admin staff, [admincounter[3]] inactive staff.") ..() update_morgue()