-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] makes verb callbacks not execute if the original client disc…
…onnected [MDB IGNORE] (#861) * makes verb callbacks not execute if the original client disconnected (#79964) --------- Co-authored-by: SkyratBot <[email protected]> Co-authored-by: Kylerace <[email protected]> Co-authored-by: san7890 <the@ san7890.com>
- Loading branch information
1 parent
1d0200e
commit 186ff92
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
///like normal callbacks but they also record their creation time for measurement purposes | ||
///they also require the same usr/user that made the callback to both still exist and to still have a client in order to execute | ||
/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) | ||
. = ..() | ||
|
||
#ifndef UNIT_TESTS | ||
/datum/callback/verb_callback/Invoke(...) | ||
var/mob/our_user = user?.resolve() | ||
if(QDELETED(our_user) || isnull(our_user.client)) | ||
return | ||
var/mob/temp = usr | ||
. = ..() | ||
usr = temp | ||
|
||
/datum/callback/verb_callback/InvokeAsync(...) | ||
var/mob/our_user = user?.resolve() | ||
if(QDELETED(our_user) || isnull(our_user.client)) | ||
return | ||
var/mob/temp = usr | ||
. = ..() | ||
usr = temp | ||
#endif | ||
|
||
|