re-adding debug panel, adds more junk

This commit is contained in:
DragonTrance
2022-11-12 11:00:14 -05:00
parent 3d41e614a8
commit 5cf5407bb5
7 changed files with 104 additions and 8 deletions
+9 -3
View File
@@ -7,6 +7,7 @@ SUBSYSTEM_DEF(timer)
name = "Timer"
wait = 1 //SS_TICKER subsystem, so wait is in ticks
init_order = INIT_ORDER_TIMER
priority = FIRE_PRIORITY_TIMER
flags = SS_TICKER|SS_NO_INIT
@@ -27,6 +28,7 @@ SUBSYSTEM_DEF(timer)
var/last_invoke_tick = 0
var/static/last_invoke_warning = 0
var/static/bucket_auto_reset = TRUE
var/bucket_total_resets = 0
/datum/controller/subsystem/timer/PreInit()
bucket_list.len = BUCKET_LEN
@@ -235,6 +237,7 @@ SUBSYSTEM_DEF(timer)
. += ", NO CALLBACK"
/datum/controller/subsystem/timer/proc/reset_buckets()
bucket_total_resets++
var/list/bucket_list = src.bucket_list
var/list/alltimers = list()
//collect the timers currently in the bucket
@@ -317,6 +320,7 @@ SUBSYSTEM_DEF(timer)
var/timeToRun
var/wait
var/hash
var/source
var/list/flags
var/spent = 0 //time we ran the timer.
var/name //for easy debugging.
@@ -324,13 +328,14 @@ SUBSYSTEM_DEF(timer)
var/datum/timedevent/next
var/datum/timedevent/prev
/datum/timedevent/New(datum/callback/callBack, wait, flags, hash)
/datum/timedevent/New(datum/callback/callBack, wait, flags, hash, source)
var/static/nextid = 1
id = TIMER_ID_NULL
src.callBack = callBack
src.wait = wait
src.flags = flags
src.hash = hash
src.source = source
if (flags & TIMER_CLIENT_TIME)
timeToRun = REALTIMEOFDAY + wait
@@ -455,7 +460,8 @@ SUBSYSTEM_DEF(timer)
else
. = "[callBack.object.type]"
/proc/addtimer(datum/callback/callback, wait = 0, flags = 0)
/// Do not call this directly. Instead, use addtimer(callback, wait, flags), which includes source information
/proc/_addtimer(datum/callback/callback, wait = 0, flags = 0, file, line)
if (!callback)
CRASH("addtimer called without a callback")
@@ -496,7 +502,7 @@ SUBSYSTEM_DEF(timer)
else if(flags & TIMER_OVERRIDE)
stack_trace("TIMER_OVERRIDE used without TIMER_UNIQUE")
var/datum/timedevent/timer = new(callback, wait, flags, hash)
var/datum/timedevent/timer = new(callback, wait, flags, hash, file && "[file]:[line]")
return timer.id
/proc/deltimer(id)