struct Woozy::Packet

Included Modules

Defined in:

protobufs/packet.pb.cr
woozy.cr

Constant Summary

FIELDS = {2 => {name: :client_handshake_packet, pb_type: ClientHandshakePacket, crystal_type: ClientHandshakePacket, cast_type: ClientHandshakePacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 3 => {name: :server_handshake_packet, pb_type: ServerHandshakePacket, crystal_type: ServerHandshakePacket, cast_type: ServerHandshakePacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 4 => {name: :client_disconnect_packet, pb_type: ClientDisconnectPacket, crystal_type: ClientDisconnectPacket, cast_type: ClientDisconnectPacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 5 => {name: :server_disconnect_packet, pb_type: ServerDisconnectPacket, crystal_type: ServerDisconnectPacket, cast_type: ServerDisconnectPacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 6 => {name: :server_broadcast_message_packet, pb_type: ServerBroadcastMessagePacket, crystal_type: ServerBroadcastMessagePacket, cast_type: ServerBroadcastMessagePacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 7 => {name: :client_broadcast_message_packet, pb_type: ClientBroadcastMessagePacket, crystal_type: ClientBroadcastMessagePacket, cast_type: ClientBroadcastMessagePacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 8 => {name: :server_private_message_packet, pb_type: ServerPrivateMessagePacket, crystal_type: ServerPrivateMessagePacket, cast_type: ServerPrivateMessagePacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 9 => {name: :client_private_message_packet, pb_type: ClientPrivateMessagePacket, crystal_type: ClientPrivateMessagePacket, cast_type: ClientPrivateMessagePacket?, native: false, optional: true, repeated: false, default: nil, packed: false}, 1 => {name: :timestamp, pb_type: :double, crystal_type: Float64, cast_type: Float64?, native: true, optional: true, repeated: false, default: nil, packed: false}} of Int32 => HashLiteral(Symbol, ASTNode)
MaxSize = 64

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.from_bytes(bytes : Bytes) : Packet #

[View source]
def self.new(buf : Protobuf::Buffer) #

def self.new(packet : Woozy::ClientHandshakePacket) #

[View source]
def self.new(client_handshake_packet : ClientHandshakePacket | Nil = nil, server_handshake_packet : ServerHandshakePacket | Nil = nil, client_disconnect_packet : ClientDisconnectPacket | Nil = nil, server_disconnect_packet : ServerDisconnectPacket | Nil = nil, server_broadcast_message_packet : ServerBroadcastMessagePacket | Nil = nil, client_broadcast_message_packet : ClientBroadcastMessagePacket | Nil = nil, server_private_message_packet : ServerPrivateMessagePacket | Nil = nil, client_private_message_packet : ClientPrivateMessagePacket | Nil = nil, timestamp : Float64 | Nil = nil) #

def self.new(packet : Woozy::ServerHandshakePacket) #

[View source]
def self.new(packet : Woozy::ClientDisconnectPacket) #

[View source]
def self.new(packet : Woozy::ServerDisconnectPacket) #

[View source]
def self.new(packet : Woozy::ServerBroadcastMessagePacket) #

[View source]
def self.new(packet : Woozy::ClientBroadcastMessagePacket) #

[View source]
def self.new(packet : Woozy::ServerPrivateMessagePacket) #

[View source]
def self.new(packet : Woozy::ClientPrivateMessagePacket) #

[View source]

Class Method Detail

def self.from_protobuf(io) #

Instance Method Detail

def [](key : String) #

def client_broadcast_message_packet : ClientBroadcastMessagePacket | Nil #

def client_broadcast_message_packet=(client_broadcast_message_packet : ClientBroadcastMessagePacket | Nil) #

def client_disconnect_packet : ClientDisconnectPacket | Nil #

def client_disconnect_packet=(client_disconnect_packet : ClientDisconnectPacket | Nil) #

def client_handshake_packet : ClientHandshakePacket | Nil #

def client_handshake_packet=(client_handshake_packet : ClientHandshakePacket | Nil) #

def client_private_message_packet : ClientPrivateMessagePacket | Nil #

def client_private_message_packet=(client_private_message_packet : ClientPrivateMessagePacket | Nil) #

def server_broadcast_message_packet : ServerBroadcastMessagePacket | Nil #

def server_broadcast_message_packet=(server_broadcast_message_packet : ServerBroadcastMessagePacket | Nil) #

def server_disconnect_packet : ServerDisconnectPacket | Nil #

def server_disconnect_packet=(server_disconnect_packet : ServerDisconnectPacket | Nil) #

def server_handshake_packet : ServerHandshakePacket | Nil #

def server_handshake_packet=(server_handshake_packet : ServerHandshakePacket | Nil) #

def server_private_message_packet : ServerPrivateMessagePacket | Nil #

def server_private_message_packet=(server_private_message_packet : ServerPrivateMessagePacket | Nil) #

def timestamp : Float64 | Nil #

def timestamp=(timestamp : Float64 | Nil) #

def to_protobuf(io : IO, embedded = false) #

def to_protobuf #

def to_slice : Bytes #

[View source]