mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
优化登录、离线、服务器重启等会话连接问题
This commit is contained in:
@@ -5,35 +5,45 @@ import pb "google.golang.org/protobuf/proto"
|
||||
const (
|
||||
MsgTypeGame = iota
|
||||
MsgTypeFight
|
||||
MsgTypeConnCtrl
|
||||
)
|
||||
|
||||
type NetMsg struct {
|
||||
MsgType uint8 `msgpack:"MsgType"`
|
||||
EventId uint16 `msgpack:"EventId"`
|
||||
Topic string `msgpack:"-"`
|
||||
GameMsg *GameMsg `msgpack:"GameMsg"`
|
||||
FightMsg *FightMsg `msgpack:"FightMsg"`
|
||||
MsgType uint8 `msgpack:"MsgType"`
|
||||
EventId uint16 `msgpack:"EventId"`
|
||||
Topic string `msgpack:"-"`
|
||||
GameMsg *GameMsg `msgpack:"GameMsg"`
|
||||
FightMsg *FightMsg `msgpack:"FightMsg"`
|
||||
ConnCtrlMsg *ConnCtrlMsg `msgpack:"ConnCtrlMsg"`
|
||||
}
|
||||
|
||||
const (
|
||||
NormalMsg = iota
|
||||
UserRegNotify
|
||||
UserLoginNotify
|
||||
UserOfflineNotify
|
||||
ClientRttNotify
|
||||
ClientTimeNotify
|
||||
)
|
||||
|
||||
type GameMsg struct {
|
||||
UserId uint32 `msgpack:"UserId"`
|
||||
CmdId uint16 `msgpack:"CmdId"`
|
||||
ClientSeq uint32 `msgpack:"ClientSeq"`
|
||||
ClientRtt uint32 `msgpack:"ClientRtt"`
|
||||
ClientTime uint32 `msgpack:"ClientTime"`
|
||||
PayloadMessage pb.Message `msgpack:"-"`
|
||||
PayloadMessageData []byte `msgpack:"PayloadMessageData"`
|
||||
}
|
||||
|
||||
const (
|
||||
ClientRttNotify = iota
|
||||
ClientTimeNotify
|
||||
KickPlayerNotify
|
||||
)
|
||||
|
||||
type ConnCtrlMsg struct {
|
||||
UserId uint32 `msgpack:"UserId"`
|
||||
ClientRtt uint32 `msgpack:"ClientRtt"`
|
||||
ClientTime uint32 `msgpack:"ClientTime"`
|
||||
KickUserId uint32 `msgpack:"KickUserId"`
|
||||
KickReason uint32 `msgpack:"KickReason"`
|
||||
}
|
||||
|
||||
const (
|
||||
AddFightRoutine = iota
|
||||
DelFightRoutine
|
||||
|
||||
Reference in New Issue
Block a user