From 9aca48a697e0f570381894809bcddb7b5d59e33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 26 Feb 2011 23:14:12 +0100 Subject: [PATCH] psu_proto: Move send_0503 to psu_proto without reviewing it. --- src/egs_game.erl | 2 +- src/psu/psu_game.erl | 10 ---------- src/psu/psu_proto.erl | 11 +++++++++++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/egs_game.erl b/src/egs_game.erl index 65c7d20..17993ad 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -683,7 +683,7 @@ event({object_warp_take, BlockID, ListNb, ObjectNb}, Client=#client{gid=GID}) -> Pos = psu_instance:warp_event(User#users.instancepid, element(2, User#users.area), BlockID, ListNb, ObjectNb), NewUser = User#users{pos=Pos}, egs_users:write(NewUser), - psu_game:send_0503(User#users.pos), + psu_proto:send_0503(User#users.pos, Client), psu_proto:send_1211(16#ffffffff, 0, 14, 0, Client); %% @todo Don't send_0204 if the player is removed from the party while in the lobby I guess. diff --git a/src/psu/psu_game.erl b/src/psu/psu_game.erl index 93c0acd..5cc9458 100644 --- a/src/psu/psu_game.erl +++ b/src/psu/psu_game.erl @@ -164,16 +164,6 @@ send_0113() -> GID = get(gid), send(<< 16#01130300:32, 0:64, GID:32/little, 0:64, 16#00011300:32, GID:32/little, 0:64, GID:32/little, File/binary >>). -%% @todo Force send a new player location. Used for warps. -%% @todo The value before IntDir seems to be the player's current animation. 01 stand up, 08 ?, 17 normal sit -send_0503({PrevX, PrevY, PrevZ, _AnyDir}) -> - {ok, User} = egs_users:read(get(gid)), - #users{gid=GID, pos={X, Y, Z, Dir}, area={QuestID, ZoneID, MapID}, entryid=EntryID} = User, - IntDir = trunc(Dir * 182.0416), - send(<< 16#05030300:32, 0:64, GID:32/little, 0:64, 16#00011300:32, GID:32/little, 0:64, GID:32/little, 0:32, - 16#1000:16, IntDir:16/little, PrevX:32/little-float, PrevY:32/little-float, PrevZ:32/little-float, X:32/little-float, Y:32/little-float, Z:32/little-float, - QuestID:32/little, ZoneID:32/little, MapID:32/little, EntryID:32/little, 1:32/little >>). - %% @todo Handle more than just goggles. send_0a0a(Inventory) -> {ok, << _:68608/bits, Rest/bits >>} = file:read_file("p/packet0a0a.bin"), diff --git a/src/psu/psu_proto.erl b/src/psu/psu_proto.erl index c2c5216..52148e3 100644 --- a/src/psu/psu_proto.erl +++ b/src/psu/psu_proto.erl @@ -1423,6 +1423,17 @@ send_0304(FromGID, ChatTypeID, ChatGID, ChatName, ChatModifiers, ChatMessage, #c ChatTypeID:32, ChatGID:32/little, 0:64, ChatType:8, ChatCutIn:8, ChatCutInAngle:8, ChatMsgLength:8, ChatChannel:8, ChatCharacterType:8, 0:16, ChatName/binary, ChatMessage/binary >>). +%% @todo Force send a new player location. Used for warps. +%% @todo The value before IntDir seems to be the player's current animation. 01 stand up, 08 ?, 17 normal sit +%% @todo This packet hasn't been reviewed at all yet. +send_0503({PrevX, PrevY, PrevZ, _AnyDir}, #client{socket=Socket, gid=DestGID}) -> + {ok, User} = egs_users:read(DestGID), + #users{pos={X, Y, Z, Dir}, area={QuestID, ZoneID, MapID}, entryid=EntryID} = User, + IntDir = trunc(Dir * 182.0416), + packet_send(Socket, << 16#05030300:32, 0:64, DestGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64, DestGID:32/little, 0:32, + 16#1000:16, IntDir:16/little, PrevX:32/little-float, PrevY:32/little-float, PrevZ:32/little-float, X:32/little-float, Y:32/little-float, Z:32/little-float, + QuestID:32/little, ZoneID:32/little, MapID:32/little, EntryID:32/little, 1:32/little >>). + %% @todo NPC inventory. Guessing it's only for NPC characters... %% @todo This packet hasn't been reviewed at all yet. send_0a04(NPCGID, #client{socket=Socket, gid=DestGID}) ->