From 78616ca6a916634672c02274f924babdca23d3f4 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Sun, 26 Mar 2017 10:44:42 -0500 Subject: [PATCH] *reverts back to the separated who list *fixes a lot of mentor related issue (both them not loading and missing verbs) --- code/_globalvars/logging.dm | 1 + code/controllers/configuration.dm | 4 ++ code/modules/admin/admin.dm | 3 + code/modules/client/verbs/who.dm | 102 ++++++++++++++++-------------- code/world.dm | 1 + 5 files changed, 63 insertions(+), 48 deletions(-) diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 9fded8d3e4..a673611d84 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -12,5 +12,6 @@ var/list/combatlog = list() var/list/IClog = list() var/list/OOClog = list() var/list/adminlog = list() +var/list/mentorlog = list () var/list/active_turfs_startlist = list() diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index ccb695cc71..6df283d8d6 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -691,6 +691,10 @@ config.forbid_peaceborg = 1 if("silent_ai") config.silent_ai = 1 + if ("mentor_mobname_only") + config.mentors_mobname_only = 1 + if ("mentor_legacy_system") + config.mentor_legacy_system = 1 if("silent_borg") config.silent_borg = 1 if("sandbox_autoclose") diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index c744172b2b..4a536666ca 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -162,6 +162,9 @@ var/global/BSACooldown = 0 body += "Thunderdome 2 | " body += "Thunderdome Admin | " body += "Thunderdome Observer | " + body += "Make Mentor | " + body += "Remove Mentor | " + body += "
" body += "" diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm index a94f965811..1b621de06b 100644 --- a/code/modules/client/verbs/who.dm +++ b/code/modules/client/verbs/who.dm @@ -2,59 +2,65 @@ set name = "Who" set category = "OOC" - var/msg = "Current Players:\n" + var/msg = "" var/list/Lines = list() - if(holder) - if (check_rights(R_ADMIN,0) && isobserver(src.mob))//If they have +ADMIN and are a ghost they can see players IC names and statuses. - var/mob/dead/observer/G = src.mob - if(!G.started_as_observer)//If you aghost to do this, KorPhaeron will deadmin you in your sleep. - log_admin("[key_name(usr)] checked advanced who in-round") - for(var/client/C in clients) - var/entry = "\t[C.key]" - if(C.holder && C.holder.fakekey) - entry += " (as [C.holder.fakekey])" - if (isnewplayer(C.mob)) - entry += " - In Lobby" - else - entry += " - Playing as [C.mob.real_name]" - switch(C.mob.stat) - if(UNCONSCIOUS) - entry += " - Unconscious" - if(DEAD) - if(isobserver(C.mob)) - var/mob/dead/observer/O = C.mob - if(O.started_as_observer) - entry += " - Observing" - else - entry += " - DEAD" - else - entry += " - DEAD" - if(is_special_character(C.mob)) - entry += " - Antagonist" - entry += " (?)" - entry += " ([round(C.avgping, 1)]ms)" - Lines += entry - else//If they don't have +ADMIN, only show hidden admins - for(var/client/C in clients) - var/entry = "\t[C.key]" - if(C.holder && C.holder.fakekey) - entry += " (as [C.holder.fakekey])" - entry += " ([round(C.avgping, 1)]ms)" - Lines += entry - else - for(var/client/C in clients) - if(C.holder && C.holder.fakekey) - Lines += "[C.holder.fakekey] ([round(C.avgping, 1)]ms)" - else - Lines += "[C.key] ([round(C.avgping, 1)]ms)" + if(length(admins) > 0) + Lines += "Admins:" + for(var/client/C in sortList(admins)) + if(!C.holder.fakekey) + Lines += "\t [C.key][show_info(C)]" - for(var/line in sortList(Lines)) + if(length(mentors) > 0) + Lines += "Mentors:" + for(var/client/C in sortList(clients)) + var/mentor = mentor_datums[C.ckey] + if(mentor) + Lines += "\t [C.key][show_info(C)]" + + Lines += "Players:" + for(var/client/C in sortList(clients)) + if(!check_mentor_other(C) || (C.holder && C.holder.fakekey)) + Lines += "\t [C.key][show_info(C)]" + + for(var/line in Lines) msg += "[line]\n" msg += "Total Players: [length(Lines)]" - to_chat(src, msg) + src << msg + +/client/proc/show_info(var/client/C) + if(!C) + return "" + + if(!src.holder) + return "" + + var/entry = "" + if(C.holder && C.holder.fakekey) + entry += " (as [C.holder.fakekey])" + if (isnewplayer(C.mob)) + entry += " - In Lobby" + else + entry += " - Playing as [C.mob.real_name]" + switch(C.mob.stat) + if(UNCONSCIOUS) + entry += " - Unconscious" + if(DEAD) + if(isobserver(C.mob)) + var/mob/dead/observer/O = C.mob + if(O.started_as_observer) + entry += " - Observing" + else + entry += " - DEAD" + else + entry += " - DEAD" + if(is_special_character(C.mob)) + entry += " - Antagonist" + entry += " (?)" + entry += " ([round(C.avgping, 1)]ms)" + return entry /client/verb/adminwho() set category = "Admin" @@ -84,8 +90,8 @@ continue //Don't show afk admins to adminwho if(!C.holder.fakekey) msg += "\t[C] is a [C.holder.rank]\n" - msg += "Adminhelps are also sent to Discord. If no admins are available in game adminhelp anyways and an admin on Discord will see it and respond." - to_chat(src, msg) + msg += "Adminhelps are also sent to IRC. If no admins are available in game adminhelp anyways and an admin on IRC will see it and respond." + src << msg /client/verb/mentorwho() set category = "Mentor" diff --git a/code/world.dm b/code/world.dm index fa038c62f1..50a1317a5f 100644 --- a/code/world.dm +++ b/code/world.dm @@ -40,6 +40,7 @@ load_mode() load_motd() load_admins() + load_mentors() if(config.usewhitelist) load_whitelist() LoadBans()