Protocol version: 1. Schema format: 1.
Framing: DataLen uint32 LE + MsgID uint32 LE + DataLen bytes of UTF-8 JSON.
DataLen excludes the 8-byte header. ProtocolVersion is metadata; it is not added to the wire.
Request and response use the same message ID. No automatic validation, routing or serialization is generated.
| ID |
Message |
Description |
| 1001 |
Authenticate |
TCP 会话鉴权;Token 由现有 HTTP 登录接口签发。 |
| 1002 |
Heartbeat |
更新会话活跃时间,不延长 Token 的绝对有效期。 |
| 2001 |
JoinRoom |
加入应用定义的房间。 |
| 2002 |
LeaveRoom |
离开当前房间。 |
| 3001 |
Progress |
查询当前示例存档。 |
| 3002 |
StarterReward |
领取一次性奖励;发放规则仍由 Go 示例业务实现。 |
| 3003 |
UseItem |
消耗示例道具;库存和事务由应用负责。 |
| Field |
Type |
Optional |
Description |
token |
string |
false |
|
| Field |
Type |
Optional |
Description |
code |
string |
false |
|
data |
json |
true |
|
Empty JSON object ({}).
| Field |
Type |
Optional |
Description |
code |
string |
false |
|
data |
json |
true |
|
| Field |
Type |
Optional |
Description |
room_id |
uint32 |
false |
|
| Field |
Type |
Optional |
Description |
code |
string |
false |
|
data |
json |
true |
|
Empty JSON object ({}).
| Field |
Type |
Optional |
Description |
code |
string |
false |
|
data |
json |
true |
|
Empty JSON object ({}).
| Field |
Type |
Optional |
Description |
code |
string |
false |
|
data |
json |
true |
|
Empty JSON object ({}).
| Field |
Type |
Optional |
Description |
code |
string |
false |
|
data |
json |
true |
|
| Field |
Type |
Optional |
Description |
item_id |
string |
false |
|
| Field |
Type |
Optional |
Description |
code |
string |
false |
|
data |
json |
true |
|