summaryrefslogtreecommitdiff
path: root/packets/request_character_list_success_packet.gd
blob: 431e8ca6fb87e79613405b0ef7a06a60b95251b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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) # 2 = header, 2 = length
	var remaining_bytes = peer.get_data(peer.get_available_bytes())
	
	return from_bytes(remaining_bytes[1])