Lag cleaning.

Ports and Improvements to help attack lag.
This commit is contained in:
QuoteFox
2020-07-29 23:54:40 +01:00
parent e47f620e89
commit b1d82e4ff5
9 changed files with 73 additions and 57 deletions
@@ -35,8 +35,6 @@
signal.data["compression"] = 0
signal.mark_done()
if(signal.data["slow"] > 0)
sleep(signal.data["slow"]) // simulate the network lag if necessary
signal.broadcast()
/obj/machinery/telecomms/allinone/attackby(obj/item/P, mob/user, params)
@@ -41,9 +41,6 @@ GLOBAL_VAR_INIT(message_delay, 0) // To make sure restarting the recentmessages
return
GLOB.recentmessages.Add(signal_message)
if(signal.data["slow"] > 0)
sleep(signal.data["slow"]) // simulate the network lag if necessary
signal.broadcast()
if(!GLOB.message_delay)
@@ -31,17 +31,10 @@
if(relay_information(signal, /obj/machinery/telecomms/processor))
return
// failed to send to a processor, relay information anyway
signal.data["slow"] += rand(1, 5) // slow the signal down only slightly
// Try sending it!
var/list/try_send = list(signal.server_type, /obj/machinery/telecomms/hub, /obj/machinery/telecomms/broadcaster, /obj/machinery/telecomms/bus)
var/i = 0
for(var/send in try_send)
if(i)
signal.data["slow"] += rand(0, 1) // slow the signal down only slightly
i++
if(relay_information(signal, send))
break