From c8f54b4d5315d87334aa91a5455a01373c3a8b22 Mon Sep 17 00:00:00 2001 From: Crazy Lemon Date: Sat, 3 Dec 2016 01:53:47 -0800 Subject: [PATCH] Revert "Makes the admin logout tracking system actually work" --- code/controllers/configuration.dm | 4 ---- code/game/gamemodes/gameticker.dm | 9 ++++++--- code/modules/admin/admin.dm | 19 ------------------- code/modules/client/client procs.dm | 4 ++-- code/modules/mob/logout.dm | 24 ++++++++++-------------- config/example/config.txt | 3 --- 6 files changed, 18 insertions(+), 45 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 9ac4a0eb4d6..88b631f5c18 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -139,7 +139,6 @@ var/list/irc_bot_host = list() var/main_irc = "" var/admin_irc = "" - var/admin_notify_irc = "" var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix var/default_laws = 0 //Controls what laws the AI spawns with. @@ -469,9 +468,6 @@ if("admin_irc") config.admin_irc = value - if("admin_notify_irc") - config.admin_notify_irc = value - if("python_path") if(value) config.python_path = value diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 1b31f2d554a..5deb2bafa0f 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -209,9 +209,12 @@ var/round_start_time = 0 //start_events() //handles random events and space dust. //new random event system is handled from the MC. - var/list/admins_number = staff_countup(R_BAN) - if(admins_number[1] == 0 && admins_number[3] == 0) - send2irc(config.admin_notify_irc, "Round has started with no admins online.") + var/admins_number = 0 + for(var/client/C) + if(C.holder) + admins_number++ + if(admins_number == 0) + send2adminirc("Round has started with no admins online.") auto_toggle_ooc(0) // Turn it off round_start_time = world.time diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index eb32af7802d..687fc00797d 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1001,22 +1001,3 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space qdel(frommob) return 1 - -// Returns a list of the number of admins in various categories -// result[1] is the number of staff that match the rank mask and are active -// result[2] is the number of staff that do not match the rank mask -// result[3] is the number of staff that match the rank mask and are inactive -/proc/staff_countup(rank_mask = R_BAN) - var/list/result = list(0, 0, 0) - for(var/client/X in admins) - if(rank_mask && !check_rights_for(X, rank_mask)) - result[2]++ - continue - if(X.holder.fakekey) - result[2]++ - continue - if(X.is_afk()) - result[3]++ - continue - result[1]++ - return result diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 0209b16c40e..0cf9b0a0915 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -238,7 +238,7 @@ if((last_message_time + throttle > world.time) && !check_rights(R_ADMIN, 0)) var/wait_time = round(((last_message_time + throttle) - world.time) / 10, 1) to_chat(src, "You are sending messages to quickly. Please wait [wait_time] [wait_time == 1 ? "second" : "seconds"] before sending another message.") - return 1 + return 1 last_message_time = world.time if(config.automute_on && !check_rights(R_ADMIN, 0) && last_message == message) last_message_count++ @@ -437,7 +437,7 @@ var/watchreason = check_watchlist(ckey) if(watchreason) message_admins("Notice: [key_name_admin(src)] is on the watchlist and has just connected - Reason: [watchreason]") - send2irc(config.admin_notify_irc, "Watchlist - [key_name(src)] is on the watchlist and has just connected - Reason: [watchreason]") + send2adminirc("Watchlist - [key_name(src)] is on the watchlist and has just connected - Reason: [watchreason]") //Just the standard check to see if it's actually a number if(sql_id) diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index b9fed474cdf..d83a5efe339 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -3,19 +3,15 @@ unset_machine() player_list -= src log_access("Logout: [key_name(src)]") - // `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) + 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 + message_admins("Admin logout: [key_name_admin(src)]") - 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.") - + 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.") ..() - - callHook("mob_logout", list("client" = client, "mob" = src)) - - return 1 + + callHook("mob_logout", list("client" = client, "mob" = src)) + + return 1 \ No newline at end of file diff --git a/config/example/config.txt b/config/example/config.txt index 31bde9c5e4f..f2087eebaa2 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -248,9 +248,6 @@ GHOST_INTERACTION ## IRC channel to send adminhelps to. Leave blank to disable adminhelps-to-irc. #ADMIN_IRC #admin -## IRC channel to send direct messages to admins to. Leave blank to disable. -#ADMIN_NOTIFY_IRC #paradiseStaff - ## Path to the python2 executable on the system. Leave blank for default. ## Default is "python" on Windows, "/usr/bin/env python2" on UNIX. #PYTHON_PATH pythonw