[TM] Verb Queue - Port of TG SSverb subsystem (#19863)

* Some verbs queue up now

* Damn you 515

* Screw you Topic

* Update client_procs.dm

* Fixes for unit testing

* Update MC.dm

* verb

* Update callback.dm

* Tweaks

* Linters might not have liked that,

* More tweaks, and fix

* Update verb_manager.dm
This commit is contained in:
Vi3trice
2023-01-29 15:05:38 +01:00
committed by GitHub
parent 47f71ccde1
commit caee0ec975
19 changed files with 328 additions and 5 deletions
+17
View File
@@ -40,6 +40,7 @@
var/datum/object = GLOBAL_PROC
var/delegate
var/list/arguments
var/usr_uid
/datum/callback/New(thingtocall, proctocall, ...)
if(thingtocall)
@@ -47,6 +48,8 @@
delegate = proctocall
if(length(args) > 2)
arguments = args.Copy(3)
if(usr)
usr_uid = usr.UID()
/proc/ImmediateInvokeAsync(thingtocall, proctocall, ...)
set waitfor = FALSE
@@ -62,6 +65,12 @@
call(thingtocall, proctocall)(arglist(calling_arguments))
/datum/callback/proc/Invoke(...)
if(!usr && usr_uid)
var/mob/M = locateUID(usr_uid)
if(M)
if(length(args))
return world.invoke_callback_with_usr(arglist(list(M, src) + args))
return world.invoke_callback_with_usr(M, src)
if(!object)
return
var/list/calling_arguments = arguments
@@ -77,6 +86,14 @@
//copy and pasted because fuck proc overhead
/datum/callback/proc/InvokeAsync(...)
set waitfor = FALSE
if(!usr && usr_uid)
var/mob/M = locateUID(usr_uid)
if(M)
if(length(args))
return world.invoke_callback_with_usr(arglist(list(M, src) + args))
return world.invoke_callback_with_usr(M, src)
if(!object)
return
var/list/calling_arguments = arguments
+8
View File
@@ -0,0 +1,8 @@
///like normal callbacks but they also record their creation time for measurement purposes
/datum/callback/verb_callback
///the tick this callback datum was created in. used for testing latency
var/creation_time = 0
/datum/callback/verb_callback/New(thingtocall, proctocall, ...)
creation_time = DS2TICKS(world.time)
. = ..()