types

package
v0.0.0-...-fc43c76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppTheShip AppId = 2400

	GoldSource SourceEngine = iota + 1
	Source
)
View Source
const (
	GoldSourceInfoResponseType = 0x6D
	SourceInfoResponseType     = 0x49
)

Official versions of the A2S_INFO reply.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppId

type AppId int32

type Extended

type Extended struct {
	AppId               AppId
	GameVersion         string
	Port                uint16 // 0 if not present.
	SteamId             uint64 // 0 if not present.
	GameModeDescription string // "" if not present.
	GameId              uint64 // 0 if not present.
}

Extended Optional information available with S2A_INFO_SOURCE. This is a grab-bag of various optional bits. If some are not present they are left as 0. In the future this may change to distinguish from being present as 0.

type ModInfo

type ModInfo struct {
	Url         string `json:"url"`
	DownloadUrl string `json:"download_url"`
	Version     uint32 `json:"version"`
	Size        uint32 `json:"size"`
	Type        uint8  `json:"type"`
	Dll         uint8  `json:"dll"`
}

ModInfo Optional mod information returned by S2A_INFO_GOLDSRC.

type Player

type Player struct {
	Index    int    `json:"index"`
	Score    int    `json:"score"`
	Name     string `json:"name"`
	SteamID  string `json:"steam_id"`
	Duration int    `json:"duration"`
}

Player Source server players

type PlayerList

type PlayerList struct {
	Players []*Player `json:"players"`
	Count   int       `json:"count"`
}

type Rules

type Rules []map[string]string

type Server

type Server struct {
	Address    string       `json:"address"`
	Version    SourceEngine `json:"version"`
	Protocol   uint8        `json:"protocol"`
	Name       string       `json:"name"`
	Map        string       `json:"map"`
	Folder     string       `json:"folder"`
	Game       string       `json:"game"`
	Players    uint8        `json:"players"`
	MaxPlayers uint8        `json:"max_players"`
	Bots       uint8        `json:"bots"`
	Type       ServerType   `json:"type"`
	OS         ServerOs     `json:"os"`
	Visibility uint8        `json:"visibility"`
	Vac        uint8        `json:"vac"`
	Mod        *ModInfo     `json:"mod"`
	TheShip    *TheShip     `json:"ship"`
	SourceTV   *SourceTV    `json:"source_tv"`
	Extended   *Extended    `json:"extended"`
}

Server Information returned by an A2S_INFO query. Most of this is returned as-is from the wire, except where otherwise noted.

func (*Server) Engine

func (s *Server) Engine() SourceEngine

Engine Attempt to guess the game engine version.

type ServerOs

type ServerOs uint8
const (
	ServerOsUnknown ServerOs = iota
	ServerOsLinux            // 1
	ServerOsWindows          // 2
	ServerOsMac              // 3
)

func (ServerOs) String

func (t ServerOs) String() string

type ServerType

type ServerType uint8
const (
	ServerTypeUnknown      ServerType = iota
	ServerTypeDedicated               // 1
	ServerTypeNonDedicated            // 2
	ServerTypeSourceTV                // 3
)

func (ServerType) String

func (t ServerType) String() string

type SourceEngine

type SourceEngine uint8

type SourceTV

type SourceTV struct {
	Port uint16
	Name string
}

SourceTV Optional information available with S2A_INFO_SOURCE.

type TheShip

type TheShip struct {
	Mode      uint8 `json:"mode"`
	Witnesses uint8 `json:"witnesses"`
	Duration  uint8 `json:"duration"`
}

TheShip Optional information returned by App_TheShip.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL