GCChatDecryption 是场景进入阶段由服务端主动下发给客户端的聊天解密 Key 同步包。当前版本里,这条包会紧跟在 GCEnterScene 之后发送,用于刷新客户端聊天通道的解密状态。
包信息
| 项目 |
内容 |
| 封包 ID |
1025 |
| 包名 |
GCChatDecryption |
| 方向 |
GC 游戏服 -> 客户端 |
| 固定包长 |
4 |
| 当前 Lua 协议定义 |
/home/ubuntu/Game2/services/game/packet.lua |
| 当前主发送点 |
/home/ubuntu/Game2/services/scene/scenecore.lua、/home/ubuntu/Game2/services/scene/dynamicscenecore.lua |
| 当前用途 |
下发聊天解密 Key,供客户端更新聊天解密状态 |
当前 Game.exe 可直接确认:
GetPacketID() = 1025;
GetPacketSize() = 4;
Read() = read_u32(key);
Write() = write_u32(key);
Execute() = 更新客户端聊天解密 Key;
包体结构
| 偏移 |
长度 |
字段 |
类型 |
含义 |
0x00 |
0x04 |
key |
uint32 |
聊天解密 Key |
当前实际行为
- 当前 Lua 会在角色进入普通场景和动态场景时发送这条包。
- 当前项目现役发送值固定为
25179465。
- 当前客户端
Execute() 会把 key 写入聊天解密管理链,不需要额外回包。
- 当前版本没有检出别的 Lua 发送分支,也没有检出不同 Key 的动态计算逻辑。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 普通场景发送:
/home/ubuntu/Game2/services/scene/scenecore.lua
- 动态场景发送:
/home/ubuntu/Game2/services/scene/dynamicscenecore.lua
关键代码
当前 Lua 协议定义
packet.GCChatDecryption = {
xy_id = packet.XYID_GC_CHAT_DECRYPTION,
ctor = function(self)
self.key = 0
end,
bis = function(self, buffer)
local stream = bistream.new()
stream:attach(buffer)
self.key = stream:readuint()
end,
bos = function(self)
local stream = bostream.new()
stream:writeuint(self.key)
return stream:get()
end
}
当前 Lua 发送点
ret = packet_def.GCChatDecryption.new()
ret.key = 25179465
self:send2client(to, ret)
当前 Game.exe 关键结论
__int64 GetPacketID() { return 1025; }
__int64 GetPacketSize() { return 4; }
__int64 Write(Packet *pkt, Stream *s) {
s->Write(&pkt->key, 4);
return 1;
}
__int64 Read(Packet *pkt, Stream *s) {
s->Read(&pkt->key, 4);
return 1;
}
结论
GCChatDecryption 是固定 4 字节的单字段下发包。
- 这条包当前专门用于同步聊天解密 Key。
- 现役 Lua 在进入场景后固定发送
25179465。
- 客户端收到后立即刷新聊天解密状态,不存在专用回包。
|