Add rate limiter to syncState
This commit is contained in:
parent
42c7847855
commit
96dd163f47
18
script.lua
18
script.lua
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user