psu_proto: Review and move send_0111 to psu_proto.

This commit is contained in:
Loïc Hoguin 2010-09-23 21:23:59 +02:00
parent 9b0b5c1dec
commit 3c16cf7c70
3 changed files with 9 additions and 8 deletions

View File

@ -668,7 +668,7 @@ event(player_death, State=#state{gid=GID}) ->
psu_proto:send_0117(User2#egs_user_model{lid=0}, State),
psu_game:send_1022(NewHP);
%% red screen with return to lobby choice:
%~ psu_game:send_0111(3, 1);
%~ psu_proto:send_0111(User2, 3, 1, State);
%% @todo Refill the player's HP to maximum, remove SEs etc.
event(player_death_return_to_lobby, State=#state{gid=GID}) ->

View File

@ -158,7 +158,7 @@ area_load(AreaType, IsStart, SetID, OldUser, User, QuestFile, ZoneFile, AreaName
% load new zone
psu_proto:send_0a05(State),
if AreaType =:= lobby ->
send_0111(6, 0);
psu_proto:send_0111(User#egs_user_model{lid=0}, 6, State);
true -> ignore
end,
psu_proto:send_010d(User#egs_user_model{lid=0}, State),
@ -278,12 +278,6 @@ build_010a_list([ItemID|Tail], Acc) ->
Bin = << UCS2Name/binary, 0:NamePadding, RarityBin:8, 0:8, BinItemID/binary, SellPrice:32/little, DataBin/binary >>,
build_010a_list(Tail, [Bin|Acc]).
%% @doc Trigger a character-related event.
send_0111(A, B) ->
GID = get(gid),
send(<< 16#01110300:32, 0:64, GID:32/little-unsigned-integer, 0:64, 16#00011300:32, GID:32/little-unsigned-integer, 0:64,
GID:32/little-unsigned-integer, 0:32, A:32/little-unsigned-integer, B:32/little-unsigned-integer >>).
%% @todo Types capability list.
send_0113() ->
{ok, File} = file:read_file("p/typesinfo.bin"),

View File

@ -1178,6 +1178,13 @@ send_010d(CharUser, #state{socket=Socket, gid=DestGID}) ->
0:64, 1:32/little-unsigned-integer, 0:32, 16#00000300:32, 16#ffff0000:32, 0:32, CharGID:32/little-unsigned-integer,
0:192, CharGID:32/little-unsigned-integer, CharLID:32/little-unsigned-integer, 16#ffffffff:32, CharBin/binary >>).
%% @doc Trigger a character-related event.
send_0111(CharUser, EventID, State) ->
send_0111(CharUser, EventID, 0, State).
send_0111(#egs_user_model{id=CharGID, lid=CharLID}, EventID, Param, #state{socket=Socket, gid=DestGID, lid=DestLID}) ->
packet_send(Socket, << 16#01110300:32, DestLID:16/little, 0:48, CharGID:32/little, 0:64, 16#00011300:32, DestGID:32/little, 0:64,
CharGID:32/little, CharLID:32/little, EventID:32/little, Param:32/little >>).
%% @doc Update the character level, blastbar, luck and money information.
send_0115(CharUser, State) ->
send_0115(CharUser, 16#ffffffff, State).