game: Channel must not be changed when broadcasting.

This commit is contained in:
Loïc Hoguin 2010-05-26 11:27:51 +02:00
parent 5fc0bf0741
commit 32f4a0b987

View File

@ -309,8 +309,8 @@ loop(CSocket, GID, Version) ->
loop(CSocket, GID, Version, SoFar) ->
receive
{psu_broadcast, Packet} ->
<< A:16/bits, _:8, B:40/bits, _:32, C:96/bits, _:64, D/bits >> = Packet,
Broadcast = << A/binary, 3, B/binary, 16#00011300:32, C/binary, 16#00011300:32, GID:32/little-unsigned-integer, D/binary >>,
<< A:64/bits, _:32, B:96/bits, _:64, C/bits >> = Packet,
Broadcast = << A/binary, 16#00011300:32, B/binary, 16#00011300:32, GID:32/little-unsigned-integer, C/binary >>,
egs_proto:packet_send(CSocket, Broadcast),
?MODULE:loop(CSocket, GID, Version, SoFar);
{psu_chat, ChatGID, ChatName, ChatModifiers, ChatMessage} ->
@ -363,7 +363,7 @@ dispatch(CSocket, GID, Version, Packet) ->
broadcast(16#0503, GID, Packet) ->
LID = 0, % TODO: handle the LID correctly
<< 100:32/little-unsigned-integer, 16#050301:24/unsigned-integer, _:40, 0:32, GID:32/little-unsigned-integer, 0:192,
GID:32/little-unsigned-integer, LID:32/little-unsigned-integer, Direction:32/bits, _:96, Coords:96/bits,
GID:32/little-unsigned-integer, LID:32/little-unsigned-integer, Direction:32/bits, Coords:96/bits, _:96,
Quest:32/little-unsigned-integer, MapType:32/little-unsigned-integer, MapNumber:32/little-unsigned-integer, MapEntry:32/little-unsigned-integer,
_:16, 0:16 >> = Packet,
User = egs_db:users_select(GID),