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