Documentation ¶
Index ¶
- type ChanneldClient
- func (client *ChanneldClient) AddMessageHandler(msgType uint32, handlers ...MessageHandlerFunc) error
- func (client *ChanneldClient) Auth(lt string, pit string)
- func (client *ChanneldClient) Disconnect() error
- func (client *ChanneldClient) IsConnected() bool
- func (client *ChanneldClient) Receive() error
- func (client *ChanneldClient) Send(channelId uint32, broadcast channeldpb.BroadcastType, msgType uint32, ...) error
- func (client *ChanneldClient) SendRaw(channelId uint32, broadcast channeldpb.BroadcastType, msgType uint32, ...) error
- func (client *ChanneldClient) SetMessageEntry(msgType uint32, msgTemplate Message, handlers ...MessageHandlerFunc)
- func (client *ChanneldClient) Tick() error
- type Message
- type MessageHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanneldClient ¶
type ChanneldClient struct { Id uint32 CompressionType channeldpb.CompressionType SubscribedChannels map[uint32]struct{} CreatedChannels map[uint32]struct{} ListedChannels map[uint32]struct{} Conn net.Conn // contains filtered or unexported fields }
Go library for writing game client/server that interations with channeld.
func NewClient ¶
func NewClient(addr string) (*ChanneldClient, error)
func (*ChanneldClient) AddMessageHandler ¶
func (client *ChanneldClient) AddMessageHandler(msgType uint32, handlers ...MessageHandlerFunc) error
func (*ChanneldClient) Auth ¶
func (client *ChanneldClient) Auth(lt string, pit string)
func (*ChanneldClient) Disconnect ¶
func (client *ChanneldClient) Disconnect() error
func (*ChanneldClient) IsConnected ¶
func (client *ChanneldClient) IsConnected() bool
func (*ChanneldClient) Receive ¶
func (client *ChanneldClient) Receive() error
func (*ChanneldClient) Send ¶
func (client *ChanneldClient) Send(channelId uint32, broadcast channeldpb.BroadcastType, msgType uint32, msg Message, callback MessageHandlerFunc) error
func (*ChanneldClient) SendRaw ¶
func (client *ChanneldClient) SendRaw(channelId uint32, broadcast channeldpb.BroadcastType, msgType uint32, msgBody *[]byte, callback MessageHandlerFunc) error
func (*ChanneldClient) SetMessageEntry ¶
func (client *ChanneldClient) SetMessageEntry(msgType uint32, msgTemplate Message, handlers ...MessageHandlerFunc)
func (*ChanneldClient) Tick ¶
func (client *ChanneldClient) Tick() error
type MessageHandlerFunc ¶
type MessageHandlerFunc func(client *ChanneldClient, channelId uint32, m Message)
Click to show internal directories.
Click to hide internal directories.