From a8116c4f29f20dc2bd1e24aabeca0e6531ebf819 Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Tue, 7 Feb 2017 21:23:32 -0800 Subject: [PATCH] [READY]Sends the names of online admins when sending IRC alerts about no admins active. (#23712) * Update adminhelp.dm * Update world.dm * Update ticker.dm * should work. --- code/controllers/subsystem/ticker.dm | 5 +++-- code/modules/admin/verbs/adminhelp.dm | 23 ++++++++++++++--------- code/world.dm | 7 +++++-- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 99c5e56e9df..8a663bbe80a 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -210,7 +210,8 @@ var/datum/subsystem/ticker/ticker qdel(S) var/list/adm = get_admin_counts() - if(!adm["present"]) + var/list/allmins = adm["present"] + if(!allmins.len) send2irc("Server", "Round just started with no active admins online!") /datum/subsystem/ticker/proc/station_explosion_detonation(atom/bomb) @@ -327,7 +328,7 @@ var/datum/subsystem/ticker/ticker bombloc = bomb.z else if(!station_missed) bombloc = ZLEVEL_STATION - + if(mode) mode.explosion_in_progress = 0 world << "The station was destoyed by the nuclear blast!" diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 1e9a148cf03..dd83eef820d 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -131,27 +131,32 @@ return /proc/get_admin_counts(requiredflags = R_BAN) - . = list("total" = 0, "noflags" = 0, "afk" = 0, "stealth" = 0, "present" = 0) + . = list("total" = list(), "noflags" = list(), "afk" = list(), "stealth" = list(), "present" = list()) for(var/client/X in admins) - .["total"]++ + .["total"] += X if(requiredflags != 0 && !check_rights_for(X, requiredflags)) - .["noflags"]++ + .["noflags"] += X else if(X.is_afk()) - .["afk"]++ + .["afk"] += X else if(X.holder.fakekey) - .["stealth"]++ + .["stealth"] += X else - .["present"]++ + .["present"] += X /proc/send2irc_adminless_only(source, msg, requiredflags = R_BAN) var/list/adm = get_admin_counts(requiredflags) - . = adm["present"] + var/list/activemins = adm["present"] + . = activemins.len if(. <= 0) var/final = "" - if(!adm["afk"] && !adm["stealth"] && !adm["noflags"]) + var/list/afkmins = adm["afk"] + var/list/stealthmins = adm["stealth"] + var/list/powerlessmins = adm["noflags"] + var/list/allmins = adm["total"] + if(!afkmins.len && !stealthmins.len && !powerlessmins.len) final = "[msg] - No admins online" else - final = "[msg] - All admins AFK ([adm["afk"]]/[adm["total"]]), stealthminned ([adm["stealth"]]/[adm["total"]]), or lack[rights2text(requiredflags, " ")] ([adm["noflags"]]/[adm["total"]])" + final = "[msg] - All admins stealthed\[[english_list(stealthmins)]\], AFK\[[english_list(afkmins)]\], or lacks +BAN\[[english_list(powerlessmins)]\]! Total: [allmins.len] " send2irc(source,final) send2otherserver(source,final) diff --git a/code/world.dm b/code/world.dm index bab4d772ae1..56f48f25e03 100644 --- a/code/world.dm +++ b/code/world.dm @@ -97,7 +97,8 @@ var/last_irc_status = 0 if(world.time - last_irc_status < IRC_STATUS_THROTTLE) return var/list/adm = get_admin_counts() - var/status = "Admins: [adm["total"]] (Active: [adm["present"]] AFK: [adm["afk"]] Stealth: [adm["stealth"]] Skipped: [adm["noflags"]]). " + var/list/allmins = adm["total"] + var/status = "Admins: [allmins.len] (Active: [english_list(adm["present"])] AFK: [english_list(adm["afk"])] Stealth: [english_list(adm["stealth"])] Skipped: [english_list(adm["noflags"])]). " status += "Players: [clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [ticker.mode.name]." send2irc("Status", status) last_irc_status = world.time @@ -117,7 +118,9 @@ var/last_irc_status = 0 s["revision_date"] = revdata.date var/list/adm = get_admin_counts() - s["admins"] = adm["present"] + adm["afk"] //equivalent to the info gotten from adminwho + var/list/presentmins = adm["present"] + var/list/afkmins = adm["afk"] + s["admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho s["gamestate"] = 1 if(ticker) s["gamestate"] = ticker.current_state