Documentation
¶
Index ¶
Constants ¶
const ( //rcon packet type values FailurePacket = int32(-1) CommandPacket = int32(2) AuthPacket = int32(3) //tcp constants Protocol = "tcp" DefaultTimeout = time.Second * 10 PacketRequestSize = 10 //size of headers plus padding bytes, not including Size header per RCon standard PacketHeaderSize = 8 //size of headers not including Size header per RCon standard PacketPaddingSize = 2 //size of padding required after body //request id values ResetID = 1 DefaultCap = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
minecraft remote console client
func NewClient ¶
creates a new remote console client using the supplied address and applys the options before returning. The client is not connected to the server and Connect method must be called before the client can be used to send commands
func (*Client) Close ¶
closes remote console connection, nil's out the connection value in client struct, and resets the request id. The remote console client can be reused by calling the Connect method again
func (*Client) Command ¶
sends a command to the minecraft server and returns the server response, an error is returned if the client has not connected to the server before attempting to send a command. Command examples can be found on the minecraft wiki: https://minecraft.wiki/w/Commands