Documentation ¶
Index ¶
- Variables
- func SendVote(host string, port uint16, options VoteOptions) error
- type BasicQueryResponse
- type BedrockStatusOptions
- type BedrockStatusResponse
- type Description
- type Favicon
- type FormatItem
- type FullQueryResponse
- type JavaStatusOptions
- type JavaStatusResponse
- 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") )
Functions ¶
Types ¶
type BasicQueryResponse ¶
type BasicQueryResponse struct { MOTD Description 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 ¶ added in v1.2.0
type BedrockStatusResponse ¶ added in v1.2.0
type BedrockStatusResponse struct { ServerGUID int64 `json:"server_guid"` Edition string `json:"edition"` MOTDLine1 Description `json:"motd_line_1"` MOTDLine2 Description `json:"motd_line_2"` 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 ¶ added in v1.2.0
func StatusBedrock(host string, port uint16, options ...BedrockStatusOptions) (*BedrockStatusResponse, error)
StatusBedrock retrieves the status of a Bedrock Minecraft server
type Description ¶
type Description struct {
Tree []FormatItem `json:"tree"`
}
Description contains helper functions for reading and writing the description
func (Description) Clean ¶ added in v1.2.0
func (d Description) Clean() string
Clean returns the description with no formatting
func (Description) HTML ¶
func (d Description) HTML() string
HTML returns the description with HTML formatting
func (Description) Raw ¶
func (d Description) Raw() string
Raw returns the raw description with formatting
func (Description) String ¶
func (d Description) String() string
String returns the description with formatting
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 ¶ added in v1.3.1
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 description 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 JavaStatusOptions ¶ added in v1.2.0
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"` Description Description `json:"description"` 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 QueryOptions ¶
type RCONOptions ¶
Click to show internal directories.
Click to hide internal directories.