From eb8a16956e89508acb2d7c85ef8d5e37e576fc01 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Sat, 20 May 2023 10:11:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/components/lockstep.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/component/components/lockstep.go b/component/components/lockstep.go index facbd96..9df1c5b 100644 --- a/component/components/lockstep.go +++ b/component/components/lockstep.go @@ -56,6 +56,8 @@ func (slf *Lockstep[ClientID, Command]) JoinClient(client component.LockstepClie } // JoinClientWithFrame 加入客户端到广播队列中,并从特定帧开始追帧 +// - 可用于重连及状态同步、帧同步混用的情况 +// - 混用:服务端记录指令时同时做一次状态计算,新客户端加入时直接同步当前状态,之后从特定帧开始广播 func (slf *Lockstep[ClientID, Command]) JoinClientWithFrame(client component.LockstepClient[ClientID], frameIndex int) { slf.clients.Set(client.GetID(), client) if frameIndex > slf.currentFrame {