diff options
Diffstat (limited to 'packets/request_character_list_success_packet.gd')
-rw-r--r-- | packets/request_character_list_success_packet.gd | 19 |
1 files changed, 19 insertions, 0 deletions
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]) |