mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Adds tracking amount of time spent playing departments 2: The fall of the Assistants. (#29105)
* Ports Paradise Job exp system * changed to use json_decode and json_encode as recommended by oranges * updates changelog * Reee cyberboss * Changes to use a seperate table * Updates database changelog Changes to use mediumint * Back to wip we go. Changes sql stuff to how mso suggested Attempts the changes requested in the other pr. * work on stuff. * work on stuff. * Renamed proc for time remaining. Fixed updating time amounts. Added delay to fix firing at roundstart * exp is now stored in a global list, and only updated to the db at round end. * some stuff * Added button to toggle exempt status on a player. Still need to make it update the db * REEE Jordie. Undoes delaying exp updating to round end. Adds the updating filtering to the update_exp_client proc which is used again * Lowers a bunch of the times needed. * Makes tracking per job instead of per department. Department time is now calculated from job time. * Whoops forgot to update master first. Lemme save this Reverb should play cheeki breeki to people * I think I did this right. Too tired to test atm. Busy rewatching twintails ni narimasu * Removes var from proc arguments Fixes database stuff * Does some requested changes. Makes special_role be tracked instead of bundled under special. * Done, but need to refactor how it handles ghost roles. * Less false data wew * Changes * Updates db version More changes * More changes * More changes * revision fix * OOPS * fix schemas * Makes SQL error logging handled by Execute Gang role tracking now strips out the gang name and is generic.
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
if(M.client)
|
||||
body += " played by <b>[M.client]</b> "
|
||||
body += "\[<A href='?_src_=holder;editrights=rank;ckey=[M.ckey]'>[M.client.holder ? M.client.holder.rank : "Player"]</A>\]"
|
||||
if(config.use_exp_tracking)
|
||||
body += "\[<A href='?_src_=holder;getplaytimewindow=\ref[M]'>" + M.client.get_exp_living() + "</a>\]"
|
||||
|
||||
if(isnewplayer(M))
|
||||
body += " <B>Hasn't Entered Game</B> "
|
||||
|
||||
@@ -60,6 +60,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin())
|
||||
/client/proc/cmd_admin_local_narrate, /*sends text to all mobs within view of atom*/
|
||||
/client/proc/cmd_admin_create_centcom_report,
|
||||
/client/proc/cmd_change_command_name,
|
||||
/client/proc/cmd_admin_check_player_exp, /* shows players by playtime */
|
||||
/client/proc/toggle_antag_hud, /*toggle display of the admin antag hud*/
|
||||
/client/proc/toggle_AI_interact, /*toggle admin ability to interact with machines as an AI*/
|
||||
/client/proc/customiseSNPC, /* Customise any interactive crewmembers in the world */
|
||||
|
||||
@@ -22,6 +22,24 @@
|
||||
else if(href_list["stickyban"])
|
||||
stickyban(href_list["stickyban"],href_list)
|
||||
|
||||
else if(href_list["getplaytimewindow"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/mob/M = locate(href_list["getplaytimewindow"]) in GLOB.mob_list
|
||||
if(!M)
|
||||
to_chat(usr, "<span class='danger'>ERROR: Mob not found.</span>")
|
||||
return
|
||||
cmd_show_exp_panel(M.client)
|
||||
|
||||
else if(href_list["toggleexempt"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/client/C = locate(href_list["toggleexempt"]) in GLOB.clients
|
||||
if(!C)
|
||||
to_chat(usr, "<span class='danger'>ERROR: Client not found.</span>")
|
||||
return
|
||||
toggle_exempt_status(C)
|
||||
|
||||
else if(href_list["makeAntag"])
|
||||
if (!SSticker.mode)
|
||||
to_chat(usr, "<span class='danger'>Not until the round starts!</span>")
|
||||
|
||||
@@ -1211,3 +1211,52 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
|
||||
message_admins("[key_name_admin(usr)] triggered a CentCom recall, with the admiral message of: [message]")
|
||||
log_game("[key_name(usr)] triggered a CentCom recall, with the message of: [message]")
|
||||
SSshuttle.centcom_recall(SSshuttle.emergency.timer, message)
|
||||
|
||||
/client/proc/cmd_admin_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))
|
||||
return
|
||||
|
||||
var/list/msg = list()
|
||||
msg += "<html><head><title>Playtime Report</title></head><body>Playtime:<BR><UL>"
|
||||
for(var/client/C in GLOB.clients)
|
||||
msg += "<LI> - [key_name_admin(C)]: <A href='?_src_=holder;getplaytimewindow=\ref[C.mob]'>" + C.get_exp_living() + "</a></LI>"
|
||||
msg += "</UL></BODY></HTML>"
|
||||
src << browse(msg.Join(), "window=Player_playtime_check")
|
||||
|
||||
/datum/admins/proc/cmd_show_exp_panel(client/C)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
if(!C)
|
||||
to_chat(usr, "<span class='danger'>ERROR: Client not found.</span>")
|
||||
return
|
||||
|
||||
var/list/body = list()
|
||||
body += "<html><head><title>Playtime for [C.key]</title></head><BODY><BR>Playtime:"
|
||||
body += C.get_exp_report()
|
||||
body += "<A href='?_src_=holder;toggleexempt=\ref[C]'>Toggle Exempt status</a>"
|
||||
body += "</BODY></HTML>"
|
||||
usr << browse(body.Join(), "window=playerplaytime[C.ckey];size=550x615")
|
||||
|
||||
/datum/admins/proc/toggle_exempt_status(client/C)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
if(!C)
|
||||
to_chat(usr, "<span class='danger'>ERROR: Client not found.</span>")
|
||||
return
|
||||
|
||||
if(!C.set_db_player_flags())
|
||||
to_chat(usr, "<span class='danger'>ERROR: Unable read player flags from database. Please check logs.</span>")
|
||||
var/dbflags = C.prefs.db_flags
|
||||
var/newstate = FALSE
|
||||
if(dbflags & DB_FLAG_EXEMPT)
|
||||
newstate = FALSE
|
||||
else
|
||||
newstate = TRUE
|
||||
|
||||
if(C.update_flag_db(DB_FLAG_EXEMPT, newstate))
|
||||
to_chat(usr, "<span class='danger'>ERROR: Unable to update player flags. Please check logs.</span>")
|
||||
else
|
||||
message_admins("[key_name_admin(usr)] has [newstate ? "activated" : "deactivated"] job exp exempt status on [key_name_admin(C)]")
|
||||
log_admin("[key_name(usr)] has [newstate ? "activated" : "deactivated"] job exp exempt status on [key_name(C)]")
|
||||
Reference in New Issue
Block a user