class_name LoginServerLoginSuccessPacket extends Packet static var header := 0x0ac4 ## Byte Type: u32 ## Byte Length: 4 var login_id1: int ## Byte Type: u32 ## Byte Length: 4 var account_id: int ## Byte Type: u32 ## Byte Length: 4 var login_id2: int ## Deprecated and always 0 on rAthena ## Byte Type: u32 ## Byte Length: 4 var ip_address: PackedByteArray ## Deprecated and always 0 on rAthena ## Byte Type: u8 ## Byte Length: 26 var last_login: PackedByteArray ## Byte Type: u8 ## Byte Length: 1 var gender: Constants.Gender ## Byte Type: u8 ## Byte Length: 17 var auth_token: String var character_server_information: Array static func from_bytes(bytes: PackedByteArray): var packet = LoginServerLoginSuccessPacket.new() packet.login_id1 = bytes.decode_u32(0) packet.account_id = bytes.decode_u32(4) packet.login_id2 = bytes.decode_u32(8) packet.ip_address = bytes.slice(12, 16) packet.last_login = bytes.slice(16, 16 + 26) packet.gender = bytes[42] packet.auth_token = bytes.slice(43, 43 + 17).get_string_from_utf8() packet.character_server_information = CharacterServerInformation.array_from_bytes(bytes.slice(60)) return packet static func from_bytes_via_peer(peer: StreamPeer): var _header = peer.get_data(4) # 2 = header, 2 = packet_size var remaining_bytes = peer.get_data(peer.get_available_bytes()) return from_bytes(remaining_bytes[1])