Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client is a minecraft protocol aware connection somewhat
func (*Client) ReadLoginStart ¶
func (c *Client) ReadLoginStart() (*LoginStart, *pk.Packet, error)
ReadLoginStart reads the login start packet from the client. It returns the parsed packet, the original packet, and an error if one occurred.
This should not be trusted as the client can send any string they want and hasn't been authenticated until later in the login process.
func (*Client) SendDisconnect ¶
SendDisconnect sends a disconnect packet to the client with the provided reason
func (*Client) SendStatus ¶
SendStatus sends status request and ping packets to the client
type ClientState ¶
type ClientState int
ClientState is the state of the client during the handshake process
const ( // ClientStateCheck is when a client is attempting to check the status // of the server ClientStateCheck ClientState = iota + 1 // ClientStatePlayerLogin is the state of the client when trying to login to // the server ClientStatePlayerLogin )
Contains definitions for the ClientState type
type Handshake ¶
type Handshake struct { // Packet is the original packet that was sent, and consumed, by the // proxy. Packet *pk.Packet // ProtocolVersion is the version of the Minecraft protocol the client // is using. ProtocolVersion int32 // ServerAddress is the address of the server the client is trying to // connect to. If there are any NULL characters, they are // automatically stripped as well as all content after them. This is // to handle the case of Forge servers where the server address is // suffixed with \0x00FML3\0x00. ServerAddress string // ServerPort is the port of the server the client is trying to // connect to. ServerPort uint16 // NextState is the next state the client is trying to transition to. NextState int32 }
Handshake is the first packet sent to a Minecraft server.
type LoginStart ¶
type LoginStart struct {
Name string `json:"name"`
}
LoginStart is the packet sent by the client when they're trying to login to the server.
type Status ¶
type Status struct { Version *StatusVersion `json:"version"` Players *StatusPlayers `json:"players"` Description *StatusDescription `json:"description"` Favicon string `json:"favicon"` }
type StatusDescription ¶
type StatusDescription struct {
Text string `json:"text"`
}