```
feat(fight): 实现玩家间战斗邀请与处理功能 新增战斗邀请与处理逻辑,包括邀请发送、邀请接受/拒绝流程。 添加战斗模式支持(1v1 和 6v6)及相关数据结构定义。 优化玩家战斗准备逻辑,完善战斗初始化流程。 修复玩家离线保存数据时的空指针问题。 调整战斗相关枚举类型,统一管理战斗模式。 完善邀请战斗消息结构体及通信协议。 ```
This commit is contained in:
123
logic/service/user/user.go
Normal file
123
logic/service/user/user.go
Normal file
@@ -0,0 +1,123 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"blazing/logic/service/player"
|
||||
"blazing/modules/blazing/model"
|
||||
)
|
||||
|
||||
// SimUserInfoInboundInfo 对应 Java 的 SimUserInfoInboundInfo 类
|
||||
type SimUserInfoInboundInfo struct {
|
||||
Head player.TomeeHeader `cmd:"2051" struc:"[0]pad"`
|
||||
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
|
||||
}
|
||||
type SimUserInfoOutboundInfo struct {
|
||||
// UserID 米米号
|
||||
// 对应 Java 注解: @FieldDescription("米米号") @UInt
|
||||
UserID uint32 `codec:"true"`
|
||||
|
||||
Nick string `struc:"[16]byte" default:"seer" json:"nick"` // 16字节昵称
|
||||
|
||||
// Color rgb颜色
|
||||
// 对应 Java 注解: @FieldDescription("rgb颜色") @UInt
|
||||
Color uint32 `codec:"true"`
|
||||
|
||||
// Texture 纹理 0
|
||||
// 对应 Java 注解: @FieldDescription("纹理 0") @UInt
|
||||
Texture uint32 `codec:"true"`
|
||||
|
||||
// Vip 默认值 1 位置
|
||||
// 对应 Java 注解: @FieldDescription("默认值 1 位置") @UInt
|
||||
Vip uint32 `codec:"true"`
|
||||
|
||||
// Status 默认值0 未知
|
||||
// 对应 Java 注解: @FieldDescription("默认值0 未知") @UInt
|
||||
Status uint32 `codec:"true"`
|
||||
|
||||
// MapType 地图类型 进入地图包传入的字段
|
||||
// 对应 Java 注解: @FieldDescription("地图类型 进入地图包传入的字段") @UInt
|
||||
MapType uint32 `codec:"true"`
|
||||
|
||||
// MapID 地图id
|
||||
// 对应 Java 注解: @FieldDescription("地图id") @UInt
|
||||
MapID uint32 `codec:"true"`
|
||||
|
||||
// IsCanBeTeacher 能不能做教官
|
||||
// 对应 Java 注解: @FieldDescription("能不能做教官") @UInt
|
||||
IsCanBeTeacher uint32 `codec:"true"`
|
||||
|
||||
// TeacherID 教官id
|
||||
// 对应 Java 注解: @FieldDescription("教官id") @UInt
|
||||
TeacherID uint32 `codec:"true"`
|
||||
|
||||
// StudentID 学生id
|
||||
// 对应 Java 注解: @FieldDescription("学生id") @UInt
|
||||
StudentID uint32 `codec:"true"`
|
||||
|
||||
// GraduationCount 教官成绩
|
||||
// 对应 Java 注解: @FieldDescription("教官成绩") @UInt
|
||||
GraduationCount uint32 `codec:"true"`
|
||||
|
||||
// VipLevel vip等级 8
|
||||
// 对应 Java 注解: @FieldDescription("vip等级 8") @UInt
|
||||
VipLevel uint32 `codec:"true"`
|
||||
|
||||
// TeamId 战队id
|
||||
// 对应 Java 注解: @FieldDescription("战队id") @UInt
|
||||
TeamId uint32 `codec:"true"`
|
||||
|
||||
// IsShow 有没有跟随的精灵
|
||||
// 对应 Java 注解: @FieldDescription("有没有跟随的精灵") @UInt
|
||||
IsShow uint32 `codec:"true"`
|
||||
ClothesCount uint32 `struc:"sizeof=Clothes" json:"clothes_count"` // 穿戴装备数量
|
||||
// Clothes 穿戴装备
|
||||
// 对应 Java 注解: @FieldDescription("穿戴装备") @Builder.Default
|
||||
Clothes []model.PeopleItemInfo `codec:"true"`
|
||||
}
|
||||
type MoreUserInfoInboundInfo struct {
|
||||
Head player.TomeeHeader `cmd:"2052" struc:"[0]pad"`
|
||||
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
|
||||
}
|
||||
type MoreUserInfoOutboundInfo struct {
|
||||
// UserID 米米号
|
||||
// 对应 Java 注解: @FieldDescription("米米号") @UInt
|
||||
UserID uint32 `codec:"true"`
|
||||
|
||||
Nick string `struc:"[16]byte" default:"seer" json:"nick"` // 16字节昵称
|
||||
RegisterTime uint32 `struc:"uint32" json:"register_time"` // 注册时间(秒时间戳)
|
||||
|
||||
// PetAllNum 所有精灵数量
|
||||
// 对应 Java 注解: @FieldDescription("所有精灵数量") @UInt
|
||||
PetAllNum uint32 `codec:"true"`
|
||||
|
||||
// PetMaxLev 精灵最大等级
|
||||
// 对应 Java 注解: @FieldDescription("精灵最大等级") @UInt
|
||||
PetMaxLev uint32 `codec:"true"`
|
||||
|
||||
// BossAchievement spt boos成就 20字节 以任务状态完成 3为击败该boss, 目前spt只有12个, 剩下的长度以3填充
|
||||
// 对应 Java 注解: @FieldDescription(...) @ArraySerialize(value = ArraySerializeType.FIXED_LENGTH, fixedLength = 20) @Builder.Default
|
||||
BossAchievement []byte `codec:"true"`
|
||||
|
||||
// GraduationCount 教官成绩
|
||||
// 对应 Java 注解: @FieldDescription("教官成绩") @UInt
|
||||
GraduationCount uint32 `codec:"true"`
|
||||
|
||||
// MonKingWin 精灵王胜场
|
||||
// 对应 Java 注解: @FieldDescription("精灵王胜场") @UInt
|
||||
MonKingWin uint32 `codec:"true"`
|
||||
|
||||
// MessWin 大乱斗胜场
|
||||
// 对应 Java 注解: @FieldDescription("大乱斗胜场") @UInt
|
||||
MessWin uint32 `codec:"true"`
|
||||
|
||||
// MaxStage 勇者之塔层数
|
||||
// 对应 Java 注解: @FieldDescription("勇者之塔层数") @UInt
|
||||
MaxStage uint32 `codec:"true"`
|
||||
|
||||
// MaxArenaWins 星际擂台胜场
|
||||
// 对应 Java 注解: @FieldDescription("星际擂台胜场") @UInt
|
||||
MaxArenaWins uint32 `codec:"true"`
|
||||
|
||||
// CurrentTitleID 当前称号ID
|
||||
// 对应 Java 注解: @FieldDescription("当前称号ID") @UInt
|
||||
CurrentTitleID uint32 `codec:"true"`
|
||||
}
|
||||
Reference in New Issue
Block a user