Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gives runtime access the ability to view timer logs and debug timers #22451

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/controllers/subsystem/SStimer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ GLOBAL_LIST_EMPTY(timers_by_type)
set category = "Debug"
set desc = "Shows the log of what types created timers this round"

if(!check_rights(R_DEBUG))
if(!check_rights(R_DEBUG | R_VIEWRUNTIMES))
return

var/list/sorted = sortTim(GLOB.timers_by_type, GLOBAL_PROC_REF(cmp_numeric_dsc), TRUE)
Expand All @@ -598,6 +598,9 @@ GLOBAL_LIST_EMPTY(timers_by_type)
set category = "Debug"
set desc = "Shows currently active timers, grouped by callback"

if(!check_rights(R_DEBUG | R_VIEWRUNTIMES))
return

var/list/timers = list()
for(var/id in SStimer.timer_id_dict)
var/datum/timedevent/T = SStimer.timer_id_dict[id]
Expand Down
2 changes: 2 additions & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list(
verbs += /client/proc/ss_breakdown
verbs += /client/proc/show_gc_queues
verbs += /client/proc/toggle_mctabs
verbs += /client/proc/debug_timers
verbs += /client/proc/timer_log
GDNgit marked this conversation as resolved.
Show resolved Hide resolved
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

Expand Down