summaryrefslogtreecommitdiff
path: root/packets/login_server/login_server_login_success_packet.gd
diff options
context:
space:
mode:
Diffstat (limited to 'packets/login_server/login_server_login_success_packet.gd')
-rw-r--r--packets/login_server/login_server_login_success_packet.gd59
1 files changed, 59 insertions, 0 deletions
diff --git a/packets/login_server/login_server_login_success_packet.gd b/packets/login_server/login_server_login_success_packet.gd
new file mode 100644
index 0000000..ce6a058
--- /dev/null
+++ b/packets/login_server/login_server_login_success_packet.gd
@@ -0,0 +1,59 @@
+class_name LoginServerLoginSuccessPacket
+extends Packet
+
+
+const HEADER := 0x0ac4
+const BYTE_LENGTH := 0
+
+
+## Byte Type: u16
+## Byte Length: 2
+var packet_length: int
+
+## 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[CharacterServerInformation]
+
+
+static func from_bytes(bytes: PackedByteArray):
+ var packet = LoginServerLoginSuccessPacket.new()
+
+ packet.packet_length = bytes.decode_u16(2)
+ packet.login_id1 = bytes.decode_u32(4)
+ packet.account_id = bytes.decode_u32(8)
+ packet.login_id2 = bytes.decode_u32(12)
+ packet.ip_address = bytes.slice(16, 20)
+ packet.last_login = bytes.slice(20, 20 + 26)
+ packet.gender = bytes[46]
+ packet.auth_token = bytes.slice(47, 47 + 17).get_string_from_utf8()
+ packet.character_server_information = CharacterServerInformation.array_from_bytes(bytes.slice(64))
+
+ return packet