diff --git a/src/psu/psu_game.erl b/src/psu/psu_game.erl index 6602d0b..06ab1a2 100644 --- a/src/psu/psu_game.erl +++ b/src/psu/psu_game.erl @@ -575,6 +575,12 @@ event({counter_quest_files_request, CounterID}) -> [{quests, Filename}|_Tail] = proplists:get_value(CounterID, ?COUNTERS), send_0c06(Filename); +%% @doc Counter available mission list request handler. +event({counter_quest_options_request, CounterID}) -> + log("counter quest options request ~p", [CounterID]), + [{quests, _}, {bg, _}, {options, Options}] = proplists:get_value(CounterID, ?COUNTERS), + send_0c10(Options); + %% @todo A and B are unknown. %% Melee uses a format similar to: AAAA--BBCCCC----DDDDDDDDEE----FF with %% AAAA the attack sound effect, BB the range, CCCC and DDDDDDDD unknown but related to angular range or similar, EE number of targets and FF the model. @@ -822,12 +828,6 @@ handle(16#0a09, Data) -> handle(16#0a10, << ItemID:32/unsigned-integer >>) -> send_0a11(ItemID, "dammy"); -%% @doc Counter available mission list request handler. -handle(16#0c0f, _) -> - {ok, User} = egs_user_model:read(get(gid)), - [{quests, _}, {bg, _}, {options, Options}] = proplists:get_value(User#egs_user_model.counterid, ?COUNTERS), - send_0c10(Options); - %% @doc Set flag handler. Associate a new flag with the character. %% Just reply with a success value for now. %% @todo God save the flags. diff --git a/src/psu/psu_proto.erl b/src/psu/psu_proto.erl index 4b88196..8d9ae4a 100644 --- a/src/psu/psu_proto.erl +++ b/src/psu/psu_proto.erl @@ -287,6 +287,22 @@ parse(Size, 16#0c0e, Channel, Data) -> ?ASSERT_EQ(VarI, 0), mission_abort; +parse(Size, 16#0c0f, Channel, Data) -> + << _LID:16/little, VarA:16/little, VarB:32/little, VarC:32/little, VarD:32/little, VarE:32/little, + VarF:32/little, VarG:32/little, VarH:32/little, VarI:32/little, CounterID:32/little >> = Data, + ?ASSERT_EQ(Size, 48), + ?ASSERT_EQ(Channel, 2), + ?ASSERT_EQ(VarA, 0), + ?ASSERT_EQ(VarB, 0), + ?ASSERT_EQ(VarC, 0), + ?ASSERT_EQ(VarD, 0), + ?ASSERT_EQ(VarE, 0), + ?ASSERT_EQ(VarF, 0), + ?ASSERT_EQ(VarG, 0), + ?ASSERT_EQ(VarH, 0), + ?ASSERT_EQ(VarI, 0), + {counter_quest_options_request, CounterID}; + parse(_Size, Command, Channel, Data) -> %% @todo log unknown command? %~ ignore.