mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
Verbs subsystem (#20333)
What it says on the can; now we can better compensate for processing spikes by queueing and accounting for verb times (assuming we actually use this framework to invoke the bulk of them). I have added its use to some of them, more can be ported as time goes on, eventually everything but the most trivial ones should go through this. No player facing changes. Hopefully. Praise be the omnissiah.
This commit is contained in:
@@ -25,7 +25,8 @@ var/list/localhost_addresses = list(
|
||||
If you have any questions about this stuff feel free to ask. ~Carn
|
||||
*/
|
||||
|
||||
/client/Topic(href, href_list, hsrc)
|
||||
//the undocumented 4th argument is for ?[0x\ref] style topic links. hsrc is set to the reference and anything after the ] gets put into hsrc_command
|
||||
/client/Topic(href, href_list, hsrc, hsrc_command)
|
||||
if(!usr || usr != mob) //stops us calling Topic for somebody else's client. Also helps prevent usr=null
|
||||
return
|
||||
|
||||
@@ -257,8 +258,17 @@ var/list/localhost_addresses = list(
|
||||
if(QDELETED(real_src))
|
||||
return
|
||||
|
||||
//fun fact: Topic() acts like a verb and is executed at the end of the tick like other verbs. So we have to queue it if the server is
|
||||
//overloaded
|
||||
if(hsrc && hsrc != holder && DEFAULT_TRY_QUEUE_VERB(VERB_CALLBACK(src, PROC_REF(_Topic), hsrc, href, href_list)))
|
||||
return
|
||||
..() //redirect to hsrc.Topic()
|
||||
|
||||
///dumb workaround because byond doesnt seem to recognize the Topic() typepath for /datum/proc/Topic() from the client Topic,
|
||||
///so we cant queue it without this
|
||||
/client/proc/_Topic(datum/hsrc, href, list/href_list)
|
||||
return hsrc.Topic(href, href_list)
|
||||
|
||||
/proc/client_by_ckey(ckey)
|
||||
return GLOB.directory[ckey]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user