Documentation
¶
Overview ¶
Package query asks running game servers who is on them, the way their own server lists do.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MinecraftStatus ¶
type MinecraftStatus struct {
// Raw is the JSON the server sent.
Raw string
Version string
Online int
Max int
}
MinecraftStatus is what a Java Edition server answers to a server list ping.
func Minecraft ¶
func Minecraft(ctx context.Context, addr string) (MinecraftStatus, error)
Minecraft asks the server at addr, a host and port, for its status with the Server List Ping: a handshake with next state 1, then a status request. Every packet is its length and its body, and numbers in them are VarInts.
Click to show internal directories.
Click to hide internal directories.