Files
fulpstation/code/__HELPERS/stoplag.dm
John Willard d535503645 [MDB IGNORE] May TGU (#635)
* Does the TG Update 😃

* updates beef stations

* test

* Revert "test"

This reverts commit 5b0f78aa70.

* F'ed up

* removes fulp from the .dme to see if we're causing it

* removes more fulp stuff

* ANOTHER fulp edit

* Revert "ANOTHER fulp edit"

This reverts commit c88a4f16c3.

* Revert "removes more fulp stuff"

This reverts commit fd33262a93.

* Revert "removes fulp from the .dme to see if we're causing it"

This reverts commit eac08bdd21.

* remove just gags

* Revert "remove just gags"

This reverts commit 9953031344.

* removes the game

* Revert "removes the game"

This reverts commit ef2679ad76.

* removes the game again

* Revert "removes the game again"

This reverts commit 7cb3379b68.

* deletes only ERTs

* Revert "deletes only ERTs"

This reverts commit e6548bbcec.

* deletes modsuits

* Revert "deletes modsuits"

This reverts commit b0fb973801.

* fix checks please

* second attempt

* attempt 3

* modsuit stuff

* id trimmers to all offices

* tgu again + removes fulp ert

* pass checks... Now!

* minor screwup my bad

* Pass checks... Now!

* pass checks.. Now!

* fix checks... Now!

* fixes selene windoors

* fixes deputy mood boost

* delimber organs
2022-05-19 06:58:33 -06:00

24 lines
829 B
Plaintext

//Key thing that stops lag. Cornerstone of performance in ss13, Just sitting here, in unsorted.dm. Now with dedicated file!
///Increases delay as the server gets more overloaded, as sleeps aren't cheap and sleeping only to wake up and sleep again is wasteful
#define DELTA_CALC max(((max(TICK_USAGE, world.cpu) / 100) * max(Master.sleep_delta-1,1)), 1)
///returns the number of ticks slept
/proc/stoplag(initial_delay)
if (!Master || Master.init_stage_completed < INITSTAGE_MAX)
sleep(world.tick_lag)
return 1
if (!initial_delay)
initial_delay = world.tick_lag
. = 0
var/i = DS2TICKS(initial_delay)
do
. += CEILING(i * DELTA_CALC, 1)
sleep(i * world.tick_lag * DELTA_CALC)
i *= 2
while (TICK_USAGE > min(TICK_LIMIT_TO_RUN, Master.current_ticklimit))
#undef DELTA_CALC
#define UNTIL(X) while(!(X)) stoplag()