This commit is contained in:
@@ -8,20 +8,18 @@ import (
|
||||
"github.com/lunixbochs/struc"
|
||||
)
|
||||
|
||||
// TomeeHeader 结构体字段定义
|
||||
// TomeeHeader 定义协议包头。
|
||||
type TomeeHeader struct {
|
||||
Len uint32 `json:"len"`
|
||||
Version byte `json:"version" struc:"[1]byte"`
|
||||
CMD uint32 `json:"cmdId" struc:"uint32"`
|
||||
UserID uint32 `json:"userId"`
|
||||
//Error uint32 `json:"error" struc:"skip"`
|
||||
|
||||
Result uint32 `json:"result"`
|
||||
Data []byte `json:"data" struc:"skip"` //组包忽略此字段// struc:"skip"
|
||||
Res []byte `struc:"skip"`
|
||||
//Return []byte `struc:"skip"` //返回记录
|
||||
Len uint32 `json:"len"` // 包总长度(包头 + 数据体)。
|
||||
Version byte `json:"version" struc:"[1]byte"` // 协议版本。
|
||||
CMD uint32 `json:"cmdId" struc:"uint32"` // 命令 ID。
|
||||
UserID uint32 `json:"userId"` // 玩家 ID。
|
||||
Result uint32 `json:"result"` // 结果码。
|
||||
Data []byte `json:"data" struc:"skip"` // 数据体,序列化时跳过。
|
||||
Res []byte `struc:"skip"` // 预留返回数据,序列化时跳过。
|
||||
}
|
||||
|
||||
// NewTomeeHeader 创建用于下行封包的默认 TomeeHeader。
|
||||
func NewTomeeHeader(cmd uint32, userid uint32) *TomeeHeader {
|
||||
|
||||
return &TomeeHeader{
|
||||
|
||||
Reference in New Issue
Block a user