Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventConnect = iota EventDisconnect )
Variables ¶
This section is empty.
Functions ¶
func EncodePayloadToBin ¶
Types ¶
type GateTcpMqEvent ¶
type GateTcpMqEvent struct {
// contains filtered or unexported fields
}
type GateTcpMqInst ¶
type GateTcpMqInst struct {
// contains filtered or unexported fields
}
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
func NewMessageQueue ¶
func NewMessageQueue(serverType spb.ServerType, appId uint32, discoveryClient *rpc.NodeDiscoveryClient, gateAddr, regionName string) (r *MessageQueue)
func (*MessageQueue) Close ¶
func (m *MessageQueue) Close()
func (*MessageQueue) GetGateTcpMqInst ¶
func (m *MessageQueue) GetGateTcpMqInst(serverType spb.ServerType, appId uint32) *GateTcpMqInst
func (*MessageQueue) GetNetMsg ¶
func (m *MessageQueue) GetNetMsg() chan *NetMsg
func (*MessageQueue) SendToGame ¶
func (m *MessageQueue) SendToGame(appid uint32, msg *NetMsg)
func (*MessageQueue) SendToGate ¶
func (m *MessageQueue) SendToGate(appid uint32, msg *NetMsg)
type NetMsg ¶
type NetMsg struct { // len 4 ServerType spb.ServerType // 目标 // 4 AppId uint32 // 目标 // 4 OriginServerType spb.ServerType // 源 // 4 OriginServerAppId uint32 // 源 // 4 MsgType MsgType // 消息类型 // 1 Uid uint32 // 玩家id // 4 CmdId uint16 // cmd id // 2 ServiceMsgByte []byte // 消息 }
func DecodeBinToPayload ¶
Click to show internal directories.
Click to hide internal directories.