Documentation ¶
Index ¶
- Variables
- func BF2Random(randomLen int, source rand.Source) string
- func BF2RandomUnsafe(randomLen int) string
- func DecodePassword(pass string) (string, error)
- func Hash(text string) string
- func Inet_aton(ip net.IP) int64
- func Inet_ntoa(ipnr int64) net.IP
- func ProcessFESL(data string) map[string]string
- func SerializeFESL(data map[string]string) string
- func ShortHash(str string) string
- type Client
- func (client *Client) Close()
- func (client *Client) New(name string, conn *net.Conn) (chan ClientEvent, error)
- func (client *Client) Write(command string) error
- func (client *Client) WriteError(code string, message string) error
- func (client *Client) WriteFESL(msgType string, msg map[string]string, msgType2 uint32) error
- type ClientEvent
- type ClientState
- type ClientTLS
- type ClientTLSEvent
- type ClientTLSState
- type Command
- type CommandFESL
- type EventClientClose
- type EventClientCommand
- type EventClientData
- type EventClientError
- type EventClientFESLCommand
- type EventClientTLSClose
- type EventClientTLSCommand
- type EventClientTLSData
- type EventClientTLSError
- type EventError
- type EventNewClient
- type EventNewClientTLS
- type Socket
- type SocketEvent
- type SocketTLS
- type SocketUDP
- func (socket *SocketUDP) Close()
- func (socket *SocketUDP) New(name string, port string, fesl bool) (chan SocketUDPEvent, error)
- func (socket *SocketUDP) Write(message string, addr *net.UDPAddr)
- func (socket *SocketUDP) WriteFESL(msgType string, msg map[string]string, msgType2 uint32, addr *net.UDPAddr) error
- func (socket *SocketUDP) XOr(a []byte) []byte
- type SocketUDPEvent
Constants ¶
This section is empty.
Variables ¶
var CrcLookup = []rune{}/* 256 elements not displayed */
CrcLookup table "for some sort of hashing thing what was this"
Functions ¶
func BF2Random ¶
BF2Random generates a random string with valid BF2 random chars https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-golang/31832326
func BF2RandomUnsafe ¶
BF2RandomUnsafe is a not thread-safe version of BF2Random For thread-safety you should use BF2Random with your own seed
func DecodePassword ¶
DecodePassword decodes gamespy's base64 string used for passwords to a cleantext string
func ProcessFESL ¶
func SerializeFESL ¶
Types ¶
type Client ¶
type Client struct { IsActive bool RedisState *core.RedisState IpAddr net.Addr State ClientState FESL bool // contains filtered or unexported fields }
func (*Client) WriteError ¶
WriteError Handy for informing the user they're a piece of shit.
type ClientEvent ¶
type ClientEvent struct { Name string Data interface{} }
ClientEvent is the generic struct for events by this Client
type ClientState ¶
type ClientState struct { GameName string ServerChallenge string ClientChallenge string ClientResponse string BattlelogID int Username string PlyName string PlyEmail string PlyCountry string PlyPid int Sessionkey int Confirmed bool Banned bool IpAddress net.Addr HasLogin bool ProfileSent bool LoggedOut bool HeartTicker *time.Ticker }
type ClientTLS ¶
type ClientTLS struct { IsActive bool IpAddr net.Addr RedisState *core.RedisState State ClientTLSState FESL bool // contains filtered or unexported fields }
type ClientTLSEvent ¶
type ClientTLSEvent struct { Name string Data interface{} }
ClientTLSEvent is the generic struct for events by this ClientTLS
type ClientTLSState ¶
type ClientTLSState struct { GameName string ServerChallenge string ClientTLSChallenge string ClientTLSResponse string BattlelogID int Username string PlyName string PlyEmail string PlyCountry string PlyPid int Sessionkey int Confirmed bool Banned bool IpAddress net.Addr HasLogin bool ProfileSent bool LoggedOut bool HeartTicker *time.Ticker }
type Command ¶
Command struct
func ProcessCommand ¶
ProcessCommand turns gamespy's command string to the command struct
type CommandFESL ¶
type EventClientClose ¶
type EventClientClose struct {
Client *Client
}
type EventClientCommand ¶
type EventClientData ¶
type EventClientError ¶
type EventClientFESLCommand ¶
type EventClientFESLCommand struct { Client *Client Command *CommandFESL }
type EventClientTLSClose ¶
type EventClientTLSClose struct {
Client *ClientTLS
}
type EventClientTLSCommand ¶
type EventClientTLSCommand struct { Client *ClientTLS Command *CommandFESL }
type EventClientTLSData ¶
type EventClientTLSError ¶
type EventError ¶
type EventError struct {
Error error
}
type EventNewClient ¶
type EventNewClient struct {
Client *Client
}
type EventNewClientTLS ¶
type EventNewClientTLS struct {
Client *ClientTLS
}
type Socket ¶
type Socket struct { Clients []*Client // contains filtered or unexported fields }
Socket is a basic event-based TCP-Server
type SocketEvent ¶
type SocketEvent struct { Name string Data interface{} }
SocketEvent is the generic struct for events by this socket
Current events:
Name -> Data-Type close -> nil error -> error newClient -> *Client client.close -> [0: *client, 1:nil] client.error -> [0: *client, error] client.command -> [0: *client, *Command] client.command.* -> [0: *client, *Command] client.data -> [0: *client, string]
type SocketTLS ¶
type SocketTLS struct { ClientsTLS []*ClientTLS // contains filtered or unexported fields }
Socket is a basic event-based TCP-Server
type SocketUDP ¶
type SocketUDP struct { Clients []*Client // contains filtered or unexported fields }
Socket is a basic event-based TCP-Server
func (*SocketUDP) Close ¶
func (socket *SocketUDP) Close()
Close fires a close-event and closes the socket