package master_server
Constants
MaxPasswordSize
16
ErrorNone
Error(iota)
ErrorIncorrectPassword
ErrorServerDoesntExist
RequestTypeRegisterServer
MasterServerRequestType(iota)
RequestTypeUnregisterServer
RequestTypePing
RequestTypeServerList
RequestTypeJoinServer
ResponseTypeConfirmRegister
MasterServerResponseType(iota)
ResponseTypeServerList
ResponseTypeJoinServerInfo
ResponseTypeClientJoinInfo
ResponseTypeError
Types
Error
MasterServer
struct
New
MasterServerClient
struct
type MasterServerClient struct {
OnServerList func([]ResponseServerList, uint32)
OnServerJoin func(string)
OnClientJoin func(string)
OnError func(uint8)
// Has unexported fields.
}
MasterServerClient.Connect
MasterServerClient.Disconnect
MasterServerClient.JoinServer
MasterServerClient.ListServers
MasterServerClient.RegisterServer
func (c *MasterServerClient) RegisterServer(game, name string, maxPlayers, currentPlayers uint16) error
MasterServerRequestType
MasterServerResponseType
Request
struct
type Request struct {
Game [gameKeySize]byte
Name [gameNameSize]byte
Password [MaxPasswordSize]byte
ServerId uint64
MaxPlayers uint16
CurrentPlayers uint16
Type MasterServerRequestType
}
DeserializeRequest
Request.Serialize
Response
struct
type Response struct {
Type MasterServerResponseType
List [serversPerResponse]ResponseServerList
Address [addressMaxLen]byte
TotalList uint32
Error uint8
}
DeserializeResponse
Response.Serialize
ResponseServerList
struct
type ResponseServerList struct {
Name [gameNameSize]byte
Id uint64
MaxPlayers uint16
CurrentPlayers uint16
}
ServerListing
struct