网关客户端协议代理功能加入二级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

@@ -1,7 +1,6 @@
package model
import (
"hk4e/common/constant"
"hk4e/gdconf"
"hk4e/pkg/logger"
)
@@ -32,6 +31,10 @@ type Reliquary struct {
Guid uint64 `bson:"-" msgpack:"-"`
}
func (r *DbReliquary) GetReliquaryMapLen() int {
return len(r.ReliquaryMap)
}
func (r *DbReliquary) InitAllReliquary(player *Player) {
for _, reliquary := range r.ReliquaryMap {
r.InitReliquary(player, reliquary)
@@ -69,10 +72,6 @@ func (r *DbReliquary) GetReliquary(reliquaryId uint64) *Reliquary {
}
func (r *DbReliquary) AddReliquary(player *Player, itemId uint32, reliquaryId uint64, mainPropId uint32) {
// 校验背包圣遗物容量
if len(r.ReliquaryMap) > constant.STORE_PACK_LIMIT_RELIQUARY {
return
}
itemDataConfig := gdconf.GetItemDataById(int32(itemId))
if itemDataConfig == nil {
logger.Error("reliquary config is nil, itemId: %v", itemId)

View File

@@ -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)