```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

feat(pet): 宠物系统重构和功能增强

- 修复战斗boss中effect ID索引错误问题
- 实现宠物仓库和背包管理功能
- 添加宠物列表排序保存功能
- 重构宠物备份列表同步逻辑
- 优化宠物释放和获取逻辑
- 添加宠物背包仓库切换功能
- 修复地图模型广播信息结构问题
- 调整宠物特效数据库查询逻辑
```
This commit is contained in:
昔念
2026-04-02 07:49:49 +08:00
parent 3a13bcc99c
commit f810a2ae86
13 changed files with 280 additions and 43 deletions

View File

@@ -15,3 +15,12 @@ type GetUserBagPetInfoOutboundInfo struct {
BackupPetListLen uint32 `struc:"int32,sizeof=BackupPetList"`
BackupPetList []model.PetInfo
}
type SavePetBagOrderInboundInfo struct {
Head common.TomeeHeader `cmd:"4484" struc:"skip"`
PetListLen uint32 `struc:"int32,sizeof=PetList"`
PetList []uint32
BackupPetListLen uint32 `struc:"int32,sizeof=BackupPetList"`
BackupPetList []uint32
}

View File

@@ -27,6 +27,12 @@ type PetReleaseInboundInfo struct {
Flag uint32 `json:"flag" fieldDescription:"0为放入仓库1为放入背包" autoCodec:"true" uint:"true"`
}
type PetReleaseLegacyInboundInfo struct {
Head common.TomeeHeader `cmd:"52304" struc:"skip"`
CatchTime uint32
Flag uint32 `json:"flag" fieldDescription:"0为放入仓库1为放入背包" autoCodec:"true" uint:"true"`
}
type PetShowInboundInfo struct {
Head common.TomeeHeader `cmd:"2305" struc:"skip"`

View File

@@ -0,0 +1,24 @@
package info
import (
configm "blazing/modules/config/model"
"blazing/modules/player/model"
)
type MapModelBroadcastInfo struct {
Wer int32 `struc:"uint32"`
InfoLen uint32 `struc:"sizeof=INFO" json:"info_len"`
INFO []MapModelBroadcastEntry
}
type MapModelBroadcastEntry struct {
ModelID uint32 `json:"model_id" protobuf:"1,req,name=model_id"`
Region uint32 `json:"region" protobuf:"2,req,name=region"`
Hp int32 `struc:"uint32" json:"hp" protobuf:"3,req,name=hp"`
PosIndex uint32 `struc:"uint32" json:"pos_index" protobuf:"4,req,name=pos_index"`
IsShow int32 `struc:"uint32" json:"is_show"`
PosInfo []model.Pos `struc:"skip"`
Config configm.MapNode `struc:"skip"`
Model configm.MapModel `struc:"skip"`
}

View File

@@ -34,10 +34,10 @@ type Space struct {
CanRefresh bool
Super uint32
ID uint32
Name string
Owner ARENA
info.MapBossSInfo
ID uint32
Name string
Owner ARENA
MapBossSInfo info.MapModelBroadcastInfo
WeatherType []uint32
TimeBoss info.S2C_2022
@@ -183,8 +183,8 @@ func (ret *Space) init() {
if r.IsTimeSpace != 0 {
ret.IsTime = true
}
ret.MapBossSInfo = info.MapBossSInfo{}
ret.MapBossSInfo.INFO = make([]info.MapBossInfo, 0)
ret.MapBossSInfo = info.MapModelBroadcastInfo{}
ret.MapBossSInfo.INFO = make([]info.MapModelBroadcastEntry, 0)
if len(r.WeatherType) > 1 {
ret.WeatherType = r.WeatherType
@@ -196,8 +196,8 @@ func (ret *Space) init() {
if r == nil {
continue
}
info := info.MapBossInfo{
Id: uint32(r.ID),
info := info.MapModelBroadcastEntry{
ModelID: uint32(r.ID),
Region: v.NodeID,
Hp: r.HP,
PosInfo: ParseCoordinateString(r.Pos),
@@ -239,9 +239,9 @@ func (p *Space) IsMatch(t model.Event) bool {
return true
}
func (ret *Space) GenBoss(isfrist bool) *info.MapBossSInfo {
var res info.MapBossSInfo
res.Wer = ret.Wer
func (ret *Space) GenBoss(isfrist bool) *info.MapModelBroadcastInfo {
var res info.MapModelBroadcastInfo
res.Wer = ret.MapBossSInfo.Wer
for i := 0; i < len(ret.MapBossSInfo.INFO); i++ {
if !ret.IsMatch(*ret.MapBossSInfo.INFO[i].Config.Event) {
@@ -254,7 +254,7 @@ func (ret *Space) GenBoss(isfrist bool) *info.MapBossSInfo {
}
s := len(ret.MapBossSInfo.INFO[i].PosInfo)
if s != 0 {
ret.MapBossSInfo.INFO[i].Pos = ret.MapBossSInfo.INFO[i].PosInfo[(grand.Intn(s-1)+1+int(ret.MapBossSInfo.INFO[i].PosIndex))%s]
ret.MapBossSInfo.INFO[i].PosIndex = uint32(grand.Intn(s))
}
ret.MapBossSInfo.INFO[i].IsShow = 1