Files
bl/logic/service/pet/pet.go
昔念 08ebf849eb ```
feat(pet): 添加宠物收集功能和称号系统

- 实现了宠物收集任务状态查询功能
- 新增Collect方法处理宠物收集逻辑,包括类型验证和ID合法性检查
- 创建validTypeIDMap映射表统一管理合法的类型ID集合
- 重构任务状态判断逻辑,基于model.Completion状态进行判断

refactor(map): 统一玩家信息结构体

- 将OutInfo重命名为SimpleInfo并添加Title字段
- 更新EnterMap方法的返回类型为SimpleInfo
- 修改space包中的UserInfo映射类型为SimpleInfo

feat(task): 集成称号奖励到任务系统

- 在PlayerInfo结构体中添加Title字段
- 扩展TaskConfig模型支持称号奖励配置
- 更新用户信息服务处理用户名大小写转换

refactor(space): 优化空间服务数据结构

- 更新GetInfo方法返回SimpleInfo切片
- 调整UserInfo CsMap泛型类型参数
- 修改ListMapPlayerOutboundInfo中Player数组类型

style(login): 规范化用户名输入处理

- 登录时将用户名转换为小写进行比较
- 使用strings.EqualFold进行大小
2026-01-17 00:47:41 +08:00

104 lines
4.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package pet
import (
"blazing/common/data"
"blazing/logic/service/common"
"blazing/modules/blazing/model"
)
type InInfo struct {
Head common.TomeeHeader `cmd:"2301" struc:"skip"`
CatchTime uint32
}
type OutInfo struct {
model.PetInfo
}
// PetReleaseOutboundInfo 宠物释放出站消息
type PetReleaseOutboundInfo struct {
HomeEnergy uint32 `json:"home_energy" fieldDescription:"暂定0" autoCodec:"true" uint:"true"`
FirstPetTime uint32 `json:"first_pet_time" fieldDescription:"精灵生成时间" autoCodec:"true" uint:"true"`
Flag uint32
PetInfo model.PetInfo `json:"pet_info" fieldDescription:"精灵信息" autoCodec:"true"`
}
// 放入背包或者加入仓库
type PetReleaseInboundInfo struct {
Head common.TomeeHeader `cmd:"2304" struc:"skip"`
CatchTime uint32 `json:"catch_time" fieldDescription:"精灵生成时间" autoCodec:"true" uint:"true"`
Flag uint32 `json:"flag" fieldDescription:"0为放入仓库1为放入背包" autoCodec:"true" uint:"true"`
}
type PetShowInboundInfo struct {
Head common.TomeeHeader `cmd:"2305" struc:"skip"`
CatchTime uint32 `codec:"catchTime" inboundMessageType:"Pet_Show"`
Flag uint32 `codec:"flag"`
}
type PetShowOutboundInfo struct {
UserID uint32 `codec:"UserID" description:"米米号"`
CatchTime uint32 `codec:"CatchTime" description:"精灵获得的时间"`
ID uint32 `codec:"PetID" description:"精灵编号"`
Flag uint32 `codec:"flag" description:"1为显示 0为收回"`
Dv uint32 `codec:"dv" description:"个体"`
// 是否闪光(@UInt long → uint320=否1=是)
ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"`
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
SkinID uint32 `codec:"skinID" description:"皮肤ID"`
Reserved1 [3]uint32
}
type PetOneCureInboundInfo struct {
Head common.TomeeHeader `cmd:"2310" struc:"skip"`
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
} // PetOneCureOutboundInfo 宠物单个治疗出站消息
type PetOneCureOutboundInfo struct {
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
type PET_ROWEI struct {
Head common.TomeeHeader `cmd:"2321" struc:"skip"`
ID uint32
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
type PET_RETRIEVE struct {
Head common.TomeeHeader `cmd:"2322" struc:"skip"`
//ID uint32
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
// PetDefaultInboundInfo
// 实现了InboundMessage接口
type PetDefaultInboundInfo struct {
Head common.TomeeHeader `cmd:"2308" struc:"skip"`
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true" autoCodec:"true" inboundMessageType:"Pet_Default"`
}
// PetDefaultOutboundInfo
// 实现了OutboundMessage接口
type PetDefaultOutboundInfo struct {
IsDefault uint32 `json:"isDefault" fieldDescription:"0: 首发设置失败1: 首发设置成功" uint:"true" autoCodec:"true" outboundMessageType:"Pet_Default"`
}
type C2S_NONO_EXE_LIST struct {
Head common.TomeeHeader `cmd:"9015" struc:"skip"`
}
// S2C_NONO_EXE_LIST 对应C#的同名结构体
type S2C_NONO_EXE_LIST struct {
// Exelist 对应C#的List<ExeingPetInfo>Go中用切片([])替代列表
ExelistLen uint32 `json:"exelistLen" struc:"sizeof=Exelist"`
Exelist []ExeingPetInfo `json:"exelist"` // 若需JSON序列化保留原字段名
}
// ExeingPetInfo 对应C#的同名结构体,存储精灵训练相关信息
type ExeingPetInfo struct {
Flag uint32 `json:"_flag"` // 应该是精灵是否在训练对应原_flag
CapTm uint32 `json:"_capTm"` // 精灵的捕捉时间对应原_capTm
PetId uint32 `json:"_petId"` // 训练精灵的id对应原_petId
RemainDay uint32 `json:"_remainDay"` // 停留天数前端用这个值除以3600疑似时间戳对应原_remainDay
Course uint32 `json:"_course"` // 课程对应原_course
}