class

MCPing::Request

Inherits Reference < Object

The request class is used internally by both the ping and query functions.

It likely does not have anything terribly interesting for external use.

Constants

PROTOCOL_VERSION = 71_u8

Instance methods

createHandshake(host : String, port : UInt32)

Creates a handshake packet.

Requires the server host and port for creating a correct packet.

Source
createPacket(pl : Bytes)

Finalizes a packet to be sent.

It adds the size of the bytes as a uvarint to the beginning then appends the provided bytes.

Source
createStatusRequest

Makes the packet for a status request. It's a very simple packet.

Source
readStatus(conn : TCPSocket)

Reads the ping response data from the socket.

Source
readVarInt(conn : TCPSocket)

Reads a varint from a TCPSocket.

Source
readVarInt(by : Array(UInt8))

Reads a varint from an UInt8 Array.

Source