class Rosegold::ProtocolState

Defined in:

rosegold/packets/packet.cr

Constant Summary

CONFIGURATION = ProtocolState.new("CONFIGURATION")
HANDSHAKING = ProtocolState.new("HANDSHAKING")
LOGIN = ProtocolState.new("LOGIN")
PLAY = ProtocolState.new("PLAY")
STATUS = ProtocolState.new("STATUS")

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : String) #

[View source]

Class Method Detail

def self.register(packet : Packet.class) #

[View source]

Instance Method Detail

def clientbound : Hash({UInt8, UInt32}, Rosegold::Clientbound::Packet.class) #

[View source]
def clientbound_for_protocol(protocol : UInt32) : Hash(UInt8, Clientbound::Packet.class) #

Legacy methods for backward compatibility


[View source]
def get_clientbound_packet(packet_id : UInt8, protocol : UInt32) #

Get packet class for specific packet ID and protocol version


[View source]
def get_serverbound_packet(packet_id : UInt8, protocol : UInt32) #

[View source]
def name : String #

[View source]
def register(packet : Clientbound::Packet.class) #

[View source]
def register(packet : Serverbound::Packet.class) #

[View source]
def serverbound : Hash({UInt8, UInt32}, Rosegold::Serverbound::Packet.class) #

[View source]
def serverbound_for_protocol(protocol : UInt32) : Hash(UInt8, Serverbound::Packet.class) #

[View source]