From b77e232ab9e715279f3690adb4030b6e981348b9 Mon Sep 17 00:00:00 2001 From: Shadowlight213 Date: Tue, 23 Aug 2016 12:43:51 -0700 Subject: [PATCH] Adds adds the ability to get a list of admins and their status from irc. also fixes the ircstatus command --- code/modules/admin/verbs/adminhelp.dm | 15 +++++++++++++++ code/world.dm | 9 +++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index af2f21907d6..f61ed94e163 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -169,3 +169,18 @@ message["crossmessage"] = type world.Export("[global.cross_address]?[list2params(message)]") + + +/proc/ircadminwho() + var/msg = "Admins: " + for(var/client/C in admins) + msg += "[C] " + + if(C.holder.fakekey) + msg += "(Stealth)" + + if(C.is_afk()) + msg += "(AFK)" + msg += ", " + + return msg \ No newline at end of file diff --git a/code/world.dm b/code/world.dm index 06d8097d740..db6886aaaf6 100644 --- a/code/world.dm +++ b/code/world.dm @@ -98,8 +98,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: [Sum(adm)] (Active: [adm["admins"]] AFK: [adm["afkadmins"]] Stealth: [adm["stealthadmins"]] Skipped: [adm["noflagadmins"]]). " - status += "Players: [clients.len] (Active: [get_active_player_count()]). Mode: [master_mode]." + var/status = "Admins: [adm["total"]] (Active: [adm["present"]] AFK: [adm["afk"]] Stealth: [adm["stealth"]] Skipped: [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 @@ -175,6 +175,11 @@ var/last_irc_status = 0 log_admin("IRC Name Check: [input["sender"]] on [input["namecheck"]]") message_admins("IRC name checking on [input["namecheck"]] from [input["sender"]]") return keywords_lookup(input["namecheck"],1) + else if("adminwho" in input) + if(!key_valid) + return "Bad Key" + else + return ircadminwho() /world/Reboot(var/reason, var/feedback_c, var/feedback_r, var/time)