feat: 新增游戏协议入站结构体定义
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
97
logic/controller/inbound_user.go
Normal file
97
logic/controller/inbound_user.go
Normal file
@@ -0,0 +1,97 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/logic/service/common"
|
||||
"blazing/modules/player/model"
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"hash/crc32"
|
||||
)
|
||||
|
||||
type MAIN_LOGIN_IN struct {
|
||||
Head common.TomeeHeader `cmd:"1001" struc:"skip"`
|
||||
Sid []byte `struc:"[16]byte"`
|
||||
}
|
||||
|
||||
func (l *MAIN_LOGIN_IN) CheakSession() (bool, uint32) {
|
||||
t1 := hex.EncodeToString(l.Sid)
|
||||
r, err := cool.CacheManager.Get(context.Background(), fmt.Sprintf("session:%d", l.Head.UserID))
|
||||
if err != nil {
|
||||
return false, 0
|
||||
}
|
||||
if r.String() != t1 {
|
||||
return false, 0
|
||||
}
|
||||
crc32Table := crc32.MakeTable(crc32.IEEE)
|
||||
crcValue := crc32.Checksum([]byte(l.Sid), crc32Table)
|
||||
cool.CacheManager.Remove(context.Background(), fmt.Sprintf("session:%d", l.Head.UserID))
|
||||
return true, crcValue
|
||||
}
|
||||
|
||||
type SimUserInfoInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2051" struc:"skip"`
|
||||
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
|
||||
}
|
||||
|
||||
type MoreUserInfoInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2052" struc:"skip"`
|
||||
UserId uint32 `fieldDescription:"米米号" uint:"true" codec:"true"`
|
||||
}
|
||||
|
||||
type AimatInboundInfo struct {
|
||||
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"`
|
||||
}
|
||||
|
||||
type ChatInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2102" struc:"skip"`
|
||||
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"`
|
||||
MessageLen uint32 `struc:"sizeof=Message"`
|
||||
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"`
|
||||
}
|
||||
|
||||
type ChangeColorInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2063" struc:"skip"`
|
||||
Color uint32 `codec:"color"`
|
||||
}
|
||||
|
||||
type ChangeDoodleInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2062" struc:"skip"`
|
||||
Id uint32 `codec:"id"`
|
||||
Color uint32 `codec:"color"`
|
||||
}
|
||||
|
||||
type ChangeNONOColorInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"9012" struc:"skip"`
|
||||
Color uint32 `codec:"color"`
|
||||
}
|
||||
|
||||
type C2SDanceAction struct {
|
||||
Head common.TomeeHeader `cmd:"2103" struc:"skip"`
|
||||
Reserve uint32 `struc:"uint32,big"`
|
||||
Type uint32 `struc:"uint32,big"`
|
||||
}
|
||||
|
||||
type C2SPEOPLE_TRANSFROM struct {
|
||||
Head common.TomeeHeader `cmd:"2111" struc:"skip"`
|
||||
SuitID uint32 `struc:"uint32,big"`
|
||||
}
|
||||
|
||||
type ChangePlayerNameInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2061" struc:"skip"`
|
||||
Nickname string `struc:"[16]byte"`
|
||||
}
|
||||
|
||||
type ChangeTitleInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"3404" struc:"skip"`
|
||||
TileID uint32
|
||||
}
|
||||
|
||||
type C2S_GET_GIFT_COMPLETE struct {
|
||||
Head common.TomeeHeader `cmd:"2801" struc:"skip"`
|
||||
PassText string `struc:"[16]byte"`
|
||||
}
|
||||
Reference in New Issue
Block a user