GCPetSoulXiShuXing 是宠魂洗属性功能的结果下发包。当前版本里,这条包固定携带 6 组属性类型和值,result = 1 用于下发洗练预览结果,result = 2 用于下发确认后的正式属性结果。
包信息
| 项目 |
内容 |
| 封包 ID |
1039 |
| 包名 |
GCPetSoulXiShuXing |
| 方向 |
GC 游戏服 -> 客户端 |
| 固定包长 |
52 |
| 当前 Lua 协议定义 |
/home/ubuntu/Game2/services/game/packet.lua |
| 当前主发送点 |
/home/ubuntu/Game2/lualib/script_base.lua |
| 当前用途 |
下发宠魂洗属性预览结果或确认结果 |
当前 Game.exe 可直接确认:
GetPacketID() = 1039;
GetPacketSize() = 52;
Read() = result + 6 * { type, value };
Write() = result + 6 * { type, value };
Execute() = 刷新宠魂洗属性结果界面;
包体结构
| 偏移 |
长度 |
字段 |
类型 |
含义 |
0x00 |
0x04 |
result |
int32 |
结果类型;当前现役为 1 预览、2 确认 |
0x04 |
0x04 |
attr_1_type |
int32 |
第 1 组属性类型 |
0x08 |
0x04 |
attr_1_value |
int32 |
第 1 组属性值 |
0x0C |
0x04 |
attr_2_type |
int32 |
第 2 组属性类型 |
0x10 |
0x04 |
attr_2_value |
int32 |
第 2 组属性值 |
0x14 |
0x04 |
attr_3_type |
int32 |
第 3 组属性类型 |
0x18 |
0x04 |
attr_3_value |
int32 |
第 3 组属性值 |
0x1C |
0x04 |
attr_4_type |
int32 |
第 4 组属性类型 |
0x20 |
0x04 |
attr_4_value |
int32 |
第 4 组属性值 |
0x24 |
0x04 |
attr_5_type |
int32 |
第 5 组属性类型 |
0x28 |
0x04 |
attr_5_value |
int32 |
第 5 组属性值 |
0x2C |
0x04 |
attr_6_type |
int32 |
第 6 组属性类型 |
0x30 |
0x04 |
attr_6_value |
int32 |
第 6 组属性值 |
当前实际行为
- 当前 Lua 在生成临时洗练结果时,会把
pet_soul_attr 写入角色临时缓存,然后发送 result = 1 的 GCPetSoulXiShuXing 给客户端做预览。
- 玩家确认保存后,服务端会先回
GCItemInfo 更新背包内兽魂数据,再发送 result = 2 的 GCPetSoulXiShuXing 刷新最终属性结果。
- 当前
packet.lua 的 bos 已完整按 result + 6 组属性 序列化,能够满足服务端发送使用。
- 当前
packet.lua 的 bis 只读取了 result 并分配了 6 个空表,属于接收侧占位实现;但这条包在现役服务端是发送包,不影响实际功能。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 预览结果发送:
/home/ubuntu/Game2/lualib/script_base.lua
- 确认保存发送:
/home/ubuntu/Game2/lualib/script_base.lua
- 配套请求入口:
/home/ubuntu/Game2/services/msgagent.lua、/home/ubuntu/Game2/services/scene/scenecore.lua
关键代码
当前 Lua 预览结果发送
local pet_soul_attr = item:get_pet_equip_data():gen_soul_attr(LockValue, LockColorCount)
obj:set_temp_pet_soul_attr_data(BagPos, pet_soul_attr)
local msg = packet_def.GCPetSoulXiShuXing.new()
msg.result = 1
msg.shuxings = pet_soul_attr
obj:get_scene():send2client(obj, msg)
当前 Lua 确认保存发送
local msg = packet_def.GCPetSoulXiShuXing.new()
msg.result = 2
msg.shuxings = data.attr
obj:get_scene():send2client(obj, msg)
结论
GCPetSoulXiShuXing 是固定 52 字节的结果下发包。
- 当前现役语义很明确:
result = 1 表示洗练预览,result = 2 表示确认后的正式结果。
- 包体核心内容始终是
6 组 {属性类型, 属性值}。
- 当前版本的主发送链已经在 Lua 中落地,客户端收到后用于刷新宠魂洗属性界面。
|