Add rate limiter to syncState

This commit is contained in:
NullBite 2022-10-17 00:04:21 -04:00
parent 42c7847855
commit 96dd163f47
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -286,9 +286,23 @@ end
-- }}} -- }}}
-- syncState {{{ -- syncState {{{
do
local counter=0
function syncState() function syncState()
ping.setSnoring(skin_state.snore_enabled) -- ping.setSnoring(skin_state.snore_enabled)
ping.syncState(setLocalState()) if counter < 5 then
ping.syncState((setLocalState()))
counter=counter+1
end
end
local function cooldownDecay()
if counter>0 and world.getTime() % 4 == 0 then
counter = counter - 1
end
end
events.TICK:register(cooldownDecay,"syncStateCooldown")
end end
do do