abstract struct Woozy::Packet

Extended Modules

Direct Known Subclasses

Defined in:

packet.cr

Constant Summary

DefaultSize = 256
HeaderSize = 5
IdToType = {Woozy::ClientHandshakePacket::Id => Woozy::ClientHandshakePacket, Woozy::ServerHandshakePacket::Id => Woozy::ServerHandshakePacket, Woozy::ClientDisconnectPacket::Id => Woozy::ClientDisconnectPacket, Woozy::ServerDisconnectPacket::Id => Woozy::ServerDisconnectPacket, Woozy::ClientBroadcastMessagePacket::Id => Woozy::ClientBroadcastMessagePacket, Woozy::ServerBroadcastMessagePacket::Id => Woozy::ServerBroadcastMessagePacket, Woozy::ClientPrivateMessagePacket::Id => Woozy::ClientPrivateMessagePacket, Woozy::ServerPrivateMessagePacket::Id => Woozy::ServerPrivateMessagePacket, Woozy::ServerPrivateMessageSuccessPacket::Id => Woozy::ServerPrivateMessageSuccessPacket, Woozy::ClientChunkPacket::Id => Woozy::ClientChunkPacket, Woozy::ServerChunkPacket::Id => Woozy::ServerChunkPacket} of UInt8 => Woozy::Packet.class

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Class Method Detail

def self.from_id(id : UInt8, bytes : Bytes) : Packet | Nil #

[View source]
def self.header_from_bytes(bytes : Bytes) : Tuple(UInt8, Int32) #

[View source]

Instance Method Detail

def initialize #

[View source]
abstract def size : Int32 #

[View source]
def to_slice : Bytes #

[View source]
abstract def write(bytes : Bytes) #

[View source]