From 68c13044c7577b4f5569293af900fed4a21dcec0 Mon Sep 17 00:00:00 2001 From: errorage Date: Thu, 25 Jul 2013 23:24:05 +0200 Subject: [PATCH 1/2] - When determining whether to send an adminhelp to IRC or not, admins without +BAN are treated as 'not being there'. IRC messages now follow the format: "[original_msg] - All admins AFK ([admin_number_afk]) or skipped ([admin_number_ignored])" --- code/modules/admin/verbs/adminhelp.dm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index ef35112af26..a1a2be7460a 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -88,10 +88,21 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," msg = "\blue HELP: [key_name(src, 1)] (?) (PP) (VV) (SM) (JMP) (CA) [ai_found ? " (CL)" : ""]: [msg]" //send this msg to all admins - var/admin_number_afk = 0 + var/admin_number_total = 0 //Total number of admins + var/admin_number_afk = 0 //Holds the number of admins who are afk + var/admin_number_ignored = 0 //Holds the number of admins without +BAN (so admins who are not really admins) + var/admin_number_decrease = 0 //Holds the number of admins with are afk, ignored or both for(var/client/X in admins) + admin_number_total++; + var/invalid = 0 + if(!check_rights_for(X, R_BAN)) + admin_number_ignored++ + invalid = 1 if(X.is_afk()) admin_number_afk++ + invalid = 1 + if(invalid) + admin_number_decrease++ if(X.prefs.toggles & SOUND_ADMINHELP) X << 'sound/effects/adminhelp.ogg' X << msg @@ -99,13 +110,13 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," //show it to the person adminhelping too src << "PM to-Admins: [original_msg]" - var/admin_number_present = admins.len - admin_number_afk + var/admin_number_present = admin_number_total - admin_number_decrease //Number of admins who are neither afk nor invalid log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.") if(admin_number_present <= 0) - if(!admin_number_afk) + if(!admin_number_afk && !admin_number_ignored) send2irc(ckey, "[original_msg] - No admins online") else - send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk])") + send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk]) or skipped ([admin_number_ignored])") feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return From 23703d19ed66a79700487b47e43712cd4d71d62d Mon Sep 17 00:00:00 2001 From: errorage Date: Fri, 26 Jul 2013 23:03:44 +0200 Subject: [PATCH 2/2] Slight edit to the output format, it now writes AFK/TOTAL and IGNORED/TOTAL as an ignored admin might also be afk, so he'd be counted twice. --- code/modules/admin/verbs/adminhelp.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index a1a2be7460a..94ca95d3528 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -111,12 +111,12 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," src << "PM to-Admins: [original_msg]" var/admin_number_present = admin_number_total - admin_number_decrease //Number of admins who are neither afk nor invalid - log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.") + log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins who have +BAN.") if(admin_number_present <= 0) if(!admin_number_afk && !admin_number_ignored) send2irc(ckey, "[original_msg] - No admins online") else - send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk]) or skipped ([admin_number_ignored])") + send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk]/[admin_number_total]) or skipped ([admin_number_ignored]/[admin_number_total])") feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return