mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-09 16:09:15 +00:00
* Does the TG Update 😃 * updates beef stations * test * Revert "test" This reverts commit5b0f78aa70. * 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 commitc88a4f16c3. * Revert "removes more fulp stuff" This reverts commitfd33262a93. * Revert "removes fulp from the .dme to see if we're causing it" This reverts commiteac08bdd21. * remove just gags * Revert "remove just gags" This reverts commit9953031344. * removes the game * Revert "removes the game" This reverts commitef2679ad76. * removes the game again * Revert "removes the game again" This reverts commit7cb3379b68. * deletes only ERTs * Revert "deletes only ERTs" This reverts commite6548bbcec. * deletes modsuits * Revert "deletes modsuits" This reverts commitb0fb973801. * 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
24 lines
829 B
Plaintext
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()
|