网关客户端协议代理功能加入二级pb数据解析

This commit is contained in:
flswld
2023-03-14 18:30:07 +08:00
parent 2c35fc0df4
commit cd922d1a38
11 changed files with 331 additions and 77 deletions

View File

@@ -33,6 +33,10 @@ func (g *GameManager) AddUserWeapon(userId uint32, itemId uint32) uint64 {
}
weaponId := uint64(g.snowflake.GenId())
dbWeapon := player.GetDbWeapon()
// 校验背包武器容量
if dbWeapon.GetWeaponMapLen() > constant.STORE_PACK_LIMIT_WEAPON {
return 0
}
dbWeapon.AddWeapon(player, itemId, weaponId)
weapon := dbWeapon.GetWeapon(weaponId)
if weapon == nil {