From b8251346b2e87420e4134cc662b9baf3170755bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 3 Jun 2010 19:25:18 +0200 Subject: [PATCH] proto: Send flags just like on the official servers. --- src/egs_proto.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/egs_proto.erl b/src/egs_proto.erl index 96cd759..3e2fdd9 100644 --- a/src/egs_proto.erl +++ b/src/egs_proto.erl @@ -234,11 +234,13 @@ send_chat(CSocket, _, FromGID, FromName, Modifiers, Message) -> packet_send(CSocket, Packet). %% @doc Send the character flags list. +%% Sent without fragmentation on official for unknown reasons. Do the same here. send_flags(CSocket, GID) -> {ok, Flags} = file:read_file("p/flags.bin"), - Packet = << 16#0d05:16, 0:80, GID:32/little-unsigned-integer, 0:96, GID:32/little-unsigned-integer, 0:64, Flags/binary >>, - packet_send(CSocket, Packet). + Packet = << 16#0d050300:32, 0:32, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, Flags/binary >>, + Size = 4 + byte_size(Packet), + ssl:send(CSocket, << Size:32/little-unsigned-integer, Packet/binary >>). %% @doc Send the IP and port of the game server the player is sent to.