mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
feat: prepare for alpha release
This commit is contained in:
parent
5a05f01223
commit
f5709c3112
10 changed files with 251 additions and 54 deletions
|
|
@ -287,20 +287,27 @@ local function startSync(onSync: (client: any, payloads: { SyncPayload }) -> ())
|
|||
|
||||
onSyncCallback = onSync
|
||||
|
||||
if game then
|
||||
local elapsedTime = 0
|
||||
|
||||
connection = game:GetService("RunService").Heartbeat:Connect(function(deltaTime)
|
||||
elapsedTime += deltaTime
|
||||
if elapsedTime >= config.interval then
|
||||
elapsedTime %= config.interval
|
||||
debug.profilebegin("CharmSync")
|
||||
flush()
|
||||
debug.profileend()
|
||||
end
|
||||
end)
|
||||
if not game then
|
||||
return stopSync
|
||||
end
|
||||
|
||||
local timer = 0
|
||||
|
||||
connection = game:GetService("RunService").Heartbeat:Connect(function(deltaTime)
|
||||
if config.interval < 0 then
|
||||
return
|
||||
end
|
||||
|
||||
timer += deltaTime
|
||||
|
||||
if timer >= config.interval then
|
||||
timer %= config.interval
|
||||
debug.profilebegin("CharmSync")
|
||||
flush()
|
||||
debug.profileend()
|
||||
end
|
||||
end)
|
||||
|
||||
return stopSync
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue