class MCPing::Request
- MCPing::Request
- Reference
- Object
Overview
The request class is used internally by both the ping and query functions.
It likely does not have anything terribly interesting for external use.
Defined in:
mcping/request.crConstant Summary
-
PROTOCOL_VERSION =
71_u8
Instance Method Summary
-
#createHandshake(host : String, port : UInt32)
Creates a handshake packet.
-
#createPacket(pl : Bytes)
Finalizes a packet to be sent.
-
#createStatusRequest
Makes the packet for a status request.
-
#readStatus(conn : TCPSocket)
Reads the ping response data from the socket.
-
#readVarInt(conn : TCPSocket)
Reads a varint from a
TCPSocket
. -
#readVarInt(by : Array(UInt8))
Reads a varint from an UInt8 Array.
Instance Method Detail
def createHandshake(host : String, port : UInt32)
#
Creates a handshake packet.
Requires the server host and port for creating a correct packet.
def 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.