diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-11-28 00:45:30 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-11-28 00:45:30 +0100 |
commit | c89f25f59aa493d95bcac8e75ca5cdd57a0403e7 (patch) | |
tree | e1eb14f3b27ab8bcce68551424fe49a4f7d376af /packets/request_character_list_success_packet.gd |
initial commit
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]) |