summaryrefslogtreecommitdiff
path: root/packets/client/login_server
diff options
context:
space:
mode:
Diffstat (limited to 'packets/client/login_server')
-rw-r--r--packets/client/login_server/login_server_keep_alive_packet.gd22
-rw-r--r--packets/client/login_server/login_server_login_packet.gd41
2 files changed, 63 insertions, 0 deletions
diff --git a/packets/client/login_server/login_server_keep_alive_packet.gd b/packets/client/login_server/login_server_keep_alive_packet.gd
new file mode 100644
index 0000000..db0eedb
--- /dev/null
+++ b/packets/client/login_server/login_server_keep_alive_packet.gd
@@ -0,0 +1,22 @@
+## rAthena References:
+## - CA_CONNECT_INFO_CHANGED ?
+class_name LoginServerKeepAlivePacket
+extends Packet
+
+
+const HEADER := 0x0200
+const BYTE_LENGTH := 26
+
+
+## Byte Type: u8
+## Byte Length: 24
+var user_name: String
+
+
+func to_bytes():
+ var payload = PackedByteArray([])
+
+ payload += user_name.to_utf8_buffer()
+ payload.resize(BYTE_LENGTH - 2)
+
+ return get_header() + payload
diff --git a/packets/client/login_server/login_server_login_packet.gd b/packets/client/login_server/login_server_login_packet.gd
new file mode 100644
index 0000000..0fa117d
--- /dev/null
+++ b/packets/client/login_server/login_server_login_packet.gd
@@ -0,0 +1,41 @@
+class_name LoginServerLoginPacket
+extends Packet
+
+
+const HEADER := 0x064
+const BYTE_LENGTH := 55
+
+
+## Byte Type: u32
+## Byte Length: 4
+var version: int = 0
+
+## Byte Length: 24
+var username: String
+
+## Byte Length: 24
+var password: String
+
+## Byte Type: u8
+## Byte Length: 1
+var client_type: int = 0
+
+
+func to_bytes():
+ var username_bytes = username.to_utf8_buffer()
+ username_bytes.resize(24)
+
+ var password_bytes = password.to_utf8_buffer()
+ password_bytes.resize(24)
+
+ var payload = PackedByteArray([])
+ payload.resize(4)
+ payload.encode_u32(0, version)
+
+ payload.append_array(username_bytes)
+ payload.append_array(password_bytes)
+
+ payload.resize(53)
+ payload.encode_u8(52, client_type)
+
+ return get_header() + payload