GCPlayerShopStallStatus 是当前旧版九州商会系统仍在使用的店面状态变更包。玩家扩充或缩减店面数量成功后,场景服会把目标店铺 GUID、被修改的店面索引、该店面的新状态以及最终店面数量一起下发给客户端。
包信息
| 项目 |
内容 |
| 封包 ID |
198 |
| 包名 |
GCPlayerShopStallStatus |
| 方向 |
Server -> Client |
| 包长 |
15 |
| 对应请求 |
CGPlayerShopSize |
| 当前 Lua 协议定义 |
已实现 |
| 作用 |
通知客户端某个店面的开关状态和最终店面数已经发生变化 |
包体结构
| 偏移 |
长度 |
字段 |
类型 |
含义 |
0x00 |
0x02 |
shop_id.world |
uint16 |
商店 GUID 的 world 段 |
0x02 |
0x04 |
shop_id.server |
uint32 |
商店 GUID 的 server 段 |
0x06 |
0x04 |
shop_id.scene |
uint32 |
商店 GUID 的 scene 段 |
0x0A |
0x02 |
shop_id.pollpos |
uint16 |
商店 GUID 的 pollpos 段 |
0x0C |
0x01 |
stall_index |
uint8 |
被修改的店面索引,按客户端 0 基序号回传 |
0x0D |
0x01 |
status |
uint8 |
该店面新的状态值 |
0x0E |
0x01 |
final_stall_num |
uint8 |
修改完成后的店面总数 |
当前实际行为
- 当前
Game.exe 中,GetPacketID() 返回 198,GetPacketSize() 返回 15。
- 当前 Lua 协议定义与
Game.exe 完全一致,固定为 PlayerShopGUID(12) + stall_index + status + final_stall_num。
- 现役发送点位于
scenecore:char_player_shop_size():
- 扩容成功时,把新开出的店面状态设为
STALL_CLOSE(1) 并返回
- 缩容成功时,把最后一个店面状态设为
STALL_INVALID(0) 并返回
- 当前主链实际发送的
status 至少有两个值可以明确确认:
1 = STALL_CLOSE
0 = STALL_INVALID
stall_index 返回的是本次被修改的那一格店面序号,当前实现按 0 基值回给客户端。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 现役发送点:
/home/ubuntu/Game2/services/scene/scenecore.lua
关键代码
packet.GCPlayerShopStallStatus = {
bis = function(self, buffer)
local stream = bistream.new()
stream:attach(buffer)
self.shop_id = packet.PlayerShopGUID.new()
self.shop_id:bis(stream)
self.stall_index = stream:readuchar()
self.status = stream:readuchar()
self.final_stall_num = stream:readuchar()
end
}
local msg = packet_def.GCPlayerShopStallStatus.new()
if pss.opt == OPT.TYPE_EXPAND then
msg.shop_id = shop:get_guid()
msg.stall_index = cur_stall_num
msg.status = stall_box.STATUS_STALL.STALL_CLOSE
msg.final_stall_num = cur_stall_num + 1
elseif pss.opt == OPT.TYPE_SHRINK then
msg.shop_id = shop:get_guid()
msg.stall_index = cur_stall_num - 1
msg.status = stall_box.STATUS_STALL.STALL_INVALID
msg.final_stall_num = cur_stall_num - 1
end
self:send2client(obj_me, msg)
结论
GCPlayerShopStallStatus(198) 是当前版本现役的店面状态变更通知包,结构已经可以明确写成 PlayerShopGUID + stall_index + status + final_stall_num。它不是商品详情包,而是专门用于扩缩容结果反馈的状态同步包。
|