Versions in this module Expand all Collapse all v1 v1.0.3 May 30, 2022 v1.0.1 May 20, 2021 Changes in this version + const A2S_INFO_REQUEST + const A2S_INFO_RESPONSE + const DefaultMaxPacketSize + func SetMaxPacketSize(size uint32) func(*Client) error v1.0.0 Jul 11, 2019 Changes in this version + const A2S_INFO_HEADER + const A2S_PLAYER_CHALLENGE_REPLY_HEADER + const A2S_PLAYER_REQUEST + const A2S_PLAYER_RESPONSE + const A2S_RULES_REQUEST + const A2S_RULES_RESPONSE + const DefaultPort + const DefaultTimeout + const MULTI_PACKET_RESPONSE_HEADER + const MaxPacketSize + var ErrBadChallengeResponse = errors.New("Bad challenge response") + var ErrBadPacketHeader = errors.New("Packet header mismatch") + var ErrBadPlayerReply = errors.New("Bad player reply") + var ErrBadRulesReply = errors.New("Bad rules reply") + var ErrDuplicatePacket = errors.New("Received same packet of same index") + var ErrMismatchBz2Checksum = errors.New("Bz2 decompressed checksum mismatches") + var ErrNilOption = errors.New("Invalid client option") + var ErrOutOfBounds = errors.New("Read out of bounds") + var ErrPacketOutOfBound = errors.New("Packet out of bound") + var ErrUnsupportedHeader = errors.New("Unsupported protocol header") + var ErrWrongBz2Size = errors.New("Bad bz2 decompression size") + func PreOrangeBox(pre bool) func(*Client) error + func SetAppID(appid int32) func(*Client) error + func TimeoutOption(timeout time.Duration) func(*Client) error + type AppID int32 + const App_TheShip + type Client struct + func NewClient(addr string, options ...func(*Client) error) (c *Client, err error) + func (c *Client) Close() error + func (c *Client) QueryInfo() (*ServerInfo, error) + func (c *Client) QueryPlayer() (*PlayerInfo, error) + func (c *Client) QueryRules() (*RulesInfo, error) + type ExtendedServerInfo struct + GameID uint64 + Keywords string + Port uint16 + SteamID uint64 + type MultiPacketHeader struct + Compressed bool + ID uint32 + Number uint8 + Payload []byte + Size int + SplitSize uint16 + Total uint8 + type PacketBuilder struct + func (b *PacketBuilder) WriteBytes(bytes []byte) + func (b *PacketBuilder) WriteCString(s string) + type PacketReader struct + func NewPacketReader(b []byte) *PacketReader + func (r *PacketReader) CanRead(size int) error + func (r *PacketReader) More() bool + func (r *PacketReader) Pos() int + func (r *PacketReader) ReadFloat32() float32 + func (r *PacketReader) ReadIPv4() (net.IP, error) + func (r *PacketReader) ReadInt32() int32 + func (r *PacketReader) ReadPort() (uint16, error) + func (r *PacketReader) ReadString() string + func (r *PacketReader) ReadUint16() uint16 + func (r *PacketReader) ReadUint32() uint32 + func (r *PacketReader) ReadUint64() uint64 + func (r *PacketReader) ReadUint8() uint8 + func (r *PacketReader) TryReadString() (string, bool) + type Player struct + Duration float32 + Index uint8 + Name string + Score uint32 + TheShip *TheShipPlayer + type PlayerInfo struct + Count uint8 + Players []*Player + type Rule struct + Name string + Value string + type RulesInfo struct + Count uint16 + Rules map[string]string + type ServerInfo struct + Bots uint8 + EDF uint8 + ExtendedServerInfo *ExtendedServerInfo + Folder string + Game string + ID uint16 + Map string + MaxPlayers uint8 + Name string + Players uint8 + Protocol uint8 + ServerOS ServerOS + ServerType ServerType + SourceTV *SourceTVInfo + TheShip *TheShipInfo + VAC bool + Version string + Visibility bool + type ServerOS int + const ServerOS_Linux + const ServerOS_Mac + const ServerOS_Unknown + const ServerOS_Windows + func ParseServerOS(env uint8) ServerOS + func (os ServerOS) String() string + type ServerType int + const ServerType_Dedicated + const ServerType_NonDedicated + const ServerType_SourceTV + const ServerType_Unknown + func ParseServerType(servertype uint8) ServerType + func (t ServerType) String() string + type SourceTVInfo struct + Name string + Port uint16 + type TheShipInfo struct + Duration uint8 + Mode TheShipMode + Witnesses uint8 + type TheShipMode int + const TheShipMode_Deathmatch + const TheShipMode_Duel + const TheShipMode_Elimination + const TheShipMode_Hunt + const TheShipMode_Team_Elimination + const TheShipMode_Unknown + const TheShipMode_VIP_Team + func ParseTheShipMode(m uint8) TheShipMode + func (m TheShipMode) String() string + type TheShipPlayer struct + Deaths uint32 + Money uint32