Makes the admin logout tracking system actually work

This commit is contained in:
Crazylemon64
2016-11-27 12:00:57 -08:00
parent 635335dd5c
commit 8271a89dab
4 changed files with 40 additions and 10 deletions
+14 -10
View File
@@ -3,15 +3,19 @@
unset_machine()
player_list -= src
log_access("Logout: [key_name(src)]")
if(admin_datums[src.ckey])
if(ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing.
var/admins_number = admins.len
// `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(admin_datums[ckey] && ticker && ticker.current_state == GAME_STATE_PLAYING)
var/datum/admins/temp_admin = admin_datums[ckey]
// Triggers on people with banhammer power only - no mentors tripping the alarm
if(temp_admin.rights & R_BAN)
message_admins("Admin logout: [key_name_admin(src)]")
if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.
send2adminirc("[key_name(src)] logged out - no more admins online.")
var/list/admincounter = staff_countup(R_BAN)
if(admincounter[1] == 0) // No active admins
send2irc(config.admin_notify_irc, "[key_name(src)] logged out - No active admins, [admincounter[2]] non-admin staff, [admincounter[3]] inactive staff.")
..()
callHook("mob_logout", list("client" = client, "mob" = src))
return 1
callHook("mob_logout", list("client" = client, "mob" = src))
return 1