Change all sleep(1)s into sleep(world.tick_lag)s

This commit is contained in:
Jordan Dominion
2024-02-19 16:47:12 -05:00
parent 0bbf7cd46a
commit ae3fa1785e
6 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ TGS_DEFINE_AND_SET_GLOBAL(tgs, null)
world.sleep_offline = FALSE // https://www.byond.com/forum/post/2894866
del(world)
world.sleep_offline = FALSE // just in case, this is BYOND after all...
sleep(1)
sleep(world.tick_lag)
TGS_DEBUG_LOG("BYOND DIDN'T TERMINATE THE WORLD!!! TICK IS: [world.time], sleep_offline: [world.sleep_offline]")
/datum/tgs_api/latest
@@ -69,6 +69,6 @@ TGS_PROTECT_DATUM(/datum/tgs_api)
/datum/tgs_api/proc/Visibility()
return TGS_UNIMPLEMENTED
/datum/tgs_api/proc/TriggerEvent(event_name, list/parameters, wait_for_completion)
return FALSE
+3 -3
View File
@@ -181,7 +181,7 @@
var/json = json_encode(data)
while(requesting_new_port && !override_requesting_new_port)
sleep(1)
sleep(world.tick_lag)
//we need some port open at this point to facilitate return communication
if(!world.port)
@@ -209,7 +209,7 @@
requesting_new_port = FALSE
while(export_lock)
sleep(1)
sleep(world.tick_lag)
export_lock = TRUE
last_interop_response = null
@@ -217,7 +217,7 @@
text2file(json, server_commands_json_path)
for(var/I = 0; I < EXPORT_TIMEOUT_DS && !last_interop_response; ++I)
sleep(1)
sleep(world.tick_lag)
if(!last_interop_response)
TGS_ERROR_LOG("Failed to get export result for: [json]")
+2 -2
View File
@@ -127,7 +127,7 @@
TGS_DEBUG_LOG("RequireInitialBridgeResponse: Starting sleep")
logged = TRUE
sleep(1)
sleep(world.tick_lag)
TGS_DEBUG_LOG("RequireInitialBridgeResponse: Passed")
@@ -279,7 +279,7 @@
pending_events[event_id] = TRUE
do
sleep(1)
sleep(world.tick_lag)
while(pending_events[event_id])
TGS_DEBUG_LOG("Completed wait on event ID: [event_id]")
+1 -1
View File
@@ -65,7 +65,7 @@
if(detached)
// Wait up to one minute
for(var/i in 1 to 600)
sleep(1)
sleep(world.tick_lag)
if(!detached && (!require_channels || length(chat_channels)))
break
+2 -2
View File
@@ -203,7 +203,7 @@ var/run_bridge_test
DetachedChatMessageQueuingP2()
/proc/DetachedChatMessageQueuingP2()
sleep(1)
sleep(world.tick_lag)
DetachedChatMessageQueuingP3()
/proc/DetachedChatMessageQueuingP3()
@@ -240,7 +240,7 @@ var/received_health_check = FALSE
DelayCheckDetach()
/proc/DelayCheckDetach()
sleep(1)
sleep(world.tick_lag)
// hack hack, calling world.TgsChatChannelInfo() will try to delay until the channels come back
var/datum/tgs_api/v5/api = TGS_READ_GLOBAL(tgs)
if(length(api.chat_channels))
+1 -1
View File
@@ -32,4 +32,4 @@
text2file(reason, "test_fail_reason.txt")
world.log << "Terminating..."
del(world)
sleep(1) // https://www.byond.com/forum/post/2894866
sleep(world.tick_lag) // https://www.byond.com/forum/post/2894866