Documentation ¶
Index ¶
- type Server
- type TCPConnection
- func (c *TCPConnection) Authenticate()
- func (c *TCPConnection) Close()
- func (c *TCPConnection) GameplayParser(Packet types.TcpPacket)
- func (c *TCPConnection) HandlePassword() bool
- func (c *TCPConnection) Identify()
- func (c *TCPConnection) Kick(msg string)
- func (c *TCPConnection) Listen()
- func (c *TCPConnection) RuntimeLoop() bool
- func (c *TCPConnection) SetState(state types.State)
- func (c *TCPConnection) SyncModData()
- func (c *TCPConnection) Write(data types.TcpPacket)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { types.Service Addr string Port int Listener *net.TCPListener Connections map[string]TCPConnection }
type TCPConnection ¶
type TCPConnection struct { logs.Logger Address string // Connection address Conn net.Conn // Connection Parent *Server // Parent server State types.State // Connection state Player types.Player // Player // contains filtered or unexported fields }
func NewTCPConnection ¶
func NewTCPConnection(conn net.Conn, addr string, parent *Server) TCPConnection
func (*TCPConnection) Authenticate ¶
func (c *TCPConnection) Authenticate()
func (*TCPConnection) Close ¶
func (c *TCPConnection) Close()
func (*TCPConnection) GameplayParser ¶
func (c *TCPConnection) GameplayParser(Packet types.TcpPacket)
func (*TCPConnection) HandlePassword ¶
func (c *TCPConnection) HandlePassword() bool
HandlePassword handles the password authentication TODO: Add password authentication support when that is better understood
func (*TCPConnection) Identify ¶
func (c *TCPConnection) Identify()
func (*TCPConnection) Kick ¶
func (c *TCPConnection) Kick(msg string)
Kick a connection with a given message
func (*TCPConnection) Listen ¶
func (c *TCPConnection) Listen()
func (*TCPConnection) RuntimeLoop ¶
func (c *TCPConnection) RuntimeLoop() bool
Main gamemplay loop for the connection
func (*TCPConnection) SetState ¶
func (c *TCPConnection) SetState(state types.State)
func (*TCPConnection) SyncModData ¶
func (c *TCPConnection) SyncModData()
func (*TCPConnection) Write ¶
func (c *TCPConnection) Write(data types.TcpPacket)
Click to show internal directories.
Click to hide internal directories.