diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index ed69951652c..f32b2ffce95 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -2,6 +2,8 @@ // Player Verbs +/* +// Player's "check my EXP" verb, commented by request of Neca /client/verb/check_exp() set name = "EXP" set desc = "Shows your EXP status" @@ -12,14 +14,14 @@ body += get_exp_report() body += "" src << browse(body, "window=playerexp;size=550x615") - +*/ // Admin Verbs -/client/proc/cmd_mentor_check_player_exp() //Allows mentors / admins to determine who the newer players are. +/client/proc/cmd_admin_check_player_exp() //Allows admins to determine who the newer players are. set category = "Admin" set name = "Check Player XP" - if(!check_rights(R_MENTOR|R_MOD|R_ADMIN)) + if(!check_rights(R_ADMIN)) return var/msg = "EXP Report
" for(var/client/C in clients) @@ -29,10 +31,11 @@ msg += "
- [key_name_admin(C.mob)]: " + C.get_exp_general() + " " if(msg != "") src << browse(msg, "window=Player_exp_check") - + log_admin("[key_name(usr)] checked player EXP") + feedback_add_details("admin_verb","MEXP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_show_exp_panel(var/client/C in clients) - if(!check_rights(R_MENTOR|R_MOD|R_ADMIN)) + if(!check_rights(R_ADMIN)) return var/body = "EXP for [C.key]
" body += C.get_exp_report() @@ -40,7 +43,7 @@ src << browse(body, "window=playerexp;size=550x615") -// Debug verbs +// Admin Debug verbs /client/verb/add_exp() set name = "EXP Add" @@ -49,7 +52,8 @@ if(!check_rights(R_DEBUG)) return update_exp(60, 1) - + log_admin("[key_name(usr)] granted player EXP") + feedback_add_details("admin_verb","GEXP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! // Procs @@ -92,8 +96,9 @@ return "[src] has no client." /client/proc/get_exp_report() + if(!config.use_exp_tracking) + return "EXP tracking is disabled in the server configuration file." var/return_text = "" - //to_chat(src,"MARK 1 [return_text]") var/list/play_records = params2list(prefs.exp) var/exp_gen = text2num(play_records["gen"]) var/exp_com = text2num(play_records["com"]) @@ -107,30 +112,28 @@ var/exp_gho = text2num(play_records["gho"]) var/exp_imm = text2num(play_records["imm"]) if(play_records.len) - //to_chat(src,"MARK 2 [return_text]") if(exp_gen > 0) - return_text += "Experience:
- General: [exp_gen]" + return_text += "Experience:
- General: " + get_exp_format(exp_gen) if(exp_com > 0) - return_text += "
- Command: [exp_com]" + return_text += "
- Command: " + get_exp_format(exp_com) if(exp_sec > 0) - return_text += "
- Security: [exp_sec]" + return_text += "
- Security: " + get_exp_format(exp_sec) if(exp_sci > 0) - return_text += "
- Science: [exp_sci]" + return_text += "
- Science: " + get_exp_format(exp_sci) if(exp_eng > 0) - return_text += "
- Engineering: [exp_eng]" + return_text += "
- Engineering: " + get_exp_format(exp_eng) if(exp_med > 0) - return_text += "
- Medical: [exp_med]" + return_text += "
- Medical: " + get_exp_format(exp_med) if(exp_sup > 0) - return_text += "
- Support: [exp_sup]" + return_text += "
- Support: " + get_exp_format(exp_sup) if(exp_sil > 0) - return_text += "
- Silicon: [exp_sil]" + return_text += "
- Silicon: " + get_exp_format(exp_sil) if(exp_ant > 0) - return_text += "
- Special: [exp_ant]" + return_text += "
- Special: " + get_exp_format(exp_ant) if(exp_gho > 0) - return_text += "
- Ghost: [exp_gho]" + return_text += "
- Ghost: " + get_exp_format(exp_gho) if(exp_imm > 0) return_text += "
- Grandfathered: YES" - //to_chat(src,"MARK 3 [return_text]") var/list/jobs_locked = list() var/list/jobs_unlocked = list() for(var/datum/job/job in job_master.occupations) @@ -140,24 +143,15 @@ else if(has_exp_for_job(mob, job.title)) jobs_unlocked += "
- " + job.title else - jobs_locked += "
- " + job.title + " (" + play_records[job.exp_type] + " / [job.exp_requirements] [job.exp_type] EXP)" + jobs_locked += "
- " + job.title + " (" + get_exp_format(text2num(play_records[job.exp_type])) + " / " + get_exp_format(job.exp_requirements) + " [job.exp_type] EXP)" if(jobs_unlocked.len) return_text += "

Jobs Unlocked: " - //var/counter = 0 for(var/text in jobs_unlocked) - //if(counter) - // return_text += "," return_text += text - //counter++ if(jobs_locked.len) return_text += "

Jobs Not Unlocked: " - //counter = 0 for(var/text in jobs_locked) - //if(counter) - // return_text += "," return_text += text - //counter++ - //to_chat(src,"MARK 4 [return_text]") return return_text else return "[src] has no EXP records." @@ -165,22 +159,25 @@ /client/proc/get_exp_general() var/list/play_records = params2list(prefs.exp) var/exp_gen = text2num(play_records["gen"]) - return num2text(round(exp_gen / 60)) + "h" + return get_exp_format(exp_gen) +/client/proc/get_exp_format(var/expnum) + if(expnum > 0) + return num2text(round(expnum / 60)) + "h" + else + return "0h" /proc/update_exp(var/minutes, var/announce_changes = 0) if(!establish_db_connection()) return -1 for(var/client/C in clients) if(C.inactivity < (10 MINUTES)) - //var/list/play_records = params2list(C.prefs.exp) var/DBQuery/exp_read = dbcon.NewQuery("SELECT exp FROM [format_table_name("player")] WHERE ckey='[C.ckey]'") exp_read.Execute() var/list/play_records = list() while(exp_read.NextRow()) play_records = params2list(exp_read.item[1]) - // ------------- for(var/rtype in list("gen","com","sec","sci","eng","med","sup","sil","ant", "gho", "imm")) if(!text2num(play_records[rtype])) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 101e6209ff0..af3469e55fb 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -42,8 +42,8 @@ var/global/nologevent = 0 body += "Options panel for [M]" if(M.client) body += " played by [M.client] " - body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\]" - body += " XP: " + M.client.get_exp_general() + " " + body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\] " + body += "\[" + M.client.get_exp_general() + "\]" if(istype(M, /mob/new_player)) body += " Hasn't Entered Game " diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index e4a21161ccc..5270e4750e5 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -2,8 +2,7 @@ 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_player_exp + /client/proc/cmd_mentor_check_new_players ) var/list/admin_verbs_admin = list( /client/proc/check_antagonists, /*shows all antags*/ @@ -75,7 +74,8 @@ var/list/admin_verbs_admin = list( /client/proc/change_human_appearance_self, /* Allows the human-based mob itself change its basic appearance */ /client/proc/debug_variables, /client/proc/show_snpc_verbs, - /client/proc/reset_all_tcs /*resets all telecomms scripts*/ + /client/proc/reset_all_tcs, /*resets all telecomms scripts*/ + /client/proc/cmd_admin_check_player_exp ) var/list/admin_verbs_ban = list( /client/proc/unban_panel,