summaryrefslogtreecommitdiff
path: root/packets/login_server
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-12-15 14:23:25 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-12-15 14:23:25 +0100
commita14e88ff4d0d87841a44254e2bff1784da6e8b48 (patch)
tree0507cb8117da7943805a6479aef4526edb2db4dd /packets/login_server
parentca4d1945598863d0ce297f4272317e5dd5797f88 (diff)
next commit
Diffstat (limited to 'packets/login_server')
-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