aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-03-04 09:22:28 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-03-04 09:22:28 +0100
commit10b1058e56079232728e3fc959709bc784e58b5b (patch)
treea00cd681e8e6b9fc11a286958d9fc1b56ec454d9
parent99fcad8cbe31ba23d9c079b62e8a174c5b3ddf1b (diff)
downloadtacticians-server-10b1058e56079232728e3fc959709bc784e58b5b.zip
tacticians-server-10b1058e56079232728e3fc959709bc784e58b5b.tar.bz2
Fixes missing cache timeout, tix being binary.
-rw-r--r--src/io/timed_cache.erl3
-rw-r--r--src/struct/battle_action.erl2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/io/timed_cache.erl b/src/io/timed_cache.erl
index 4c82ee8..52b98d6 100644
--- a/src/io/timed_cache.erl
+++ b/src/io/timed_cache.erl
@@ -53,7 +53,8 @@ add_update_to_cache (DB, Owner, ObjectID, Data) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% 'gen_server' functions
init ({DB, ObjectID}) ->
- {ok, {DB, ObjectID}}.
+ io:format("~nCache entry added: ~p.~n", [{DB, ObjectID}]),
+ {ok, {DB, ObjectID}, timed_caches_manager:get_timeout()}.
handle_call (invalidate, _, State) ->
{stop, normal, State};
diff --git a/src/struct/battle_action.erl b/src/struct/battle_action.erl
index 755b771..d6bda92 100644
--- a/src/struct/battle_action.erl
+++ b/src/struct/battle_action.erl
@@ -55,7 +55,7 @@ decode_mov_action (JSONMap) ->
-spec decode_atk_action (map()) -> struct().
decode_atk_action (JSONMap) ->
- TargetIX = maps:get(<<"tix">>, JSONMap),
+ TargetIX = binary_to_integer(maps:get(<<"tix">>, JSONMap)),
#attack { target_ix = TargetIX }.