GCPlayerShopBuyShop 是当前旧版九州商会系统仍在使用的成功通知包。玩家成功买下一家商店后,场景服会把新店铺的 PlayerShopGUID 下发给客户端,作为购买成功的确认数据。
包信息
| 项目 |
内容 |
| 封包 ID |
185 |
| 包名 |
GCPlayerShopBuyShop |
| 方向 |
Server -> Client |
| 包长 |
12 |
| 当前 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 段 |
当前实际行为
- 当前
Game.exe 中,GetPacketID() 返回 185,GetPacketSize() 返回 12。
- 当前 Lua 协议定义与
Game.exe 一致,整包只携带一个 PlayerShopGUID。
- 现役发送点位于
scenecore:char_player_shop_buy_shop():
- 买家支付盘店金额
- 服务端重写店铺 owner、owner_name、status、sale_out 状态与合伙人列表
- 更新买家头衔并发送成交邮件
- 最后下发
GCPlayerShopBuyShop
- 当前 Lua 发送完成后,还会继续发送
GCPlayerShopError,其中错误码实际用于表现“购买成功售出”的结果提示。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 现役发送点:
/home/ubuntu/Game2/services/scene/scenecore.lua
关键代码
packet.GCPlayerShopBuyShop = {
bis = function(self, buffer)
local stream = bistream.new()
stream:attach(buffer)
self.shop_id = packet.PlayerShopGUID.new()
self.shop_id:bis(stream)
end,
bos = function(self)
local stream = bostream.new()
packet.PlayerShopGUID.bos(self.shop_id, stream)
return stream:get()
end
}
local msg = packet_def.GCPlayerShopBuyShop.new()
msg.shop_id = shop:get_guid()
self:send2client(obj_me, msg)
send_player_shop_error(self, obj_me, define.PLAYER_SHOP_ERR.ERR_SHOP_SUCCESS_SELL)
结论
GCPlayerShopBuyShop(185) 是当前版本现役的九州商会买店成功通知包,结构非常简单,就是一个 PlayerShopGUID(12)。它的实际意义是告诉客户端“这家店已经买下来了”,而不是再次下发整套店铺详情。
|