Documentation ¶
Index ¶
Constants ¶
View Source
const ( AccessOpen = Access(0) AccessClosed = Access(1) AccessPrivate = Access(2) )
View Source
const ( ClassWarrior = Class(1 << 0) ClassWizard = Class(1 << 1) ClassConjurer = Class(1 << 2) )
View Source
const ( Res640x480 = Resolution(0) Res800x600 = Resolution(1) Res1024x768 = Resolution(2) Res1280x1024 = Resolution(3) )
View Source
const ( MapTypeKOTR = MapType(0x0010) MapTypeCTF = MapType(0x0020) MapTypeFlagBall = MapType(0x0040) MapTypeChat = MapType(0x0080) MapTypeArena = MapType(0x0100) MapTypeElimination = MapType(0x0400) MapTypeCoop = MapType(0x0A00) MapTypeQuest = MapType(0x1000) )
View Source
const (
DefaultAddress = "xwis.net:4000"
)
Variables ¶
View Source
var DebugLog *log.Logger
View Source
var (
ErrClientClosed = errors.New("client closed")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithAddress ¶
func (*Client) HostGame ¶
HostGame registers a game and keeps it online until the context is cancelled. This call blocks for the whole duration of the game.
type GameInfo ¶
type GameInfo struct { Addr string `json:"addr"` Name string `json:"name"` Map string `json:"map"` MapType MapType `json:"map_type"` Access Access `json:"access"` Disallow Class `json:"disallow,omitempty"` Flags GameFlags `json:"flags,omitempty"` Resolution Resolution `json:"resolution"` LimitRes bool `json:"limit_res,omitempty"` Players int `json:"players,omitempty"` MaxPlayers int `json:"max_players,omitempty"` MinPing int `json:"min_ping,omitempty"` MaxPing int `json:"max_ping,omitempty"` FragLimit int `json:"frag_limit,omitempty"` TimeLimit time.Duration `json:"time_limit,omitempty"` Unk1 byte `json:"-"` Unk2 uint16 `json:"-"` Unk3 [28]byte `json:"-"` Unknown []byte `json:"-"` }
func (*GameInfo) MarshalBinary ¶
func (*GameInfo) UnmarshalBinary ¶
type LobbyServer ¶
func ListLobbyServers ¶
func ListLobbyServers(ctx context.Context) ([]LobbyServer, error)
type Resolution ¶
type Resolution int
func (Resolution) MarshalJSON ¶
func (r Resolution) MarshalJSON() ([]byte, error)
func (Resolution) String ¶
func (r Resolution) String() string
func (Resolution) Unknown ¶
func (r Resolution) Unknown() bool
func (*Resolution) UnmarshalJSON ¶
func (r *Resolution) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.