| summaryrefslogtreecommitdiff | 
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2019-01-23 19:12:52 +0100 | 
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2019-01-23 19:12:52 +0100 | 
| commit | 41f0db023cb6c1a609762b9679b3677143b3840f (patch) | |
| tree | ae2297181648ab838e7abded8530a7ff17a49af3 /src/battle/query/btl_join.erl | |
| parent | 14e79da8b8d45ef242aee34cf4376d220846f690 (diff) | |
Isolates Yaws from the code base.
Diffstat (limited to 'src/battle/query/btl_join.erl')
| -rw-r--r-- | src/battle/query/btl_join.erl | 16 | 
1 files changed, 7 insertions, 9 deletions
| diff --git a/src/battle/query/btl_join.erl b/src/battle/query/btl_join.erl index 29d273f..aabea27 100644 --- a/src/battle/query/btl_join.erl +++ b/src/battle/query/btl_join.erl @@ -3,8 +3,6 @@  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --include("../../../include/yaws_api.hrl"). -  -record  (     input, @@ -33,9 +31,9 @@  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --spec parse_input (binary()) -> input(). -parse_input (Req) -> -   JSONReqMap = jiffy:decode(Req, [return_maps]), +-spec parse_input (shr_query:type()) -> input(). +parse_input (Query) -> +   JSONReqMap = shr_query:get_params(Query),     PlayerID = maps:get(<<"pid">>, JSONReqMap),     SessionToken =  maps:get(<<"stk">>, JSONReqMap),     SummaryIX = maps:get(<<"six">>, JSONReqMap), @@ -205,9 +203,9 @@ authorize_attack (_QueryState, _Input) -> ok. % TODO  -spec authorize_defend (defend_query_state(), input()) -> 'ok'.  authorize_defend (_QueryState, _Input) -> ok. % TODO --spec handle (binary()) -> binary(). -handle (Req) -> -   Input = parse_input(Req), +-spec handle (shr_query:type()) -> binary(). +handle (Query) -> +   Input = parse_input(Query),     case authenticate_user(Input) of        ok ->           case Input#input.mode of @@ -233,5 +231,5 @@ out(A) ->     {        content,        "application/json; charset=UTF-8", -      handle(A#arg.clidata) +      handle(shr_query:new(A))     }. | 


