diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index e5f08b82bc..c12fd1de10 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -1261,6 +1261,10 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
if(!check_rights(R_ADMIN))
return
+ if(!CONFIG_GET(flag/use_exp_tracking))
+ to_chat(usr, "Tracking is disabled in the server configuration file.")
+ return
+
var/list/msg = list()
msg += "
Playtime ReportPlaytime:
"
for(var/client/C in GLOB.clients)
@@ -1274,6 +1278,9 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
if(!C)
to_chat(usr, "ERROR: Client not found.")
return
+ if(!CONFIG_GET(flag/use_exp_tracking))
+ to_chat(usr, "Tracking is disabled in the server configuration file.")
+ return
var/list/body = list()
body += "Playtime for [C.key]
Playtime:"
diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm
index 298091ef59..e05d1d06c4 100644
--- a/code/modules/client/client_procs.dm
+++ b/code/modules/client/client_procs.dm
@@ -621,6 +621,8 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
/client/proc/add_verbs_from_config()
if(CONFIG_GET(flag/see_own_notes))
verbs += /client/proc/self_notes
+ if(CONFIG_GET(flag/use_exp_tracking))
+ verbs += /client/proc/self_playtime
#undef TOPIC_SPAM_DELAY
diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm
index e3e9842703..365e9bfde8 100644
--- a/code/modules/client/verbs/ooc.dm
+++ b/code/modules/client/verbs/ooc.dm
@@ -246,6 +246,21 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR)
browse_messages(null, usr.ckey, null, TRUE)
+/client/proc/self_playtime()
+ set name = "View tracked playtime."
+ set category = "OOC"
+ set desc = "View the amount of playtime for roles the server has tracked."
+
+ if(!CONFIG_GET(flag/use_exp_tracking))
+ to_chat(usr, "Sorry, tracking is currently disabled.")
+ return
+
+ var/list/body = list()
+ body += "Playtime for [key]
Playtime:"
+ body += get_exp_report()
+ body += ""
+ usr << browse(body.Join(), "window=playerplaytime[ckey];size=550x615")
+
/client/proc/ignore_key(client)
var/client/C = client
if(C.key in prefs.ignoring)
diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm
index a16f2ae163..9bbb753de6 100644
--- a/code/modules/jobs/job_exp.dm
+++ b/code/modules/jobs/job_exp.dm
@@ -12,7 +12,7 @@ GLOBAL_PROTECT(exp_to_update)
return 0
if(!job_is_xp_locked(src.title))
return 0
- if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights(R_ADMIN, FALSE, C.mob))
+ if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights_for(C,R_ADMIN))
return 0
var/isexempt = C.prefs.db_flags & DB_FLAG_EXEMPT
if(isexempt)
@@ -73,10 +73,18 @@ GLOBAL_PROTECT(exp_to_update)
else
exp_data[category] = 0
for(var/category in GLOB.exp_specialmap)
- if(play_records[category])
- exp_data[category] = text2num(play_records[category])
+ if(category == EXP_TYPE_SPECIAL || category == EXP_TYPE_ANTAG)
+ if(GLOB.exp_specialmap[category])
+ for(var/innercat in GLOB.exp_specialmap[category])
+ if(play_records[innercat])
+ exp_data[innercat] = text2num(play_records[innercat])
+ else
+ exp_data[innercat] = 0
else
- exp_data[category] = 0
+ if(play_records[category])
+ exp_data[category] = text2num(play_records[category])
+ else
+ exp_data[category] = 0
if(prefs.db_flags & DB_FLAG_EXEMPT)
return_text += "- Exempt (all jobs auto-unlocked)
"
@@ -87,7 +95,7 @@ GLOBAL_PROTECT(exp_to_update)
return_text += "- [dep] [get_exp_format(exp_data[dep])] ([percentage]%)
"
else
return_text += "- [dep] [get_exp_format(exp_data[dep])]
"
- if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights(R_ADMIN, 0, mob))
+ if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights_for(src,R_ADMIN))
return_text += "- Admin (all jobs auto-unlocked)
"
return_text += "
"
var/list/jobs_locked = list()