feat(cache): 添加复合键缓存操作支持 添加了基于 uint32+string 组合键的缓存操作方法,包括 GetByCompoundKey、SetByCompoundKey、DelByCompoundKey 和 ContainsByCompoundKey 方法,用于处理用户ID和会话ID的组合缓存场景 fix(vscode): 添加 cSpell 配置支持 struc 词汇 refactor(session): 移除过时的会话管理方法 移除了基于单一字符串键的会话管理方法,因为已迁移到使用 复合键的缓存操作方式 ```
71 lines
3.0 KiB
Go
71 lines
3.0 KiB
Go
package pet
|
||
|
||
import (
|
||
"blazing/common/data"
|
||
"blazing/logic/service/common"
|
||
"blazing/modules/player/model"
|
||
)
|
||
|
||
type GetPetListInboundEmpty struct {
|
||
Head common.TomeeHeader `cmd:"2303" struc:"skip"`
|
||
}
|
||
type GetPetListFreeInboundEmpty struct {
|
||
Head common.TomeeHeader `cmd:"2320" struc:"skip"`
|
||
}
|
||
type GetPetListOutboundInfo struct {
|
||
ShortInfoListLen uint32 `struc:"int32,sizeof=ShortInfoList"`
|
||
ShortInfoList []PetShortInfo
|
||
}
|
||
|
||
// PetShortInfo 精灵简要信息结构体
|
||
type PetShortInfo struct {
|
||
ID uint32 // 精灵类型ID(
|
||
CatchTime uint32 // 精灵生成时间
|
||
Level uint32 // 精灵等级
|
||
SkinID uint32 // 精灵皮肤ID
|
||
// 是否闪光(@UInt long → uint32,0=否,1=是)
|
||
ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"`
|
||
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
|
||
}
|
||
|
||
// C2S_PetFusion 前端(Client)到后端(Server)的精灵融合请求包
|
||
type C2S_PetFusion struct {
|
||
Head common.TomeeHeader `cmd:"2351" struc:"skip"`
|
||
Mcatchtime uint32 `json:"mcatchtime" msgpack:"mcatchtime"` // 主精灵的时间戳
|
||
Auxcatchtime uint32 `json:"auxcatchtime" msgpack:"auxcatchtime"` // 副精灵的时间戳
|
||
Item1 [4]uint32 `json:"item1" msgpack:"item1"` // 物品序号1
|
||
|
||
GoldItem1 [2]uint32 `json:"gold_item1" msgpack:"gold_item1"` // 0代表未放置 金豆物品1(C#:gold_item1)
|
||
|
||
}
|
||
|
||
// PetFusionInfo 精灵融合结果详情(后端回包嵌套结构体)
|
||
type PetFusionInfo struct {
|
||
ObtainTime uint32 `json:"obtainTime" msgpack:"obtainTime"` // 如果获得时间为0 则代表融合失败
|
||
SoulID uint32 `json:"soulID" msgpack:"soulID"` // 元神珠的id 融合失败为0
|
||
StarterCpTm uint32 `json:"starterCpTm" msgpack:"starterCpTm"` // 融合失败为0
|
||
CostItemFlag uint32 `json:"costItemFlag" msgpack:"costItemFlag"` // 是不是消耗掉了金豆道具 1代表消耗道具
|
||
}
|
||
type RoomPetInfo struct {
|
||
OwnerId uint32
|
||
CatchTime uint32
|
||
ID uint32 `fieldDesc:"精灵编号" `
|
||
Nature uint32 `fieldDesc:"性格" `
|
||
|
||
// 等级(@UInt long → uint32)
|
||
Level uint32 `fieldDesc:"等级" `
|
||
// 当前生命(@UInt long → uint32)
|
||
Hp uint32
|
||
// * battle_lv: atk(0), def(1), sp_atk(2), sp_def(3), spd(4), accuracy(5)
|
||
Prop [5]uint32 `fieldDesc:"属性" `
|
||
SkillListLen uint32 `struc:"sizeof=SkillList"`
|
||
|
||
// 技能信息:固定4条,空则赋值0(固定长度List → [4]SkillInfo,零值即符合“赋值0”)
|
||
SkillList []model.SkillInfo
|
||
// * ev:生命学习力,攻击学习力,防御学习力,特攻学习力,特防学习力,速度学习力
|
||
Ev [6]uint32 `fieldDesc:"属性" `
|
||
EffectInfoLen uint16 `struc:"sizeof=EffectInfo"`
|
||
// 特性列表:长度用UShort存储(变长List → []PetEffectInfo + 长度前缀规则) 第一个一定是特性
|
||
EffectInfo []model.PetEffectInfo `fieldDesc:"特性列表, 长度在头部以UShort存储" serialize:"lengthFirst,lengthType=uint16,type=structArray"`
|
||
}
|