Documentation ¶
Index ¶
- func AnswerUDP(Packet *codec.Packet, writer func(*bytes.Buffer) error) error
- type Client
- func (client *Client) Answer(Packet *codec.Packet) error
- func (c *Client) Close()
- func (c *Client) FireClientClose(event ClientEvent) SocketEvent
- func (c *Client) FireClientCommand(event ClientEvent) SocketEvent
- func (c *Client) FireClientData(event ClientEvent) SocketEvent
- func (c *Client) FireClose() ClientEvent
- func (c *Client) FireError(err error) ClientEvent
- func (c *Client) FireSomething(event ClientEvent) SocketEvent
- func (c *Client) Key() ClientKey
- func (client *Client) SendPacket(pkt []byte) error
- type ClientEvent
- type ClientKey
- type ClientOptions
- type ClientState
- type Clients
- type EvProcess
- type EventClientClose
- type EventClientCommand
- type EventClientData
- type EventClientError
- type EventError
- type EventNewClient
- type ProcessFESL
- type RawPacket
- type Socket
- type SocketEvent
- type SocketUDP
- type SocketUDPEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { IsActive bool HashState *level.State IpAddr net.Addr State ClientState Options ClientOptions // contains filtered or unexported fields }
func (*Client) FireClientClose ¶
func (c *Client) FireClientClose(event ClientEvent) SocketEvent
func (*Client) FireClientCommand ¶
func (c *Client) FireClientCommand(event ClientEvent) SocketEvent
func (*Client) FireClientData ¶
func (c *Client) FireClientData(event ClientEvent) SocketEvent
func (*Client) FireClose ¶
func (c *Client) FireClose() ClientEvent
func (*Client) FireError ¶
func (c *Client) FireError(err error) ClientEvent
func (*Client) FireSomething ¶
func (c *Client) FireSomething(event ClientEvent) SocketEvent
func (*Client) SendPacket ¶
type ClientEvent ¶
type ClientEvent struct { Name string Data interface{} }
ClientEvent is the generic struct for events
type ClientOptions ¶
type ClientOptions struct {
FESL bool
}
type ClientState ¶
type EvProcess ¶
type EvProcess struct { Client *Client Process *ProcessFESL // If TLS (theater then we ignore HEX - it is always 0x0) }
type EventClientClose ¶
type EventClientClose struct {
Client *Client
}
type EventClientCommand ¶
type EventClientData ¶
type EventClientError ¶
type EventError ¶
type EventError struct {
Error error
}
type EventNewClient ¶
type EventNewClient struct {
Client *Client
}
type Socket ¶
type Socket struct { Clients *Clients EventChan chan SocketEvent // contains filtered or unexported fields }
Socket is a basic event-based TCP-Server
func NewSocketTCP ¶
New starts to listen on a new Socket
func NewSocketTLS ¶
func (*Socket) FireClose ¶
func (s *Socket) FireClose() SocketEvent
func (*Socket) FireError ¶
func (s *Socket) FireError(err error) SocketEvent
func (*Socket) FireNewClient ¶
func (s *Socket) FireNewClient(client *Client) SocketEvent
type SocketEvent ¶
type SocketEvent struct { Name string Data interface{} }
type SocketUDP ¶
type SocketUDP struct { Clients []*Client EventChan chan SocketUDPEvent // contains filtered or unexported fields }
Socket is a basic event-based TCP-Server
func NewSocketUDP ¶
New starts to listen on a new Socket
type SocketUDPEvent ¶
Click to show internal directories.
Click to hide internal directories.