statesync

command
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

README

statesync — WebSocket 状态同步 + replicate 增量 + CatchUp

权威模拟 + spatial AOI + pkg/game/replicate 增量下发,含 Ack/CatchUp/resync 协议。

方向 消息
客户端 → 服务器 ClientMsg{kind:cmd|ack|resync}
服务器 → 客户端 ServerMsg{kind:delta|catchup}
  • delta: replicate.Delta(spawn/update/despawn/baseline)
  • catchup: 补发缺口;truncated=true 时客户端发 resync 触发 baseline 重同步
  • 延迟补偿: inputclock + snapbuf + lagcomp(cmd 带 client_frame)
go run ./examples/statesync

端口 127.0.0.1:8124;进程内 3 bot 校验 baseline、CatchUp 与 AOI。

Documentation

Overview

statesync demo:权威模拟 + spatial AOI + pkg/replicate 增量同步 + CatchUp/Ack。

协议:ClientMsg{kind:cmd|ack|resync} / ServerMsg{kind:delta|catchup} catchup.truncated=true 时客户端发 resync,服务器 DropViewer 下帧重发 baseline。

运行:go run ./examples/statesync

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL