```
refactor(rpc): 更新结构体标签以跳过特定字段序列化 将多个结构体中的 `struc:"[0]pad"` 标签更改为 `struc:"skip"`, 以避免在序列化过程中处理不必要的填充字段。同时新增放生与领回相关逻辑, 并完善部分控制器函数和消息结构定义。 ```
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user