summaryrefslogtreecommitdiff
path: root/packets/map_server_login_success_packet.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-11-29 21:54:32 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-11-29 21:54:32 +0100
commit313afffce7a823c30acf4853b083f9ca5132e879 (patch)
tree5a7370392ebd39314612166b35e6f53e67441c0b /packets/map_server_login_success_packet.gd
parente8aa9f50886b66d525307a58d71036e6fd3d4aa1 (diff)
next commit
Diffstat (limited to 'packets/map_server_login_success_packet.gd')
-rw-r--r--packets/map_server_login_success_packet.gd18
1 files changed, 6 insertions, 12 deletions
diff --git a/packets/map_server_login_success_packet.gd b/packets/map_server_login_success_packet.gd
index 9eecc65..1791a85 100644
--- a/packets/map_server_login_success_packet.gd
+++ b/packets/map_server_login_success_packet.gd
@@ -2,7 +2,8 @@ class_name MapServerLoginSuccessPacket
extends Packet
-static var header := 0x02eb
+const HEADER := 0x02eb
+const BYTE_LENGTH := 0
## Byte Type: u32
@@ -33,16 +34,9 @@ func get_position():
static func from_bytes(bytes: PackedByteArray):
var packet = MapServerLoginSuccessPacket.new()
- packet.client_tick = bytes.decode_u32(0)
- packet.position = bytes.slice(4, 4 + 3)
- packet.ignored = bytes.slice(7, 7 + 2)
- packet.font = bytes.decode_u32(9)
+ packet.client_tick = bytes.decode_u32(2)
+ packet.position = bytes.slice(6, 6 + 3)
+ packet.ignored = bytes.slice(9, 9 + 2)
+ packet.font = bytes.decode_u32(11)
return packet
-
-
-static func from_bytes_via_peer(peer: StreamPeer):
- var _header = peer.get_data(2)
- var remaining_bytes = peer.get_data(peer.get_available_bytes())
-
- return from_bytes(remaining_bytes[1])