Documentation ¶
Index ¶
- Variables
- func SendVote(host string, port uint16, options VoteOptions) error
- type BasicQueryResponse
- type BedrockStatusOptions
- type BedrockStatusResponse
- type Favicon
- type FormatItem
- type FullQueryResponse
- type JavaStatusLegacyOptions
- type JavaStatusLegacyPlayers
- type JavaStatusLegacyResponse
- type JavaStatusLegacyVersion
- type JavaStatusOptions
- type JavaStatusResponse
- type MOTD
- type QueryOptions
- type RCON
- type RCONOptions
- type SRVRecord
- type VoteOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnexpectedResponse means the server sent an unexpected response to the client ErrUnexpectedResponse = errors.New("received an unexpected response from the server") // ErrVarIntTooBig means the server sent a varint which was beyond the protocol size of a varint ErrVarIntTooBig = errors.New("size of VarInt exceeds maximum data size") // ErrNotConnected means the client attempted to send data but there was no connection to the server ErrNotConnected = errors.New("client attempted to send data but connection is non-existent") // ErrAlreadyLoggedIn means the RCON client was already logged in after a second login attempt was made ErrAlreadyLoggedIn = errors.New("RCON client is already logged in after a second login attempt was made") // ErrInvalidPassword means the password used in the RCON loggin was incorrect ErrInvalidPassword = errors.New("incorrect RCON password") // ErrNotLoggedIn means the client attempted to execute a command before a login was successful ErrNotLoggedIn = errors.New("RCON client attempted to send message before successful login") // ErrDecodeUTF16OddLength means a UTF-16 was attempted to be decoded from a byte array that was an odd length ErrDecodeUTF16OddLength = errors.New("attempted to decode UTF-16 byte array with an odd length") )
Functions ¶
Types ¶
type BasicQueryResponse ¶
type BasicQueryResponse struct { MOTD MOTD GameType string Map string OnlinePlayers uint64 MaxPlayers uint64 HostPort uint16 HostIP string }
func BasicQuery ¶
func BasicQuery(host string, port uint16, options ...QueryOptions) (*BasicQueryResponse, error)
BasicQuery runs a query on the server and returns basic information
type BedrockStatusOptions ¶
type BedrockStatusResponse ¶
type BedrockStatusResponse struct { ServerGUID int64 `json:"server_guid"` Edition string `json:"edition"` MOTD MOTD `json:"motd"` ProtocolVersion int64 `json:"protocol_version"` Version string `json:"version"` OnlinePlayers int64 `json:"online_players"` MaxPlayers int64 `json:"max_players"` ServerID uint64 `json:"server_id"` Gamemode string `json:"gamemode"` GamemodeID int64 `json:"gamemode_id"` PortIPv4 uint16 `json:"port_ipv4"` PortIPv6 uint16 `json:"port_ipv6"` SRVResult *SRVRecord `json:"srv_result"` }
func StatusBedrock ¶
func StatusBedrock(host string, port uint16, options ...BedrockStatusOptions) (*BedrockStatusResponse, error)
StatusBedrock retrieves the status of a Bedrock Minecraft server
type Favicon ¶
type Favicon struct {
// contains filtered or unexported fields
}
Favicon contains helper functions for reading and writing the favicon
func (Favicon) SaveToFile ¶
type FormatItem ¶
type FormatItem struct { Text string `json:"text"` Color string `json:"color"` Obfuscated bool `json:"obfuscated"` Bold bool `json:"bold"` Strikethrough bool `json:"strikethrough"` Underline bool `json:"underline"` Italic bool `json:"italic"` }
FormatItem is a formatting item parsed from the MOTD for easy use
type FullQueryResponse ¶
func FullQuery ¶
func FullQuery(host string, port uint16, options ...QueryOptions) (*FullQueryResponse, error)
FullQuery runs a query on the server and returns the full information
type JavaStatusLegacyOptions ¶
type JavaStatusLegacyPlayers ¶
type JavaStatusLegacyResponse ¶
type JavaStatusLegacyResponse struct { Version *JavaStatusLegacyVersion `json:"version"` Players JavaStatusLegacyPlayers `json:"players"` MOTD MOTD `json:"motd"` SRVResult *SRVRecord `json:"srv_result"` }
func StatusLegacy ¶
func StatusLegacy(host string, port uint16, options ...JavaStatusLegacyOptions) (*JavaStatusLegacyResponse, error)
type JavaStatusLegacyVersion ¶
type JavaStatusOptions ¶
type JavaStatusResponse ¶
type JavaStatusResponse struct { Version struct { Name string `json:"name"` Protocol int `json:"protocol"` } `json:"version"` Players struct { Max int `json:"max"` Online int `json:"online"` Sample []struct { Name string `json:"name"` ID string `json:"id"` } `json:"sample"` } `json:"players"` MOTD MOTD `json:"motd"` Favicon Favicon `json:"favicon"` SRVResult *SRVRecord `json:"srv_result"` }
func Status ¶
func Status(host string, port uint16, options ...JavaStatusOptions) (*JavaStatusResponse, error)
Status retrieves the status of any Minecraft server
type MOTD ¶
type MOTD struct {
Tree []FormatItem `json:"-"`
}
MOTD contains helper functions for reading and writing the MOTD from a server
type QueryOptions ¶
type RCONOptions ¶
Click to show internal directories.
Click to hide internal directories.