mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Programmatic Profiler Access (#13524)
* Programmatic Profiler Access * Why do I never proof-read until submitting
This commit is contained in:
@@ -68,6 +68,10 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
C.holder = null
|
||||
GLOB.admins.Cut()
|
||||
|
||||
// Remove all profiler access
|
||||
for(var/A in world.GetConfig("admin"))
|
||||
world.SetConfig("APP/admin", A, null)
|
||||
|
||||
if(config.admin_legacy_system)
|
||||
load_admin_ranks()
|
||||
|
||||
@@ -98,6 +102,9 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
//create the admin datum and store it for later use
|
||||
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
|
||||
|
||||
if(D.rights & R_DEBUG || D.rights & R_VIEWRUNTIMES) // Grants profiler access to anyone with R_DEBUG or R_VIEWRUNTIMES
|
||||
world.SetConfig("APP/admin", ckey, "role=admin")
|
||||
|
||||
//find the client for a ckey if they are connected and associate them with the new admin datum
|
||||
D.associate(GLOB.directory[ckey])
|
||||
|
||||
@@ -122,6 +129,9 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
if(istext(rights)) rights = text2num(rights)
|
||||
var/datum/admins/D = new /datum/admins(rank, rights, ckey)
|
||||
|
||||
if(D.rights & R_DEBUG || D.rights & R_VIEWRUNTIMES) // Grants profiler access to anyone with R_DEBUG or R_VIEWRUNTIMES
|
||||
world.SetConfig("APP/admin", ckey, "role=admin")
|
||||
|
||||
//find the client for a ckey if they are connected and associate them with the new admin datum
|
||||
D.associate(GLOB.directory[ckey])
|
||||
if(!GLOB.admin_datums)
|
||||
|
||||
@@ -247,6 +247,8 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
verbs += GLOB.admin_verbs_server
|
||||
if(holder.rights & R_DEBUG)
|
||||
verbs += GLOB.admin_verbs_debug
|
||||
spawn(1)
|
||||
control_freak = 0 // Setting control_freak to 0 allows you to use the Profiler and other client-side tools
|
||||
if(holder.rights & R_POSSESS)
|
||||
verbs += GLOB.admin_verbs_possess
|
||||
if(holder.rights & R_PERMISSIONS)
|
||||
@@ -267,6 +269,9 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
verbs += GLOB.admin_verbs_proccall
|
||||
if(holder.rights & R_VIEWRUNTIMES)
|
||||
verbs += /client/proc/view_runtimes
|
||||
spawn(1) // This setting exposes the profiler for people with R_VIEWRUNTIMES. They must still have it set in cfg/admin.txt
|
||||
control_freak = 0
|
||||
|
||||
|
||||
/client/proc/remove_admin_verbs()
|
||||
verbs.Remove(
|
||||
|
||||
Reference in New Issue
Block a user