From c89f25f59aa493d95bcac8e75ca5cdd57a0403e7 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 28 Nov 2024 00:45:30 +0100 Subject: initial commit --- packets/request_character_list_success_packet.gd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packets/request_character_list_success_packet.gd (limited to 'packets/request_character_list_success_packet.gd') diff --git a/packets/request_character_list_success_packet.gd b/packets/request_character_list_success_packet.gd new file mode 100644 index 0000000..0b6cea8 --- /dev/null +++ b/packets/request_character_list_success_packet.gd @@ -0,0 +1,19 @@ +class_name RequestCharacterListSuccessPacket +extends Packet + + +var character_information: Array + + +static func from_bytes(bytes: PackedByteArray): + var packet = RequestCharacterListSuccessPacket.new() + + packet.character_information = CharacterInformation.array_from_bytes(bytes) + + return packet + +static func from_bytes_via_peer(peer: StreamPeer): + var _header = peer.get_data(4) + var remaining_bytes = peer.get_data(peer.get_available_bytes()) + + return from_bytes(remaining_bytes[1]) -- cgit v1.2.3