```
refactor(rpc): 更新结构体标签以跳过特定字段序列化 将多个结构体中的 `struc:"[0]pad"` 标签更改为 `struc:"skip"`, 以避免在序列化过程中处理不必要的填充字段。同时新增放生与领回相关逻辑, 并完善部分控制器函数和消息结构定义。 ```
This commit is contained in:
@@ -58,7 +58,7 @@ func GetServerInfoList() []ServerInfo {
|
||||
|
||||
// CommendSvrInfo 初始连接请求信息结构体
|
||||
type CommendSvrInfo struct {
|
||||
//Handler common.TomeeHeader //` struc:"[0]pad"` //消息头 ,这里为传入的头部数据,遍历此头部实现解析CommendSvrInfo
|
||||
//Handler common.TomeeHeader //` struc:"skip"` //消息头 ,这里为传入的头部数据,遍历此头部实现解析CommendSvrInfo
|
||||
MaxOnlineID uint32 `struc:"sizeof=ServerList"` // 最大连接数
|
||||
IsVip uint32 // 建议为0
|
||||
ServerInfoLen uint32 `struc:"sizeof=ServerList"` // 服务器信息长度 ServerInfo
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"blazing/common/data/xmlres"
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/common/utils"
|
||||
"blazing/logic/service/fight"
|
||||
"blazing/logic/service/pet"
|
||||
"blazing/logic/service/player"
|
||||
|
||||
@@ -52,6 +53,62 @@ func (h *Controller) GetPetList(
|
||||
|
||||
}
|
||||
|
||||
// 获取放生列表
|
||||
func (h *Controller) PET_ROWEI_LIST(
|
||||
data *pet.GetPetListFreeInboundEmpty,
|
||||
c *player.Player) (result *pet.GetPetListOutboundInfo,
|
||||
err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
result = &pet.GetPetListOutboundInfo{}
|
||||
|
||||
tt := c.Service.Pet.PetInfo(1) //获得未放生的精灵
|
||||
result.ShortInfoList = make([]pet.PetShortInfo, len(tt))
|
||||
for i, v := range tt {
|
||||
|
||||
copier.Copy(&result.ShortInfoList[i], &v.Data)
|
||||
|
||||
}
|
||||
return result, 0
|
||||
|
||||
}
|
||||
|
||||
// 放生包
|
||||
func (h *Controller) PET_ROWEI(
|
||||
data *pet.PET_ROWEI, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
|
||||
c.Service.Pet.PetInfo_One_exec(data.CatchTime, func(t *model.PetEX) {
|
||||
|
||||
_, _, ok := c.FindPet(data.CatchTime)
|
||||
|
||||
//如果背包没找到,再放入背包
|
||||
if !ok && t.CatchTime != 0 {
|
||||
t.Free = 1
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return nil, 0
|
||||
|
||||
}
|
||||
|
||||
// 领回包
|
||||
func (h *Controller) PET_RETRIEVE(
|
||||
data *pet.PET_RETRIEVE, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
|
||||
c.Service.Pet.PetInfo_One_exec(data.CatchTime, func(t *model.PetEX) {
|
||||
|
||||
_, _, ok := c.FindPet(data.CatchTime)
|
||||
|
||||
//如果背包没找到,再放入背包
|
||||
if !ok && t.CatchTime != 0 {
|
||||
t.Free = 0
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return nil, 0
|
||||
|
||||
}
|
||||
|
||||
// 精灵背包仓库切换
|
||||
func (h *Controller) PetRelease(
|
||||
data *pet.PetReleaseInboundInfo,
|
||||
@@ -117,6 +174,8 @@ func (h *Controller) PlayerShowPet(
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
// 单体治疗
|
||||
func (h *Controller) PetOneCure(
|
||||
data *pet.PetOneCureInboundInfo, c *player.Player) (result *pet.PetOneCureOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
if c.GetSpace().Owner.UserID == c.Info.UserID {
|
||||
|
||||
@@ -14,11 +14,11 @@ type TomeeHeader struct {
|
||||
Version byte `json:"version" struc:"[1]byte"`
|
||||
CMD uint32 `json:"cmdId" struc:"uint32"`
|
||||
UserID uint32 `json:"userId"`
|
||||
//Error uint32 `json:"error" struc:"[0]pad"`
|
||||
//Error uint32 `json:"error" struc:"skip"`
|
||||
|
||||
Result uint32 `json:"result"`
|
||||
Data []byte `json:"data" struc:"skip"` //组包忽略此字段// struc:"[0]pad"
|
||||
//Return []byte `struc:"[0]pad"` //返回记录
|
||||
Data []byte `json:"data" struc:"skip"` //组包忽略此字段// struc:"skip"
|
||||
//Return []byte `struc:"skip"` //返回记录
|
||||
}
|
||||
|
||||
func NewTomeeHeader(cmd uint32, userid uint32) *TomeeHeader {
|
||||
|
||||
@@ -7,13 +7,13 @@ import (
|
||||
|
||||
// 野怪对战包
|
||||
type FightNpcMonsterInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2408" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2408" struc:"skip"`
|
||||
// Number 地图刷新怪物结构体对应的序号(1-9的位置序号)
|
||||
|
||||
Number uint32 `fieldDesc:"地图刷新怪物结构体对应的序号 1 - 9 的位置序号" `
|
||||
}
|
||||
type ChallengeBossInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2411" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2411" struc:"skip"`
|
||||
BossId uint32 `json:"bossId"`
|
||||
}
|
||||
type NullOutboundInfo struct {
|
||||
@@ -21,40 +21,40 @@ type NullOutboundInfo struct {
|
||||
|
||||
// 准备战斗包
|
||||
type ReadyToFightInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2404" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2404" struc:"skip"`
|
||||
}
|
||||
|
||||
// 战斗逃跑
|
||||
type EscapeFightInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2410" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2410" struc:"skip"`
|
||||
}
|
||||
|
||||
// 精灵王
|
||||
type StartPetWarInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2431" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2431" struc:"skip"`
|
||||
}
|
||||
|
||||
type ARENA_SET_OWENR struct {
|
||||
Head common.TomeeHeader `cmd:"2417" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2417" struc:"skip"`
|
||||
}
|
||||
type ARENA_FIGHT_OWENR struct {
|
||||
Head common.TomeeHeader `cmd:"2418" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2418" struc:"skip"`
|
||||
}
|
||||
|
||||
type ARENA_GET_INFO struct {
|
||||
Head common.TomeeHeader `cmd:"2419" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2419" struc:"skip"`
|
||||
}
|
||||
|
||||
type ARENA_UPFIGHT struct {
|
||||
Head common.TomeeHeader `cmd:"2420" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2420" struc:"skip"`
|
||||
}
|
||||
type ARENA_OWENR_ACCE struct {
|
||||
Head common.TomeeHeader `cmd:"2422" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2422" struc:"skip"`
|
||||
}
|
||||
|
||||
// 表示"宠物王加入"的入站消息数据
|
||||
type PetKingJoinInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2413" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2413" struc:"skip"`
|
||||
Type uint32 // 战斗类型:5=单精灵,6=多精灵,11=精灵大师赛 (对应Java的@UInt long type)
|
||||
FightType uint32 // 仅当Type为11时有效 (对应Java的@UInt long fightType)
|
||||
}
|
||||
@@ -62,14 +62,14 @@ type PetKingJoinInboundInfo struct {
|
||||
// HandleFightInviteInboundInfo 处理战斗邀请的入站消息
|
||||
|
||||
type HandleFightInviteInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2403" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2403" struc:"skip"`
|
||||
UserID uint32 `json:"userId" codec:"userId,uint"` // 邀请我对战人的userid
|
||||
Flag uint32 `json:"flag" codec:"flag,uint"` // 1为同意对战 0为取消对战
|
||||
Mode uint32 `json:"mode" codec:"mode,uint"` // 战斗类型 1 = 1v1 2 = 6v6
|
||||
}
|
||||
|
||||
type InviteToFightInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2401" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2401" struc:"skip"`
|
||||
|
||||
UserID uint32
|
||||
|
||||
@@ -77,7 +77,7 @@ type InviteToFightInboundInfo struct {
|
||||
Mode uint32
|
||||
}
|
||||
type InviteFightCancelInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2402" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2402" struc:"skip"`
|
||||
}
|
||||
|
||||
// 2502的回复包 PVP邀请消息
|
||||
@@ -88,30 +88,30 @@ type NoteHandleFightInviteOutboundInfo struct {
|
||||
}
|
||||
|
||||
type UseSkillInInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2405" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2405" struc:"skip"`
|
||||
// 技能id,
|
||||
SkillId uint32
|
||||
}
|
||||
type ChangePetInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2407" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2407" struc:"skip"`
|
||||
// CatchTime 捕捉时间
|
||||
CatchTime uint32 `json:"catchTime"`
|
||||
}
|
||||
type CatchMonsterInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2409" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2409" struc:"skip"`
|
||||
// CapsuleId 胶囊id
|
||||
|
||||
CapsuleId uint32 `json:"capsuleId" fieldDescription:"胶囊id" uint:"true"`
|
||||
}
|
||||
|
||||
type LoadPercentInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2441" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2441" struc:"skip"`
|
||||
Percent uint32 `fieldDescription:"加载百分比"`
|
||||
}
|
||||
|
||||
// UsePetItemInboundInfo 对应Java的UsePetItemInboundInfo,实现InboundMessage接口
|
||||
type UsePetItemInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2406" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2406" struc:"skip"`
|
||||
// 字段首字母大写以导出(对应Java的可访问性,配合@Data的getter/setter)
|
||||
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"` // @UInt long 对应Go的uint32(无符号64位)
|
||||
ItemId uint32 `description:"使用的物品ID" codec:"itemId"` // 结构体标签模拟@FieldDescription和@AutoCodec注解
|
||||
|
||||
@@ -4,7 +4,7 @@ import "blazing/logic/service/common"
|
||||
|
||||
//基地查看好友列表
|
||||
type SeeOnlineInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2157" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2157" struc:"skip"`
|
||||
|
||||
UserIdsLen uint32 `json:"userIdsLen" struc:"sizeof=UserIds"`
|
||||
UserIds []uint32 `json:"userIds" `
|
||||
|
||||
@@ -3,7 +3,7 @@ package item
|
||||
import "blazing/logic/service/common"
|
||||
|
||||
type BuyInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2601" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2601" struc:"skip"`
|
||||
//物品ID
|
||||
ItemId uint32
|
||||
//物品数量
|
||||
@@ -20,7 +20,7 @@ type BuyOutboundInfo struct {
|
||||
Level uint32
|
||||
}
|
||||
type BuyMultiInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2606" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2606" struc:"skip"`
|
||||
ItemListLen uint32 `struc:"sizeof=ItemIds"`
|
||||
ItemIds []uint32 `json:"itemIds" description:"购买的物品ID列表"` // @UInt Long对应uint64,List对应切片
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ type ChangePlayerClothOutboundInfo struct {
|
||||
ClothList []model.PeopleItemInfo `description:"玩家装备列表" codec:"list"` // List<PeopleItemInfo> -> 指针切片
|
||||
}
|
||||
type ChangePlayerClothInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2604" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2604" struc:"skip"`
|
||||
ClothesLen uint32 `struc:"sizeof=ClothList" fieldDesc:"穿戴装备的信息" json:"clothes_len"`
|
||||
ClothList []uint32 `description:"玩家装备列表" codec:"list"`
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
// 实现了入站消息接口(Go中通过方法集隐式实现)
|
||||
type ItemListInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2605" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2605" struc:"skip"`
|
||||
// 查询物品id的开始,
|
||||
Param1 uint32
|
||||
// 查询物品id的结尾
|
||||
@@ -23,7 +23,7 @@ type ItemListOutboundInfo struct {
|
||||
}
|
||||
|
||||
type GoldOnlineRemainInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"1105|1106" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"1105|1106" struc:"skip"`
|
||||
}
|
||||
|
||||
type GoldOnlineRemainOutboundInfo struct {
|
||||
@@ -35,7 +35,7 @@ type GoldOnlineRemainOutboundInfo struct {
|
||||
// ExpTotalRemainInboundInfo 累计经验相关的入站信息
|
||||
type ExpTotalRemainInboundInfo struct {
|
||||
// Head 消息头部信息,cmd保持原标识(如需调整可根据实际需求修改)
|
||||
Head common.TomeeHeader `cmd:"2319" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2319" struc:"skip"`
|
||||
}
|
||||
|
||||
// ExpTotalRemainOutboundInfo 累计经验相关的出站信息
|
||||
|
||||
@@ -3,14 +3,14 @@ package item
|
||||
import "blazing/logic/service/common"
|
||||
|
||||
type TalkCountInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2701" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2701" struc:"skip"`
|
||||
ID uint32 `description:"奖品的Type, 即ID" codec:"uint"` // @UInt long -> uint64,字段描述对应@FieldDescription
|
||||
}
|
||||
type TalkCountOutboundInfo struct {
|
||||
GiftCount uint32 `description:"已领取奖励的次数" codec:"uint"` // @UInt long -> uint64,字段描述对应@FieldDescription
|
||||
}
|
||||
type TalkCateInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2702" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2702" struc:"skip"`
|
||||
ID uint32 `description:"奖品的Type, 即ID" codec:"uint"` // @UInt long -> uint64,字段描述对应@FieldDescription
|
||||
}
|
||||
type DayTalkInfo struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type InInfo struct {
|
||||
Head common.TomeeHeader `cmd:"1004" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"1004" struc:"skip"` //玩家登录
|
||||
}
|
||||
|
||||
// OutInfo 表示地图热度的出站消息
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
)
|
||||
|
||||
type LeaveMapInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2002" struc:"[0]pad"` //切换地图
|
||||
Head common.TomeeHeader `cmd:"2002" struc:"skip"` //切换地图
|
||||
}
|
||||
|
||||
type InInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2001" struc:"[0]pad"` //切换地图
|
||||
Head common.TomeeHeader `cmd:"2001" struc:"skip"` //切换地图
|
||||
// 地图类型
|
||||
MapType uint32
|
||||
|
||||
|
||||
@@ -3,5 +3,5 @@ package maps
|
||||
import "blazing/logic/service/common"
|
||||
|
||||
type ListMapPlayerInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2003" struc:"[0]pad"` //切换地图
|
||||
Head common.TomeeHeader `cmd:"2003" struc:"skip"` //切换地图
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type WalkInInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2101" struc:"[0]pad"` //走路包
|
||||
Head common.TomeeHeader `cmd:"2101" struc:"skip"` //走路包
|
||||
// Flag: 0为走,1为飞行模式,@UInt long
|
||||
Flag uint32
|
||||
|
||||
|
||||
@@ -54,13 +54,13 @@ type NonoOutboundInfo struct {
|
||||
}
|
||||
|
||||
type NonoInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"9003" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"9003" struc:"skip"`
|
||||
|
||||
// 米米号
|
||||
UserID uint32
|
||||
}
|
||||
type NonoFollowOrHomeInInfo struct {
|
||||
Head common.TomeeHeader `cmd:"9019" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"9019" struc:"skip"`
|
||||
|
||||
// Flag 1为跟随 0为收回 且如果为收回收回 那么后续结构不需要发送
|
||||
// 对应Java的@UInt long类型,在Go中使用uint64
|
||||
@@ -86,7 +86,7 @@ type NonoFollowOutInfo struct {
|
||||
Power uint32 `fieldDescription:"能量值 前端显示除以1000后的值" uint:"true"`
|
||||
}
|
||||
type SwitchFlyingInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2112" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2112" struc:"skip"`
|
||||
Type uint32 `description:"开关, 0为取消飞行模式, 大于0为开启飞行模式" codec:"auto" uint:"true"` // 对应@FieldDescription、@UInt、@AutoCodec
|
||||
}
|
||||
type SwitchFlyingOutboundInfo struct {
|
||||
@@ -94,7 +94,7 @@ type SwitchFlyingOutboundInfo struct {
|
||||
Type uint32 `description:"开关, 0为取消飞行模式, 大于0为开启飞行模式" codec:"auto" uint:"true"` // 对应@FieldDescription、@UInt、@AutoCodec
|
||||
}
|
||||
type PetCureInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2306" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2306" struc:"skip"`
|
||||
}
|
||||
type PetCureOutboundEmpty struct {
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import "blazing/logic/service/common"
|
||||
|
||||
// PetBargeListInboundInfo 对应Java的PetBargeListInboundInfo,实现InboundMessage接口
|
||||
type PetBargeListInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2309" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2309" struc:"skip"`
|
||||
StartPetId uint32 `description:"开始精灵id" codec:"startPetId"` // @UInt long 对应Go的uint32(无符号64位)
|
||||
EndPetId uint32 `description:"结束精灵id" codec:"endPetId"` // 字段标签模拟注解功能(描述、编解码标识)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import "blazing/logic/service/common"
|
||||
|
||||
// 实现InboundMessage接口,用于处理宠物设置经验的入站消息
|
||||
type PetSetExpInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2318" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2318" struc:"skip"`
|
||||
// CatchTime 精灵获取时间,对应Java的@UInt long
|
||||
CatchTime uint32 `fieldDescription:"精灵获取时间" uint:"true" autoCodec:"true"`
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@ package pet
|
||||
import "blazing/logic/service/common"
|
||||
|
||||
type GetPetListInboundEmpty struct {
|
||||
Head common.TomeeHeader `cmd:"2303" struc:"[0]pad"`
|
||||
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"`
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type InInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2301" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2301" struc:"skip"`
|
||||
|
||||
CatchTime uint32
|
||||
}
|
||||
@@ -25,13 +25,13 @@ type PetReleaseOutboundInfo struct {
|
||||
|
||||
// 放入背包或者加入仓库
|
||||
type PetReleaseInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2304" struc:"[0]pad"`
|
||||
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:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2305" struc:"skip"`
|
||||
|
||||
CatchTime uint32 `codec:"catchTime" inboundMessageType:"Pet_Show"`
|
||||
Flag uint32 `codec:"flag"`
|
||||
@@ -48,17 +48,28 @@ type PetShowOutboundInfo struct {
|
||||
Reserved1 [3]uint32
|
||||
}
|
||||
type PetOneCureInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2310" struc:"[0]pad"`
|
||||
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:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2308" struc:"skip"`
|
||||
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true" autoCodec:"true" inboundMessageType:"Pet_Default"`
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import "blazing/logic/service/common"
|
||||
|
||||
// ChangeSkillInfo 技能变更信息
|
||||
type ChangeSkillInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2312" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2312" struc:"skip"`
|
||||
CatchTime uint32 `json:"catchTime"` // 精灵生成时间
|
||||
Reserved uint32 `json:"reserved"` // 填充字段,默认为1
|
||||
Reserved1 uint32 `json:"reserved1"` // 填充字段,默认为1
|
||||
|
||||
@@ -18,7 +18,7 @@ type FitmentShowInfo struct {
|
||||
|
||||
// FitmentUseringInboundInfo FitmentUseringInboundInfo类,实现InboundMessage接口
|
||||
type FitmentUseringInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"10006" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"10006" struc:"skip"` //玩家登录
|
||||
// 需要获取基地信息的目标玩家账号ID
|
||||
TargetUserID uint32 `json:"targetUserId"`
|
||||
}
|
||||
@@ -45,12 +45,12 @@ type PetRoomListOutboundInfo struct {
|
||||
}
|
||||
|
||||
type PetRoomListInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2324" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"2324" struc:"skip"` //玩家登录
|
||||
// 需要获取基地信息的目标玩家账号ID
|
||||
TargetUserID uint32 `json:"targetUserId"`
|
||||
}
|
||||
type FitmentAllInboundEmpty struct {
|
||||
Head common.TomeeHeader `cmd:"10007" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"10007" struc:"skip"`
|
||||
}
|
||||
type FitmentAllOutboundInfo struct {
|
||||
FitmentsLen uint32 `json:"fitmentsLen" struc:"sizeof=Fitments"`
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
// LoginSidInfo 登录携带的凭证结构体
|
||||
type InInfo struct { //这里直接使用组合来实现将传入的原始头部数据和结构体参数序列化
|
||||
Head common.TomeeHeader `cmd:"1002" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"1002" struc:"skip"` //玩家登录
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import "blazing/logic/service/common"
|
||||
// AcceptTaskInboundInfo
|
||||
// 用于接收任务的入站信息
|
||||
type AcceptTaskInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2201|2231" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2201|2231" struc:"skip"`
|
||||
TaskId uint32 `json:"taskId" description:"任务ID"` // 任务ID,
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import "blazing/logic/service/common"
|
||||
// AddTaskBufInboundInfo
|
||||
// 用于接收添加任务缓冲区的入站信息
|
||||
type AddTaskBufInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2204|2235" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2204|2235" struc:"skip"`
|
||||
TaskId uint32 `json:"taskId" description:"任务ID"` // 任务ID,
|
||||
TaskList []uint32 `struc:"[20]byte"` // 任务步骤信息,
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type CompleteTaskInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2202|2233" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2202|2233" struc:"skip"`
|
||||
TaskId uint32 `json:"taskId" description:"任务ID"` // 任务ID,
|
||||
OutState uint32 `json:"outState" ` // 当前状态,1表示完成任务,
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import "blazing/logic/service/common"
|
||||
|
||||
// DeleteTaskInboundInfo
|
||||
type DeleteTaskInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2205|2232" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2205|2232" struc:"skip"`
|
||||
TaskId uint32 `json:"taskId" description:"任务ID"` // 使用uint64
|
||||
}
|
||||
type DeleteTaskOutboundInfo struct {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type GetTaskBufInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2203|2234" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2203|2234" struc:"skip"`
|
||||
|
||||
TaskId uint32 `json:"taskId" description:"任务ID"` // 任务ID,
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package user
|
||||
import "blazing/logic/service/common"
|
||||
|
||||
type CreatePlayerInboundInfo struct { //这里直接使用组合来实现将传入的原始头部数据和结构体参数序列化
|
||||
Head common.TomeeHeader `cmd:"108" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"108" struc:"skip"` //玩家登录
|
||||
|
||||
// 玩家昵称,@ArraySerialize注解
|
||||
Nickname string `struc:"[16]byte"` // 固定长度16字节
|
||||
@@ -17,7 +17,7 @@ type CreatePlayerOutInfo struct {
|
||||
}
|
||||
|
||||
type ChangePlayerNameInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2061" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"2061" struc:"skip"` //玩家登录
|
||||
|
||||
// 玩家昵称
|
||||
Nickname string `struc:"[16]byte"` // 固定长度16字节
|
||||
|
||||
@@ -5,8 +5,8 @@ import "blazing/logic/service/common"
|
||||
//var _ entity.Blazingservice = (*SidInfo)(nil)
|
||||
|
||||
type SidInfo struct { //这里直接使用组合来实现将传入的原始头部数据和结构体参数序列化
|
||||
Head common.TomeeHeader `cmd:"105" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"105" struc:"skip"` //玩家登录
|
||||
|
||||
Sid []byte `struc:"[20]byte"` // 登录会话ID,固定长度16字节
|
||||
// ret []byte `struc:"[0]pad"`
|
||||
// ret []byte `struc:"skip"`
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type SimUserInfoInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2051" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2051" struc:"skip"`
|
||||
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
|
||||
}
|
||||
type SimUserInfoOutboundInfo struct {
|
||||
@@ -71,7 +71,7 @@ type SimUserInfoOutboundInfo struct {
|
||||
Clothes []model.PeopleItemInfo `codec:"true"`
|
||||
}
|
||||
type MoreUserInfoInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2052" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2052" struc:"skip"`
|
||||
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
|
||||
}
|
||||
type MoreUserInfoOutboundInfo struct {
|
||||
@@ -121,7 +121,7 @@ type MoreUserInfoOutboundInfo struct {
|
||||
|
||||
// AimatInboundInfo 对应Java的AimatInboundInfo类
|
||||
type AimatInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2104" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2104" struc:"skip"`
|
||||
ItemId uint32 `description:"物品id 射击激光 物品id为0" codec:"auto" uint:"true"`
|
||||
ShootType uint32 `description:"射击类型 未知 给0" codec:"auto" uint:"true"`
|
||||
Point model.Pos `description:"射击的坐标 x y" codec:"auto"` // 默认值对应@Builder.Default
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
// LoginSidInfo 登录携带的凭证结构体
|
||||
type MAIN_LOGIN_IN struct { //这里直接使用组合来实现将传入的原始头部数据和结构体参数序列化
|
||||
Head common.TomeeHeader `cmd:"1001" struc:"[0]pad"` //玩家登录
|
||||
Head common.TomeeHeader `cmd:"1001" struc:"skip"` //玩家登录
|
||||
|
||||
Sid []byte `struc:"[16]byte"` // 登录会话ID,固定长度16字节
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package user
|
||||
import "blazing/logic/service/common"
|
||||
|
||||
type ChatInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2102" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2102" struc:"skip"`
|
||||
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"` // @UInt long reserve,无符号长整数
|
||||
MessageLen uint32 `struc:"sizeof=Message"`
|
||||
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"` // 消息内容,包含utf-8空字符('\x00')作为结束符
|
||||
@@ -16,7 +16,7 @@ type ChatOutboundInfo struct {
|
||||
Message string `description:"这里的内容没有结束符" codec:"string"` // String -> string
|
||||
}
|
||||
type ChangeColorInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2063" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2063" struc:"skip"`
|
||||
|
||||
Color uint32 `codec:"color"` // 更改的颜色 rgb (对应Java的@UInt long)
|
||||
}
|
||||
@@ -27,7 +27,7 @@ type ChangeColorOutboundInfo struct {
|
||||
Coins uint32 `codec:"coins"` // 扣除200豆子后返回的剩余豆子 (对应Java的@UInt long)
|
||||
}
|
||||
type ChangeDoodleInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2062" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2062" struc:"skip"`
|
||||
Id uint32 `codec:"id"` // 涂鸦ID (对应Java的@UInt long)
|
||||
Color uint32 `codec:"color"` // 前端发来的更改的颜色rgb值 (对应Java的@UInt long)
|
||||
}
|
||||
@@ -39,7 +39,7 @@ type ChangeDoodleOutboundInfo struct {
|
||||
Coins uint32 `codec:"coins"` // 扣除对应豆子后返回的剩余豆子 (对应Java的@UInt long)
|
||||
}
|
||||
type ChangeNONOColorInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"9012" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"9012" struc:"skip"`
|
||||
|
||||
Color uint32 `codec:"color"` // 更改的颜色 rgb (对应Java的@UInt long)
|
||||
}
|
||||
@@ -52,7 +52,7 @@ type ChangeNONOColorOutboundInfo struct {
|
||||
// C2SDanceAction 前端发送给后端的舞蹈动作请求结构体
|
||||
// 对应 C# 的 C2S_DANCE_ACTION
|
||||
type C2SDanceAction struct {
|
||||
Head common.TomeeHeader `cmd:"2103" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2103" struc:"skip"`
|
||||
|
||||
// Reserve 固定参数(值为 10001)
|
||||
Reserve uint32 `struc:"uint32,big"`
|
||||
@@ -66,7 +66,7 @@ type S2CDanceAction struct {
|
||||
Type uint32 `struc:"uint32,big"`
|
||||
}
|
||||
type C2SPEOPLE_TRANSFROM struct {
|
||||
Head common.TomeeHeader `cmd:"2111" struc:"[0]pad"`
|
||||
Head common.TomeeHeader `cmd:"2111" struc:"skip"`
|
||||
|
||||
// Reserve 固定参数(值为 10001)
|
||||
SuitID uint32 `struc:"uint32,big"`
|
||||
|
||||
@@ -2,7 +2,7 @@ package model
|
||||
|
||||
// TeamInfo 战队信息结构
|
||||
type TeamInfo struct {
|
||||
//Head common.TomeeHeader `cmd:"1001" struc:"[0]pad"` // 命令头
|
||||
//Head common.TomeeHeader `cmd:"1001" struc:"skip"` // 命令头
|
||||
ID uint32 `struc:"uint32" default:"0"` // 默认值0
|
||||
Priv uint32 `struc:"uint32" default:"1"` // 默认值1
|
||||
SuperCore uint32 `struc:"uint32" default:"1"` // 默认值1
|
||||
|
||||
Reference in New Issue
Block a user