GCPlayerShopSaleShopOptResult 是玩家商店收购店操作的直接结果包,用来返回本次操作类型和结果值。
包信息
| 项目 |
内容 |
| 封包 ID |
276 |
| 包名 |
GCPlayerShopSaleShopOptResult |
| 方向 |
Server -> Client |
| 对应请求 |
CGPlayerShopSaleShopOpt |
| 固定包长 |
14 |
| 作用 |
返回收购店操作类型和结果值 |
包体结构
| 偏移 |
长度 |
字段 |
类型 |
含义 |
0x00 |
0x0C |
shop_id |
PlayerShopGUID |
目标玩家商店 GUID |
0x0C |
0x01 |
opt_type |
uint8 |
本次收购操作类型 |
0x0D |
0x01 |
result |
uint8 |
结果值;当前成功路径固定为 0 |
总长度:
14 字节
当前实际行为
- 当前场景服统一通过
send_player_shop_sale_shop_opt_result() 发送这条包。
- 现役实现里
unknow_1 实际就是 opt_type,unknow_2 实际就是 result。
- 成功路径发送完这条包后,通常还会紧跟一条
GCPlayerShopSaleShopInfo 刷新整张收购店界面。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 发送点:
/home/ubuntu/Game2/services/scene/scenecore.lua
- 对应请求文档:
/home/ubuntu/Game2/docs/07_登录_网络_封包/packet.CGPlayerShopSaleShopOpt.md
关键代码
local function send_player_shop_sale_shop_opt_result(scene, obj_me, shop, opt_type, result)
local msg = packet_def.GCPlayerShopSaleShopOptResult.new()
msg.shop_id = shop:get_guid()
msg.unknow_1 = math.floor(tonumber(opt_type) or 0)
msg.unknow_2 = math.floor(tonumber(result) or 0)
scene:send2client(obj_me, msg)
end
结论
GCPlayerShopSaleShopOptResult(276) 是收购店操作的短结果包。
- 结构可以明确写成
shop_id + opt_type + result。
- 当前成功路径下,
result 固定写 0,并会继续补发 GCPlayerShopSaleShopInfo。
|