Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client for interacting with Minecraft servers through the Minecraft protocol.
func NewClient ¶
func NewClient(addr string, opts ...ClientOption) (*Client, error)
NewClient creates a new Client for pinging a Minecraft server at the specified address.
func (*Client) Close ¶ added in v0.2.2
Close safely closes the TCP connection to the Minecraft server.
func (*Client) LoginError ¶
LoginError tries to trigger an exception in the servers packet parser. The error response can be used to fingerprint the server software.
func (*Client) Ping ¶
Ping performs a ping operation to the Minecraft server and returns the latency in milliseconds.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption represents a functional option for configuring a Client instance.
func WithAddress ¶
func WithAddress(addr *address.Address) ClientOption
WithAddress sets a custom address.
func WithConnection ¶
func WithConnection(conn net.Conn) ClientOption
WithConnection set a custom already connected connection.
func WithProtocolVersion ¶
func WithProtocolVersion(protocol int32) ClientOption
WithProtocolVersion sets a custom Minecraft protocol version.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout sets a custom timeout for communication with the server.
func WithoutSRV ¶
func WithoutSRV() ClientOption
WithoutSRV disables SRV record lookups for the client.
Directories
¶
Path | Synopsis |
---|---|
Package address provides utilities for working with Minecraft server addresses.
|
Package address provides utilities for working with Minecraft server addresses. |
Package fingerprint provides functionality to determine a Minecraft Servers software by sending maliciously crafted packets to the server and analyzing the responses.
|
Package fingerprint provides functionality to determine a Minecraft Servers software by sending maliciously crafted packets to the server and analyzing the responses. |
Package packet provides utilities for sending and receiving Minecraft network packets.
|
Package packet provides utilities for sending and receiving Minecraft network packets. |