Merge branch 'feature/rate_limiter'
This commit is contained in:
commit
5c7fa5d5e0
@ -521,7 +521,7 @@ function ping.syncState(tbl)
|
|||||||
for k, v in pairs(tbl) do
|
for k, v in pairs(tbl) do
|
||||||
local_state[k]=v
|
local_state[k]=v
|
||||||
end
|
end
|
||||||
PartsManager.refreshAll()
|
rateLimit(1, PartsManager.refreshAll, "refreshAll")
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
@ -579,6 +579,12 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function rateLimit(ticks, next, name)
|
||||||
|
if cooldown(ticks+1, name) then
|
||||||
|
namedWait(ticks, next, name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
|
||||||
@ -631,7 +637,6 @@ function tick()
|
|||||||
ping.oof(player.getHealth())
|
ping.oof(player.getHealth())
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if old_state.isUnderwater ~= player.isUnderwater() then syncState() end
|
if old_state.isUnderwater ~= player.isUnderwater() then syncState() end
|
||||||
old_state.isUnderwater=player.isUnderwater()
|
old_state.isUnderwater=player.isUnderwater()
|
||||||
-- End of tick --
|
-- End of tick --
|
||||||
|
Loading…
x
Reference in New Issue
Block a user