From 836d62864f92c00276d39252dcff625ddc8dab28 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 13 Feb 2017 01:16:13 -0800 Subject: [PATCH 1/3] Lets mentors see playtime Mentors can already see a list of all players by account age. This includes antags with obvious names, like "Donk Co. Operative #1". This PR changes the permissions on the playtime report (the one which shows how much playtime everyone has) so mentors can see that, too. The idea being that this enables mentors to distinguish between "X has an old account" and "X has a lot of experience on paradise". Currently, mentors cannot distinguish the two. Also, consistency. If mentors can see players' account registration age, they should also be able to see players' playtime experience. --- code/game/jobs/job_exp.dm | 2 +- code/modules/admin/admin_verbs.dm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index 746dfcacf44..ba87db2946e 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -1,6 +1,6 @@ // Admin Verbs -/client/proc/cmd_admin_check_player_exp() //Allows admins to determine who the newer players are. +/client/proc/cmd_mentor_check_player_exp() //Allows admins to determine who the newer players are. set category = "Admin" set name = "Check Player Playtime" if(!check_rights(R_ADMIN)) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 6b2224962f5..7f38ec55bc8 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -2,7 +2,8 @@ var/list/admin_verbs_default = list( /client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/ /client/proc/hide_verbs, /*hides all our adminverbs*/ - /client/proc/cmd_mentor_check_new_players + /client/proc/cmd_mentor_check_new_players, + /client/proc/cmd_mentor_check_player_exp /* shows players by playtime */ ) var/list/admin_verbs_admin = list( /client/proc/check_antagonists, /*shows all antags*/ @@ -75,7 +76,6 @@ var/list/admin_verbs_admin = list( /client/proc/debug_variables, /client/proc/show_snpc_verbs, /client/proc/reset_all_tcs, /*resets all telecomms scripts*/ - /client/proc/cmd_admin_check_player_exp, /* shows players by playtime */ /client/proc/toggle_mentor_chat ) var/list/admin_verbs_ban = list( @@ -166,7 +166,7 @@ var/list/admin_verbs_debug = list( /client/proc/admin_serialize, /client/proc/admin_deserialize, /client/proc/jump_to_ruin, - /client/proc/toggle_medal_disable + /client/proc/toggle_medal_disable ) var/list/admin_verbs_possess = list( /proc/possess, From b7855481f6de58dac3263f9a5abc9bddb51e48c6 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 13 Feb 2017 23:12:57 -0800 Subject: [PATCH 2/3] Fixes & Improvements - Makes new players be listed first in the Check Playtime list, so they are easy to find. - Fixes a bug with mentor playtime list not actually working for mentors. - Fixes the Check Player Age panel not having working "FLW" links, and potentially showing antag status to mentors. --- code/defines/procs/admin.dm | 6 +++++ code/game/jobs/job_exp.dm | 30 ++++++++++++++++++++----- code/modules/admin/topic.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 5 ++++- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/code/defines/procs/admin.dm b/code/defines/procs/admin.dm index fb9bc232e12..2bc6b59e1d0 100644 --- a/code/defines/procs/admin.dm +++ b/code/defines/procs/admin.dm @@ -48,6 +48,12 @@ var/message = "[key_name(whom, 1, include_name)](?)[isAntag(whom) ? "(A)" : ""][isLivingSSD(whom) ? "(SSD!)" : ""] ([admin_jump_link(whom)])" return message +/proc/key_name_mentor(var/whom, var/include_name = 1) + // Same as key_name_admin, but does not include (?) or (A) for antags. + var/message = "[key_name(whom, 1, include_name)] [isLivingSSD(whom) ? "(SSD!)" : ""] ([admin_jump_link(whom)])" + return message + + /proc/log_and_message_admins(var/message as text) log_admin("[key_name(usr)] " + message) message_admins("[key_name_admin(usr)] " + message) diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index ba87db2946e..fc84a39bef7 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -3,20 +3,38 @@ /client/proc/cmd_mentor_check_player_exp() //Allows admins to determine who the newer players are. set category = "Admin" set name = "Check Player Playtime" - if(!check_rights(R_ADMIN)) + if(!check_rights(R_ADMIN|R_MOD|R_MENTOR)) return - var/msg = "Playtime ReportPlaytime:
" + if(check_rights(R_ADMIN)) + pline = "
  • [key_name_admin(C.mob)]: " + C.get_exp_living() + "
  • " + else + pline = "
  • [key_name_mentor(C.mob)]: " + C.get_exp_living() + "
  • " + if(C.get_exp_living_num() > 1200) + players_old += pline + else + players_new += pline + if(players_new.len) + msg += "
    Players under 20h:
    " + if(players_old.len) + msg += "
    Players over 20h:
    " + msg += "" src << browse(msg, "window=Player_playtime_check") -/datum/admins/proc/cmd_show_exp_panel(var/client/C) +/datum/admins/proc/cmd_mentor_show_exp_panel(var/client/C) if(!C) to_chat(usr, "ERROR: Client not found.") return - if(!check_rights(R_ADMIN)) + if(!check_rights(R_ADMIN|R_MOD|R_MENTOR)) return var/body = "Playtime for [C.key]
    Playtime:" body += C.get_exp_report() diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 4a01b1161e8..fe182889c87 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2031,7 +2031,7 @@ if(!M) to_chat(usr, "ERROR: Mob not found.") return - cmd_show_exp_panel(M.client) + cmd_mentor_show_exp_panel(M.client) else if(href_list["jumpto"]) if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 79ee34fb635..4b484d58e80 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -88,7 +88,10 @@ missing_ages = 1 continue if(C.player_age < age) - msg += "[key_name_admin(C)]: account is [C.player_age] days old
    " + if(check_rights(R_ADMIN)) + msg += "[key_name_admin(C.mob)]: [C.player_age] days old
    " + else + msg += "[key_name_mentor(C.mob)]: [C.player_age] days old
    " if(missing_ages) to_chat(src, "Some accounts did not have proper ages set in their clients. This function requires database to be present") From 7c0eb7a8536f9232d6a96f49a1789256861f6e1b Mon Sep 17 00:00:00 2001 From: Kyep Date: Thu, 16 Feb 2017 23:31:28 -0800 Subject: [PATCH 3/3] CPP now lists jobs, with * on jobs with p.reqs --- code/game/jobs/job_exp.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index fc84a39bef7..e0b403bfce7 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -9,11 +9,20 @@ var/list/players_new = list() var/list/players_old = list() var/pline + var/datum/job/theirjob + var/jtext for(var/client/C in clients) + jtext = "No Job" + if(C.mob.mind.assigned_role) + theirjob = job_master.GetJob(C.mob.mind.assigned_role) + if(theirjob) + jtext = theirjob.title + if(config.use_exp_restrictions && theirjob.exp_requirements && theirjob.exp_type) + jtext += "*" if(check_rights(R_ADMIN)) - pline = "
  • [key_name_admin(C.mob)]: " + C.get_exp_living() + "
  • " + pline = "
  • [key_name_admin(C.mob)]: [jtext]: " + C.get_exp_living() + "
  • " else - pline = "
  • [key_name_mentor(C.mob)]: " + C.get_exp_living() + "
  • " + pline = "
  • [key_name_mentor(C.mob)]: [jtext]: " + C.get_exp_living() + "
  • " if(C.get_exp_living_num() > 1200) players_old += pline else