mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-15 00:22:30 +08:00
网关客户端协议代理功能加入二级pb数据解析
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"hk4e/common/constant"
|
||||
"hk4e/gdconf"
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
@@ -32,6 +31,10 @@ type Weapon struct {
|
||||
Guid uint64 `bson:"-" msgpack:"-"`
|
||||
}
|
||||
|
||||
func (w *DbWeapon) GetWeaponMapLen() int {
|
||||
return len(w.WeaponMap)
|
||||
}
|
||||
|
||||
func (w *DbWeapon) InitAllWeapon(player *Player) {
|
||||
for _, weapon := range w.WeaponMap {
|
||||
w.InitWeapon(player, weapon)
|
||||
@@ -63,10 +66,6 @@ func (w *DbWeapon) GetWeapon(weaponId uint64) *Weapon {
|
||||
}
|
||||
|
||||
func (w *DbWeapon) AddWeapon(player *Player, itemId uint32, weaponId uint64) {
|
||||
// 校验背包武器容量
|
||||
if len(w.WeaponMap) > constant.STORE_PACK_LIMIT_WEAPON {
|
||||
return
|
||||
}
|
||||
itemDataConfig := gdconf.GetItemDataById(int32(itemId))
|
||||
if itemDataConfig == nil {
|
||||
logger.Error("weapon config is nil, itemId: %v", itemId)
|
||||
|
||||
Reference in New Issue
Block a user