Documentation ¶
Index ¶
- Constants
- func Init()
- type AOISyncUserState
- func (msg *AOISyncUserState) AddData(id uint64, data []byte)
- func (msg *AOISyncUserState) Clear()
- func (msg *AOISyncUserState) MarshalTo(data []byte) (n int, err error)
- func (msg *AOISyncUserState) Name() string
- func (msg *AOISyncUserState) Size() (n int)
- func (msg *AOISyncUserState) String() string
- func (msg *AOISyncUserState) Unmarshal(data []byte) error
- type AdjustUserState
- type CellEntityMsg
- type ClientFrameMsg
- type ClientFrameMsgData
- type ClientTransport
- type ClientVertifyFailedRet
- type ClientVertifyReq
- type ClientVertifySucceedRet
- type CreateEntityReq
- type CreateEntityRet
- type CreateGhostReq
- type DeleteGhostReq
- type DestroyEntityReq
- type DestroyEntityRet
- type EnterAOI
- type EnterCell
- type EnterCellReq
- type EntityAOIS
- func (msg *EntityAOIS) AddData(data []byte)
- func (msg *EntityAOIS) Clear()
- func (msg *EntityAOIS) GetData() [][]byte
- func (msg *EntityAOIS) MarshalTo(data []byte) (n int, err error)
- func (msg *EntityAOIS) Name() string
- func (msg *EntityAOIS) Size() (n int)
- func (msg *EntityAOIS) String() string
- func (msg *EntityAOIS) Unmarshal(data []byte) error
- type EntityEvent
- type EntityMsgChange
- type EntityMsgTransport
- type EntitySrvInfoNotify
- type EntityVarData
- type FramesMsg
- type HeartBeat
- type IMsg
- type LeaveAOI
- type LeaveCell
- type LeaveCellReq
- type MRolePropsSyncClient
- type MsgDef
- func (def *MsgDef) GetMsgIDByName(msgName string) (uint16, error)
- func (def *MsgDef) GetMsgInfo(msgID uint16) (msgName string, msgContent IMsg, err error)
- func (def *MsgDef) Init()
- func (def *MsgDef) InitBytesMsg()
- func (def *MsgDef) IsMsgExist(msgID uint16) bool
- func (def *MsgDef) RegMsg(msgID uint16, msgBody interface{})
- type MsgInfo
- type NewRealNotify
- type PropsSync
- type PropsSyncClient
- type ProtoSync
- type RPCMsg
- type RequireFramesMsg
- type ServerFrameMsg
- type SpaceUserConnect
- type SpaceUserConnectSucceedRet
- func (msg *SpaceUserConnectSucceedRet) MarshalTo(data []byte) (n int, err error)
- func (msg *SpaceUserConnectSucceedRet) Name() string
- func (msg *SpaceUserConnectSucceedRet) Size() (n int)
- func (msg *SpaceUserConnectSucceedRet) String() string
- func (msg *SpaceUserConnectSucceedRet) Unmarshal(data []byte) error
- type SrvMsgTransport
- type SyncClock
- type SyncUserState
- type TestBinMsg
- type TransferRealReq
- type UserDuplicateLoginNotify
- func (msg *UserDuplicateLoginNotify) MarshalTo(data []byte) (n int, err error)
- func (msg *UserDuplicateLoginNotify) Name() string
- func (msg *UserDuplicateLoginNotify) Size() (n int)
- func (msg *UserDuplicateLoginNotify) String() string
- func (msg *UserDuplicateLoginNotify) Unmarshal(data []byte) error
Constants ¶
const ( //ClientVertifyReqMsgID 验证消息的ID号 ClientVertifyReqMsgID = 1 //ClientVertifySucceedRetMsgID 验证结果成功返回的ID号 ClientVertifySucceedRetMsgID = 2 //ClientVertifyFailedRetMsgID 验证结果失败返回的ID号 ClientVertifyFailedRetMsgID = 3 // HeartBeatMsgID 心跳消息ID HeartBeatMsgID = 4 // TestBinMsgID 测试消息 TestBinMsgID = 8 //EntitySrvInfoNotifyID 实体变化消息 EntitySrvInfoNotifyID = 9 //ProtoSyncMsgID ProtoSync消息ID ProtoSyncMsgID = 10 // ClientFrameMsgID 客户端过来的帧消息 ClientFrameMsgID = 20 // ServerFrameMsgID 服务器下发的单帧消息 ServerFrameMsgID = 21 // FramesMsgID 服务器下发的多帧消息 FramesMsgID = 22 // RequireFramesMsgID 客户端 RequireFramesMsgID = 23 // UserDuplicateLoginNotifyMsgID 玩家重复登录的消息 UserDuplicateLoginNotifyMsgID = 24 // PropsSyncMsgID 属性消息ID PropsSyncMsgID = 30 // PropsSyncClientMsgID 发给客户端的属性消息ID PropsSyncClientMsgID = 31 // MRolePropsSyncClientMsgID 主角属性同步消息DI MRolePropsSyncClientMsgID = 32 // EnterCellReqMsgID 进入空间的消息 EnterCellReqMsgID = 40 // LeaveCellReqMsgID 离开空间的消息 LeaveCellReqMsgID = 41 // EnterAOIMsgID 进入AOI消息 EnterAOIMsgID = 42 // LeaveAOIMsgID 离开AOI消息 LeaveAOIMsgID = 43 // AOIPosChangeMsgID AOI位置改变消息 AOIPosChangeMsgID = 44 // EnterCellMsgID 玩家进入场景 EnterCellMsgID = 45 // LeaveCellMsgID 玩家离开场景 LeaveCellMsgID = 46 // UserMoveMsgID 玩家移动 UserMoveMsgID = 47 // CellEntityMsgID 空间实体消息 CellEntityMsgID = 48 // EntityPosSetMsgID 玩家移动 EntityPosSetMsgID = 49 // ClientTransportMsgID 客户端中转消息ID ClientTransportMsgID = 50 // CreateEntityReqMsgID 请求创建实体消息ID CreateEntityReqMsgID = 51 // CreateEntityRetMsgID 创建实体返回消息ID CreateEntityRetMsgID = 52 // DestroyEntityReqMsgID 请求删除实体消息ID DestroyEntityReqMsgID = 53 // DestroyEntityRetMsgID 销毁实体返回消息ID DestroyEntityRetMsgID = 54 // EntityMsgTransportMsgID 分布式实体之间传递消息用 EntityMsgTransportMsgID = 55 // EntityMsgChangeMsgID 分布式实体之间同步数据使用 EntityMsgChangeMsgID = 56 // SrvMsgTransportMsgID 服务器间消息转发ID SrvMsgTransportMsgID = 57 // RPCMsgID RPC消息 RPCMsgID = 58 SyncClockMsgID = 59 SpaceUserConnectMsgID = 61 SpaceUserConnectSucceedRetMsgID = 62 SyncUserStateMsgID = 63 AOISyncUserStateMsgID = 64 AdjustUserStateMsgID = 65 EntityAOISMsgID = 66 EntityBasePropsMsgID = 67 EntityEventMsgID = 68 // CellMsgTransportMsgID 发消息给某个cell CellMsgTransportMsgID = 71 //创建ghost CreateGhostReqMsgID = 72 //删除ghost DeleteGhostReqMsgID = 73 //切换real TransferRealReqMsgID = 74 //新real通知 NewRealNotifyMsgID = 75 )
const ( // Connected 正常连接 Connected uint8 = 1 // ReConnect 断线重连 ReConnect uint8 = 2 // DupConnect 重复连接 DupConnect uint8 = 3 )
ClientVertifySucceedRet 中登录类型
const ( // SessHBTimeout 心跳超时 SessHBTimeout uint8 = 1 // SessDisconnect 断线 SessDisconnect uint8 = 2 // SessError 出错 SessError uint8 = 3 )
const ( // ClientMSG 来自客户端的验证消息 ClientMSG uint8 = 0 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AOISyncUserState ¶
AOISyncUserState AOI同步信息
func NewAOISyncUserState ¶
func NewAOISyncUserState() *AOISyncUserState
func (*AOISyncUserState) AddData ¶
func (msg *AOISyncUserState) AddData(id uint64, data []byte)
AddData 增加一个玩家数据
func (*AOISyncUserState) MarshalTo ¶
func (msg *AOISyncUserState) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*AOISyncUserState) String ¶
func (msg *AOISyncUserState) String() string
func (*AOISyncUserState) Unmarshal ¶
func (msg *AOISyncUserState) Unmarshal(data []byte) error
Unmarshal 反序列化
type AdjustUserState ¶
type AdjustUserState struct {
Data []byte
}
AdjustUserState 纠正状态
func (*AdjustUserState) MarshalTo ¶
func (msg *AdjustUserState) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*AdjustUserState) String ¶
func (msg *AdjustUserState) String() string
func (*AdjustUserState) Unmarshal ¶
func (msg *AdjustUserState) Unmarshal(data []byte) error
Unmarshal 反序列化
type CellEntityMsg ¶
CellEntityMsg 客户端直接投递到spaceEntity时的包装消息
func (*CellEntityMsg) MarshalTo ¶
func (msg *CellEntityMsg) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*CellEntityMsg) String ¶
func (msg *CellEntityMsg) String() string
func (*CellEntityMsg) Unmarshal ¶
func (msg *CellEntityMsg) Unmarshal(data []byte) error
Unmarshal 反序列化
type ClientFrameMsg ¶
type ClientFrameMsg struct {
Data []byte
}
ClientFrameMsg 客户端上发的帧消息
func (*ClientFrameMsg) MarshalTo ¶
func (msg *ClientFrameMsg) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*ClientFrameMsg) Name ¶
func (msg *ClientFrameMsg) Name() string
func (*ClientFrameMsg) Unmarshal ¶
func (msg *ClientFrameMsg) Unmarshal(data []byte) error
Unmarshal 反序列化
type ClientFrameMsgData ¶
ClientFrameMsgData 拼接UID之后的单用户帧消息
func (*ClientFrameMsgData) MarshalTo ¶
func (msg *ClientFrameMsgData) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*ClientFrameMsgData) Name ¶
func (msg *ClientFrameMsgData) Name() string
func (*ClientFrameMsgData) Unmarshal ¶
func (msg *ClientFrameMsgData) Unmarshal(data []byte) error
Unmarshal 反序列化
type ClientTransport ¶
ClientTransport 客户端中转消息 当客户端消息要投递给非网关对象时,用该消息包装
func (*ClientTransport) MarshalTo ¶
func (msg *ClientTransport) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*ClientTransport) Size ¶
func (msg *ClientTransport) Size() (n int)
Size 获取长度 []byte长度额外2个字节, 两个uint8 2个字节 固定长度4字节
func (*ClientTransport) String ¶
func (msg *ClientTransport) String() string
func (*ClientTransport) Unmarshal ¶
func (msg *ClientTransport) Unmarshal(data []byte) error
Unmarshal 反序列化
type ClientVertifyFailedRet ¶
type ClientVertifyFailedRet struct { }
ClientVertifyFailedRet 验证成功返回消息
func (*ClientVertifyFailedRet) MarshalTo ¶
func (msg *ClientVertifyFailedRet) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*ClientVertifyFailedRet) String ¶
func (msg *ClientVertifyFailedRet) String() string
func (*ClientVertifyFailedRet) Unmarshal ¶
func (msg *ClientVertifyFailedRet) Unmarshal(data []byte) error
Unmarshal 反序列化
type ClientVertifyReq ¶
type ClientVertifyReq struct { // Source: 消息来源, 分客户端或者服务器(ClientMSG/服务器类型) Source uint8 //data[0] // UID: 玩家UID或者服务器ID UID uint64 //data[1:9] // Token: 客户端登录时需要携带Token Token string //data[9:41] }
ClientVertifyReq 验证消息
func (*ClientVertifyReq) MarshalTo ¶
func (msg *ClientVertifyReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*ClientVertifyReq) String ¶
func (msg *ClientVertifyReq) String() string
func (*ClientVertifyReq) Unmarshal ¶
func (msg *ClientVertifyReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type ClientVertifySucceedRet ¶
type ClientVertifySucceedRet struct { // Source: 消息来源, 分客户端或者服务器(ClientMSG/服务器类型) Source uint8 // UID: 客户端验证时返回UID UID uint64 // SourceID: 验证成功消息的来源 SourceID uint64 // Type: 连接类型 Type uint8 }
ClientVertifySucceedRet 验证成功返回消息
func (*ClientVertifySucceedRet) MarshalTo ¶
func (msg *ClientVertifySucceedRet) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*ClientVertifySucceedRet) String ¶
func (msg *ClientVertifySucceedRet) String() string
func (*ClientVertifySucceedRet) Unmarshal ¶
func (msg *ClientVertifySucceedRet) Unmarshal(data []byte) error
Unmarshal 反序列化
type CreateEntityReq ¶
type CreateEntityReq struct { EntityType string EntityID uint64 CellID uint64 DBID uint64 InitParam []byte SrcSrvType uint8 SrcSrvID uint64 CallbackID uint32 }
CreateEntityReq 请求创建实体消息
func (*CreateEntityReq) MarshalTo ¶
func (msg *CreateEntityReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*CreateEntityReq) String ¶
func (msg *CreateEntityReq) String() string
func (*CreateEntityReq) Unmarshal ¶
func (msg *CreateEntityReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type CreateEntityRet ¶
type CreateEntityRet struct { SrvType uint8 EntityID uint64 SpaceID uint64 CallbackID uint32 ErrorStr string }
CreateEntityRet 创建实体返回
func (*CreateEntityRet) MarshalTo ¶
func (msg *CreateEntityRet) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*CreateEntityRet) Size ¶
func (msg *CreateEntityRet) Size() (n int)
Size 获取长度 1 + 8 + 8 + 4 + 2 + len(string)
func (*CreateEntityRet) String ¶
func (msg *CreateEntityRet) String() string
func (*CreateEntityRet) Unmarshal ¶
func (msg *CreateEntityRet) Unmarshal(data []byte) error
Unmarshal 反序列化
type CreateGhostReq ¶
type CreateGhostReq struct { EntityType string EntityID uint64 DBID uint64 InitParam []byte CellID uint64 Pos linmath.Vector3 RealServerID uint64 RealCellID uint64 PropNum uint32 Props []byte }
CreateGhostReq 请求创建ghost
func (*CreateGhostReq) MarshalTo ¶
func (msg *CreateGhostReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*CreateGhostReq) String ¶
func (msg *CreateGhostReq) String() string
func (*CreateGhostReq) Unmarshal ¶
func (msg *CreateGhostReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type DeleteGhostReq ¶
type DeleteGhostReq struct {
EntityID uint64
}
DeleteGhostReq 请求删除ghost
func (*DeleteGhostReq) MarshalTo ¶
func (msg *DeleteGhostReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*DeleteGhostReq) String ¶
func (msg *DeleteGhostReq) String() string
func (*DeleteGhostReq) Unmarshal ¶
func (msg *DeleteGhostReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type DestroyEntityReq ¶
type DestroyEntityReq struct { EntityID uint64 SrcSrvType uint8 SrcSrvID uint64 CallbackID uint32 CellID uint64 }
DestroyEntityReq 请求删除实体消息
func (*DestroyEntityReq) MarshalTo ¶
func (msg *DestroyEntityReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*DestroyEntityReq) Size ¶
func (msg *DestroyEntityReq) Size() (n int)
Size 获取长度 8 + 1 + 8 + 4 + 8
func (*DestroyEntityReq) String ¶
func (msg *DestroyEntityReq) String() string
func (*DestroyEntityReq) Unmarshal ¶
func (msg *DestroyEntityReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type DestroyEntityRet ¶
type DestroyEntityRet struct { SrvType uint8 SrvID uint64 EntityID uint64 SpaceID uint64 CallbackID uint32 ErrorStr string }
DestroyEntityRet 销毁实体返回
func (*DestroyEntityRet) MarshalTo ¶
func (msg *DestroyEntityRet) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*DestroyEntityRet) Size ¶
func (msg *DestroyEntityRet) Size() (n int)
Size 获取长度 1 + 8 + 8 + 8 + 4 + 2 + len(string)
func (*DestroyEntityRet) String ¶
func (msg *DestroyEntityRet) String() string
func (*DestroyEntityRet) Unmarshal ¶
func (msg *DestroyEntityRet) Unmarshal(data []byte) error
Unmarshal 反序列化
type EnterAOI ¶
type EnterAOI struct { EntityID uint64 EntityType string State []byte PropNum uint16 Properties []byte Pos linmath.Vector3 Rota linmath.Vector3 }
EnterAOI 玩家进入AOI
type EnterCellReq ¶
type EnterCellReq struct { SrvID uint64 CellID uint64 EntityType string EntityID uint64 DBID uint64 InitParam []byte OldSrvID uint64 OldCellID uint64 Pos linmath.Vector3 }
EnterCellReq 请求进入空间
func (*EnterCellReq) MarshalTo ¶
func (msg *EnterCellReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*EnterCellReq) Size ¶
func (msg *EnterCellReq) Size() (n int)
Size 获取长度 8 + 8 + 2 + len(string) + 8 + 8 + 8 + 8
func (*EnterCellReq) String ¶
func (msg *EnterCellReq) String() string
func (*EnterCellReq) Unmarshal ¶
func (msg *EnterCellReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type EntityAOIS ¶
type EntityAOIS struct { Num uint32 // contains filtered or unexported fields }
EntityAOIS 进入AOI范围
func (*EntityAOIS) GetData ¶
func (msg *EntityAOIS) GetData() [][]byte
func (*EntityAOIS) MarshalTo ¶
func (msg *EntityAOIS) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*EntityAOIS) String ¶
func (msg *EntityAOIS) String() string
type EntityEvent ¶
EntityEvent 分布式实体之间调用方法
func (*EntityEvent) MarshalTo ¶
func (msg *EntityEvent) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*EntityEvent) String ¶
func (msg *EntityEvent) String() string
type EntityMsgChange ¶
type EntityMsgChange struct {
VarData []EntityVarData
}
EntityMsgChange 分布式实体之间同步数据使用
func (*EntityMsgChange) MarshalTo ¶
func (msg *EntityMsgChange) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*EntityMsgChange) String ¶
func (msg *EntityMsgChange) String() string
func (*EntityMsgChange) Unmarshal ¶
func (msg *EntityMsgChange) Unmarshal(data []byte) error
Unmarshal 反序列化 这里代码如果data数据有问题,会导致v.Unmarshal(data[pos:]) crash,先记录下
type EntityMsgTransport ¶
type EntityMsgTransport struct { SrvType uint8 EntityID uint64 CellID uint64 IsGateway bool //是不是gateway中转过来的数据 MsgContent []byte }
EntityMsgTransport 分布式实体之间传递消息用
func (*EntityMsgTransport) MarshalTo ¶
func (msg *EntityMsgTransport) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*EntityMsgTransport) String ¶
func (msg *EntityMsgTransport) String() string
func (*EntityMsgTransport) Unmarshal ¶
func (msg *EntityMsgTransport) Unmarshal(data []byte) error
Unmarshal 反序列化
type EntitySrvInfoNotify ¶
type EntitySrvInfoNotify struct { }
EntitySrvInfoNotify 客户端直接投递到spaceEntity时的包装消息
func (*EntitySrvInfoNotify) MarshalTo ¶
func (msg *EntitySrvInfoNotify) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*EntitySrvInfoNotify) String ¶
func (msg *EntitySrvInfoNotify) String() string
func (*EntitySrvInfoNotify) Unmarshal ¶
func (msg *EntitySrvInfoNotify) Unmarshal(data []byte) error
Unmarshal 反序列化
type EntityVarData ¶
EntityVarData 分布式实体变量的消息
func (*EntityVarData) MarshalTo ¶
func (msg *EntityVarData) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*EntityVarData) Size ¶
func (msg *EntityVarData) Size() (n int)
Size 获取长度 2 + len(string) + 2 + len([]byte)
func (*EntityVarData) String ¶
func (msg *EntityVarData) String() string
func (*EntityVarData) Unmarshal ¶
func (msg *EntityVarData) Unmarshal(data []byte) error
Unmarshal 反序列化
type FramesMsg ¶
type FramesMsg struct {
Frames []ServerFrameMsg
}
FramesMsg 服务器下发的多帧消息
type HeartBeat ¶
type HeartBeat struct { }
HeartBeat 心跳消息
type IMsg ¶
type IMsg interface { MarshalTo(data []byte) (n int, err error) Unmarshal(data []byte) error Size() (n int) Name() string }
IMsg 消息接口,所有的消息类都必须实现的接口
type LeaveAOI ¶
type LeaveAOI struct {
EntityID uint64
}
LeaveAOI 离开AOI
type LeaveCell ¶
type LeaveCell struct { }
LeaveCell 离开空间
type LeaveCellReq ¶
type LeaveCellReq struct {
EntityID uint64
}
LeaveCellReq 请求离开空间
func (*LeaveCellReq) MarshalTo ¶
func (msg *LeaveCellReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*LeaveCellReq) String ¶
func (msg *LeaveCellReq) String() string
func (*LeaveCellReq) Unmarshal ¶
func (msg *LeaveCellReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type MRolePropsSyncClient ¶
MRolePropsSyncClient 主角属性变化,客户端主角关注的属性变化由该消息发出
func (*MRolePropsSyncClient) MarshalTo ¶
func (msg *MRolePropsSyncClient) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*MRolePropsSyncClient) Size ¶
func (msg *MRolePropsSyncClient) Size() (n int)
Size 获取长度 8 + 4 + 2 + len([]byte)
func (*MRolePropsSyncClient) String ¶
func (msg *MRolePropsSyncClient) String() string
func (*MRolePropsSyncClient) Unmarshal ¶
func (msg *MRolePropsSyncClient) Unmarshal(data []byte) error
Unmarshal 反序列化
type MsgDef ¶
type MsgDef struct {
// contains filtered or unexported fields
}
MsgDef 消息定义管理器,包含是消息与消息号的映射结构,客户端初始化的时候,由服务器下发下去
func (*MsgDef) GetMsgIDByName ¶
GetMsgIDByName 通过名字获取ID号
func (*MsgDef) GetMsgInfo ¶
GetMsgInfo 根据消息号,获得消息的类型,名称,如果是protobuf消息,获得proto消息的容器
type NewRealNotify ¶
NewRealNotify 通知有新的real出现
func (*NewRealNotify) MarshalTo ¶
func (msg *NewRealNotify) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*NewRealNotify) String ¶
func (msg *NewRealNotify) String() string
func (*NewRealNotify) Unmarshal ¶
func (msg *NewRealNotify) Unmarshal(data []byte) error
Unmarshal 反序列化
type PropsSyncClient ¶
PropsSyncClient 玩家属性变化,客户端关注的属性变化都由该消息发出
func (*PropsSyncClient) MarshalTo ¶
func (msg *PropsSyncClient) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*PropsSyncClient) Size ¶
func (msg *PropsSyncClient) Size() (n int)
Size 获取长度 8 + 4 + 2 + len([]byte)
func (*PropsSyncClient) String ¶
func (msg *PropsSyncClient) String() string
func (*PropsSyncClient) Unmarshal ¶
func (msg *PropsSyncClient) Unmarshal(data []byte) error
Unmarshal 反序列化
type ProtoSync ¶
type ProtoSync struct {
Data []byte
}
ProtoSync 同步Proto消息号和名字
type RPCMsg ¶
type RPCMsg struct { ServerType uint8 SrcEntityID uint64 MethodName string Data []byte //proto消息参数 }
RPCMsg 分布式实体之间调用方法
type RequireFramesMsg ¶
type RequireFramesMsg struct {
FrameID uint16
}
RequireFramesMsg 客户端请求重传帧的消息
func (*RequireFramesMsg) MarshalTo ¶
func (msg *RequireFramesMsg) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*RequireFramesMsg) Name ¶
func (msg *RequireFramesMsg) Name() string
func (*RequireFramesMsg) Unmarshal ¶
func (msg *RequireFramesMsg) Unmarshal(data []byte) error
Unmarshal 反序列化
type ServerFrameMsg ¶
type ServerFrameMsg struct { FrameID uint16 Msgs []ClientFrameMsgData }
ServerFrameMsg 服务器下发的帧消息
func (*ServerFrameMsg) MarshalTo ¶
func (msg *ServerFrameMsg) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*ServerFrameMsg) Name ¶
func (msg *ServerFrameMsg) Name() string
func (*ServerFrameMsg) Unmarshal ¶
func (msg *ServerFrameMsg) Unmarshal(data []byte) error
Unmarshal 反序列化
type SpaceUserConnect ¶
SpaceUserConnect 空间玩家专用连接成功,由客户端发给服务器
func (*SpaceUserConnect) MarshalTo ¶
func (msg *SpaceUserConnect) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*SpaceUserConnect) String ¶
func (msg *SpaceUserConnect) String() string
func (*SpaceUserConnect) Unmarshal ¶
func (msg *SpaceUserConnect) Unmarshal(data []byte) error
Unmarshal 反序列化
type SpaceUserConnectSucceedRet ¶
type SpaceUserConnectSucceedRet struct { }
SpaceUserConnectSucceedRet 空间玩家专用连接成功
func (*SpaceUserConnectSucceedRet) MarshalTo ¶
func (msg *SpaceUserConnectSucceedRet) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*SpaceUserConnectSucceedRet) Name ¶
func (msg *SpaceUserConnectSucceedRet) Name() string
Name 获取消息名称
func (*SpaceUserConnectSucceedRet) Size ¶
func (msg *SpaceUserConnectSucceedRet) Size() (n int)
Size 获取长度
func (*SpaceUserConnectSucceedRet) String ¶
func (msg *SpaceUserConnectSucceedRet) String() string
func (*SpaceUserConnectSucceedRet) Unmarshal ¶
func (msg *SpaceUserConnectSucceedRet) Unmarshal(data []byte) error
Unmarshal 反序列化
type SrvMsgTransport ¶
SrvMsgTransport 分布式实体之间传递消息用
func (*SrvMsgTransport) MarshalTo ¶
func (msg *SrvMsgTransport) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*SrvMsgTransport) Size ¶
func (msg *SrvMsgTransport) Size() (n int)
Size 获取长度 8 + 2 + len([]byte)
func (*SrvMsgTransport) String ¶
func (msg *SrvMsgTransport) String() string
func (*SrvMsgTransport) Unmarshal ¶
func (msg *SrvMsgTransport) Unmarshal(data []byte) error
Unmarshal 反序列化
type SyncClock ¶
type SyncClock struct {
TimeStamp uint32
}
SyncClock 对时
type SyncUserState ¶
SyncUserState 同步信息
func (*SyncUserState) MarshalTo ¶
func (msg *SyncUserState) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*SyncUserState) String ¶
func (msg *SyncUserState) String() string
func (*SyncUserState) Unmarshal ¶
func (msg *SyncUserState) Unmarshal(data []byte) error
Unmarshal 反序列化
type TestBinMsg ¶
type TestBinMsg struct {
State uint32
}
TestBinMsg 会话状态通知, 交给业务层处理
func (*TestBinMsg) MarshalTo ¶
func (msg *TestBinMsg) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*TestBinMsg) String ¶
func (msg *TestBinMsg) String() string
type TransferRealReq ¶
type TransferRealReq struct { EntityID uint64 PropNum uint32 Props []byte Pos linmath.Vector3 RealServerID uint64 GhostNum uint32 GhostData []byte }
TransferRealReq 把real转移至新的cell
func (*TransferRealReq) MarshalTo ¶
func (msg *TransferRealReq) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*TransferRealReq) String ¶
func (msg *TransferRealReq) String() string
func (*TransferRealReq) Unmarshal ¶
func (msg *TransferRealReq) Unmarshal(data []byte) error
Unmarshal 反序列化
type UserDuplicateLoginNotify ¶
type UserDuplicateLoginNotify struct { }
UserDuplicateLoginNotify 玩家重复登录通知
func (*UserDuplicateLoginNotify) MarshalTo ¶
func (msg *UserDuplicateLoginNotify) MarshalTo(data []byte) (n int, err error)
MarshalTo 序列化
func (*UserDuplicateLoginNotify) Size ¶
func (msg *UserDuplicateLoginNotify) Size() (n int)
Size 获取长度
func (*UserDuplicateLoginNotify) String ¶
func (msg *UserDuplicateLoginNotify) String() string
func (*UserDuplicateLoginNotify) Unmarshal ¶
func (msg *UserDuplicateLoginNotify) Unmarshal(data []byte) error
Unmarshal 反序列化