style: 清理代码注释和格式
This commit is contained in:
@@ -127,7 +127,7 @@ type RegReq struct {
|
||||
Authorization string `json:"Authorization" in:"header"`
|
||||
// 玩家昵称,@ArraySerialize注解
|
||||
Nickname string `json:"nickname" ` // 固定长度16字节
|
||||
// 机器人人物颜色 rgb,@UInt注解
|
||||
// 机器人人物颜色 rgb
|
||||
Color uint32 `json:"color" ` // 4字节
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ func (t *TeamInfo) InitDefaults() {
|
||||
|
||||
// TeamPKInfo 战队PK相关信息结构
|
||||
type TeamPKInfo struct {
|
||||
GroupID uint32 `struc:"uint32" default:"1"` // 分组ID,默认值1(@UInt long)
|
||||
HomeTeamID uint32 `struc:"uint32" default:"1"` // 主队ID,默认值1(@UInt long)
|
||||
GroupID uint32 `struc:"uint32" default:"1"` // 分组ID,默认值1
|
||||
HomeTeamID uint32 `struc:"uint32" default:"1"` // 主队ID,默认值1
|
||||
}
|
||||
|
||||
// InitDefaults 初始化默认值(确保字段默认值正确赋值)
|
||||
|
||||
@@ -96,8 +96,6 @@ func (r Attr) sub() uint32 {
|
||||
|
||||
// PetInfo 精灵信息结构(合并后的优化版本)
|
||||
type PetInfo struct {
|
||||
|
||||
// 精灵编号(@UInt long → uint32)
|
||||
ID uint32 `fieldDesc:"精灵编号" `
|
||||
|
||||
// 名字:默认为全0,补齐到16字节(固定长度 → [16]byte)
|
||||
@@ -107,28 +105,20 @@ type PetInfo struct {
|
||||
|
||||
Generation uint16 `fieldDesc:"世代" `
|
||||
|
||||
// 个体值(@UInt long → uint32)
|
||||
Dv uint32 `struc:"uint32" `
|
||||
|
||||
// 性格(@UInt long → uint32)
|
||||
Nature uint32 `fieldDesc:"性格" `
|
||||
|
||||
// 等级(@UInt long → uint32)
|
||||
Level uint32 `fieldDesc:"等级" `
|
||||
|
||||
// 当前等级已获得经验(@UInt long → uint32)
|
||||
Exp int64 `struc:"uint32"`
|
||||
|
||||
// 当前等级所需经验(@UInt long → uint32)
|
||||
LvExp int64 `struc:"uint32"`
|
||||
|
||||
// 升到下一级的经验(@UInt long → uint32)
|
||||
NextLvExp int64 `struc:"uint32"`
|
||||
|
||||
// 当前生命(@UInt long → uint32)
|
||||
Hp uint32
|
||||
|
||||
// 最大生命(@UInt long → uint32)
|
||||
MaxHp uint32 `fieldDesc:"最大生命" `
|
||||
// * battle_lv: atk(0), def(1), sp_atk(2), sp_def(3), spd(4), accuracy(5)
|
||||
Prop [5]uint32 `fieldDesc:"属性" `
|
||||
@@ -141,26 +131,20 @@ type PetInfo struct {
|
||||
// 技能信息:固定4条,空则赋值0(固定长度List → [4]SkillInfo,零值即符合“赋值0”)
|
||||
SkillList []SkillInfo
|
||||
|
||||
// 捕捉时间(@UInt long → 若为时间戳用uint32;若需时间类型可改为time.Time,需配合序列化处理)
|
||||
CatchTime uint32 //显式忽略,不参与序列化
|
||||
OldCatchTime uint32 `struc:"skip" fieldDesc:"旧捕捉时间" `
|
||||
|
||||
// 捕捉地图(@UInt long → uint32)
|
||||
CatchMap uint32 `json:"CatchMap,omitempty"`
|
||||
|
||||
// 未知默认0(@UInt long → uint32)
|
||||
CatchRect uint32 `json:"CatchRect,omitempty"`
|
||||
|
||||
// 捕获等级默认0(@UInt long → uint32)
|
||||
CatchLevel uint32 `fieldDesc:"捕获等级 默认为0" `
|
||||
EffectInfoLen uint16 `struc:"sizeof=EffectInfo" json:"-"`
|
||||
// 特性列表:长度用UShort存储(变长List → []PetEffectInfo + 长度前缀规则) 第一个一定是特性
|
||||
EffectInfo []PetEffectInfo
|
||||
|
||||
// 皮肤ID默认0(@UInt long → uint32)
|
||||
SkinID uint32 `fieldDesc:"皮肤id默认为0" `
|
||||
|
||||
// 是否闪光(@UInt long → uint32,0=否,1=是)
|
||||
ShinyLen uint32 `struc:"sizeof=ShinyInfo"`
|
||||
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ type PVPRankInfo struct {
|
||||
type NoteReadyToFightInfo struct {
|
||||
//MAXPET uint32 `struc:"skip"` // 最大精灵数 struc:"skip"`
|
||||
// 战斗类型ID(与野怪战斗为3,与人战斗为1,前端似乎未使用)
|
||||
// @UInt long
|
||||
Status uint32 `fieldDesc:"战斗类型ID 但前端好像没有用到 与野怪战斗为3,与人战斗似乎是1" `
|
||||
//Mode uint32 `struc:"skip"`
|
||||
// 我方信息
|
||||
@@ -80,7 +79,7 @@ type NoteReadyToFightInfo struct {
|
||||
OpponentPetList []ReadyFightPetInfo `fieldDesc:"敌方的精灵信息 如果是野怪 那么再给客户端发送这个包体时就提前生成好了这只精灵的PetInfo,然后把从PetInfo中把部分信息写入到这个敌方的精灵信息中再发送这个包结构体" serialize:"lengthFirst,lengthType=uint16,type=structArray"`
|
||||
}
|
||||
type FightUserInfo struct {
|
||||
// 用户ID(野怪为0),@UInt long
|
||||
// 用户ID(野怪为0)
|
||||
UserID uint32 `fieldDesc:"userID 如果为野怪则为0" `
|
||||
|
||||
// 玩家名称(野怪为UTF-8的'-',固定16字节)
|
||||
@@ -90,37 +89,36 @@ type FightUserInfo struct {
|
||||
|
||||
// ReadyFightPetInfo 准备战斗的精灵信息结构体,ReadyFightPetInfo类
|
||||
type ReadyFightPetInfo struct {
|
||||
// 精灵ID,@UInt long
|
||||
// 精灵ID
|
||||
ID uint32 `fieldDesc:"精灵ID" `
|
||||
|
||||
// 精灵等级,@UInt long
|
||||
// 精灵等级
|
||||
Level uint32 `fieldDesc:"精灵等级" `
|
||||
|
||||
// 精灵当前HP,@UInt long
|
||||
// 精灵当前HP
|
||||
Hp uint32 `fieldDesc:"精灵HP" `
|
||||
|
||||
// 精灵最大HP,@UInt long
|
||||
// 精灵最大HP
|
||||
MaxHp uint32 `fieldDesc:"最大HP" `
|
||||
SkillListLen uint32 `struc:"sizeof=SkillList"`
|
||||
// 技能信息列表(固定4个元素,技能ID和剩余PP,无技能则为0)
|
||||
// List<SkillInfo>,初始化容量为4
|
||||
SkillList []SkillInfo `fieldDesc:"技能信息 技能ID跟剩余PP 固定32字节 没有给0" serialize:"fixedLength=4,type=structArray"`
|
||||
|
||||
// 精灵捕获时间,@UInt long
|
||||
// 精灵捕获时间
|
||||
CatchTime uint32 `fieldDesc:"精灵捕获时间" `
|
||||
|
||||
// 捕捉地图(固定给0),@UInt long
|
||||
// 捕捉地图(固定给0)
|
||||
CatchMap uint32 `fieldDesc:"捕捉地图 给0" `
|
||||
|
||||
// 固定给0,@UInt long
|
||||
// 固定给0
|
||||
CatchRect uint32 `fieldDesc:"给0" `
|
||||
|
||||
// 固定给0,@UInt long
|
||||
CatchLevel uint32 `fieldDesc:"给0" `
|
||||
SkinID uint32 `fieldDesc:"精灵皮肤ID" `
|
||||
// 是否闪光(@UInt long → uint32,0=否,1=是)
|
||||
ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"`
|
||||
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
|
||||
// 固定给0
|
||||
CatchLevel uint32 `fieldDesc:"给0" `
|
||||
SkinID uint32 `fieldDesc:"精灵皮肤ID" `
|
||||
ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"`
|
||||
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
|
||||
}
|
||||
type FightOverInfo struct {
|
||||
//0 正常结束
|
||||
|
||||
Reference in New Issue
Block a user