GCPlayerShopMoney 是玩家商店资金操作的结果包,用来回同步店铺 GUID、资金类型、金额和值变化后的串号。
包信息
| 项目 |
内容 |
| 封包 ID |
327 |
| 包名 |
GCPlayerShopMoney |
| 方向 |
Server -> Client |
| 对应请求 |
CGPlayerShopMoney |
| 固定包长 |
18 |
| 作用 |
返回玩家商店本钱 / 利润存取结果 |
包体结构
| 偏移 |
长度 |
字段 |
类型 |
含义 |
0x00 |
0x0C |
shop_id |
PlayerShopGUID |
目标玩家商店 GUID |
0x0C |
0x01 |
type |
uint8 |
资金类型;当前 0=base_money、1=profit_money |
0x0D |
0x04 |
amount |
uint32 |
本次回显金额或余额 |
0x11 |
0x01 |
serial |
uint8 |
店铺最新串号 |
总长度:
18 字节
当前实际行为
- 当前
char_player_shop_money() 在资金存入或提取成功后,会直接构造这条包返回。
amount 的含义在不同分支下并不完全一致:有时是最新余额,有时是本次提取金额。
- 因此读取这条包时,必须结合原始请求类型一起理解
amount。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 场景处理:
/home/ubuntu/Game2/services/scene/scenecore.lua
- 对应请求文档:
/home/ubuntu/Game2/docs/07_登录_网络_封包/packet.CGPlayerShopMoney.md
关键代码
packet.GCPlayerShopMoney = {
bos = function(self)
local stream = bostream.new()
packet.PlayerShopGUID.bos(self.shop_id, stream)
stream:writeuchar(self.type)
stream:writeuint(self.amount)
stream:writeuchar(self.serial)
return stream:get()
end
}
结论
GCPlayerShopMoney(327) 是玩家商店资金操作的成功结果包。
- 结构可以明确写成
shop_id + type + amount + serial。
- 其中
amount 在现役主链里既可能表示余额,也可能表示提取金额。
|