client

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

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 Message

type Message = proto.Message

type MessageHandlerFunc

type MessageHandlerFunc func(client *ChanneldClient, channelId uint32, m Message)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL