Presistent clients now actually properly track clients between reloads (#91440)

This commit is contained in:
LemonInTheDark
2025-06-15 15:42:08 -04:00
committed by Roxy
parent 7d5c336549
commit f722a840f0
3 changed files with 21 additions and 15 deletions
+3 -6
View File
@@ -52,17 +52,14 @@
src.key = "[key]_[mock_client_uid++]"
ckey = ckey(key)
#ifdef UNIT_TESTS // otherwise this shit can leak into production servers which is drather bad
#ifdef UNIT_TESTS // otherwise this shit can leak into production servers which is drather dbad
GLOB.directory[ckey] = src
if(GLOB.persistent_clients_by_ckey[ckey])
persistent_client = GLOB.persistent_clients_by_ckey[ckey]
persistent_client.byond_build = byond_build
persistent_client.byond_version = byond_version
else
persistent_client = new(ckey)
persistent_client.byond_build = byond_build
persistent_client.byond_version = byond_version
persistent_client.set_client(src)
#endif
fully_created = TRUE
@@ -70,7 +67,7 @@
/datum/client_interface/Destroy(force)
GLOB.directory -= ckey
if(persistent_client?.client == src)
persistent_client.client = null
persistent_client.set_client(null)
persistent_client = null
return ..()