From ae150affba3e6b701d27aa8ea66edf474af663ef Mon Sep 17 00:00:00 2001 From: Joywayer Date: Sun, 28 Jun 2026 20:38:10 +0800 Subject: [PATCH] =?UTF-8?q?docs(protocol):=2004=20=E5=9B=9E=E5=A1=AB=20pla?= =?UTF-8?q?yer=5Flogin=20=E7=9C=9F=E6=9C=BA=E8=81=94=E8=B0=83=E5=AE=9E?= =?UTF-8?q?=E6=B5=8B(=E5=90=AB=20agentname/agentmode/gameversion)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/protocol/04-数据结构.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/protocol/04-数据结构.md b/docs/protocol/04-数据结构.md index 06b6e17..ddbee9f 100644 --- a/docs/protocol/04-数据结构.md +++ b/docs/protocol/04-数据结构.md @@ -196,6 +196,18 @@ else { this.initialBean = _data.initialBean; } // 临时填充:保留原 > `openid/nickname/avatar/sex/city/province/unionid/tel` 仅在 `GameData.sysConfig.deviceLogin` 为真时被读取并通过 `SetWxInfo` 写入 C_Player(`07_Desk.js:215`–`230`)。非设备登录时这些信息由微信授权链路另行获取。 +> **✅ 真机联调实测确认(2026-06-28,YouleNexus + 本地测试服)**:成功登录回包(单层 `{app,route,rpc,data}`,见 [01 §3.2](01-传输层与架构.md))`data` 实测为: +> ```json +> {"state":0,"playerid":430511,"agentid":"…","channelid":"…","nickname":"…","avatar":"…","openid":"…","sex":0,"unionid":"…","roomcard":3,"bean":0,"score":0,"invitecode":null,"advanced":0,"taskstate":1,"ip":"127.0.0.1","bankpower":1,"bank":0,"sign":null,"tel":null,"initCard":"3","initBean":"0","bankpwd":0, +> "agentname":"进贤","agentmode":2,"gameversion":41} +> ``` +> 上表 A 组字段均得到印证。另含**文档此前未列**的三个字段(旧客户端 `Desk.login` 未读、属代理/版本信息): +> - `agentname` string —— 代理商名称(实测"进贤")。 +> - `agentmode` int —— 代理模式(实测 2)。 +> - `gameversion` int —— 服务器侧游戏版本(实测 41)。 +> +> 同时确认 **请求 `player_login.data.version` 字段须为数字 versionCode**(实测发 `10000` 通过;发字符串 `"1.1"` 被 `kick_server`「检查到新版本」拒绝),与源码 `data.version=GameData.versionCode` 一致。 + ### B. 房间恢复(在房 / 断线重连时才下发) 仅当 `_msg.data.roomcode` 存在时进入此分支(`07_Desk.js:282`),代表玩家原本就在房间内。