From b984be19b36226b02cb2d58d8597d2cff4be1eaf Mon Sep 17 00:00:00 2001 From: nsensfel Date: Mon, 20 Nov 2017 17:25:37 +0100 Subject: Trying to get character turns to register. --- www/handler/battlemap/load_state.yaws | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'www/handler/battlemap/load_state.yaws') diff --git a/www/handler/battlemap/load_state.yaws b/www/handler/battlemap/load_state.yaws index b5a7fc7..d68c6a4 100644 --- a/www/handler/battlemap/load_state.yaws +++ b/www/handler/battlemap/load_state.yaws @@ -1,5 +1,5 @@ --record(input, {player_id, battlemap_id, instance_id}). +-record(input, {session_token, player_id, battlemap_id, instance_id}). -include("/tmp/timed_cache_data.hrl"). @@ -7,6 +7,7 @@ parse_input (Req) -> JSONReqMap = jiffy:decode(Req, [return_maps]), #input { + session_token = maps:get(<<"session_token">>, JSONReqMap), player_id = maps:get(<<"player_id">>, JSONReqMap), battlemap_id = maps:get(<<"battlemap_id">>, JSONReqMap), instance_id = maps:get(<<"instance_id">>, JSONReqMap) @@ -65,7 +66,9 @@ generate_reply (Battlemap, _BattlemapInstance, Characters) -> ). handle (Req) -> + %%%% Parse Input = parse_input(Req), + %%%% Fetch Battlemap = timed_cache:fetch(battlemap_db, Input#input.battlemap_id), BattlemapInstance = timed_cache:fetch @@ -85,6 +88,9 @@ handle (Req) -> end, dict:to_list(BattlemapInstance#battlemap_instance.chars) ), + %%%% Calc + %%%% Commit + %%%% Reply generate_reply(Battlemap, BattlemapInstance, Characters). out(A) -> -- cgit v1.2.3-70-g09d2