Correctly handle the file size when sending a quest.

This commit is contained in:
Loïc Hoguin 2010-05-19 19:27:22 +02:00
parent b579a5bbc3
commit db3423e208

View File

@ -336,7 +336,8 @@ send_player_card(CSocket, GID, Char) ->
send_quest(CSocket, Filename) ->
{ok, File} = file:read_file(Filename),
Packet = << 16#020e:16, 0:304, 16#00200000:32/unsigned-integer, 16#2032674b:32/unsigned-integer, File/binary >>,
Size = byte_size(File),
Packet = << 16#020e:16, 0:304, Size:32/little-unsigned-integer, 16#2032674b:32/unsigned-integer, File/binary >>,
packet_send(CSocket, Packet).
%% @doc Send the list of available universes.