summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battlemap_load_state.erl')
-rw-r--r--src/battlemap_load_state.erl39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/battlemap_load_state.erl b/src/battlemap_load_state.erl
index 43fde3d..f311946 100644
--- a/src/battlemap_load_state.erl
+++ b/src/battlemap_load_state.erl
@@ -17,33 +17,20 @@ handle (Req) ->
),
%% ok = users_manager:ping(UserToken),
jiffy:encode(
- {
+ [
[
- {
- <<"types">>,
- [
- <<"SET_MAP">>,
- lists:map(
- fun (_Char) ->
- <<"ADD_CHAR">>
- end,
- CharList
- )
- ]
- },
- {
- <<"data">>,
+ <<"set_map">>,
+ battlemap_battlemap:encode_in_json(Battlemap)
+ ]
+ |
+ lists:map(
+ fun (Char) ->
[
- battlemap_battlemap:encode_in_json(Battlemap)
- |
- lists:map(
- fun (Char) ->
- battlemap_character:encode_in_json(Char)
- end,
- CharList
- )
+ <<"add_char">>,
+ battlemap_character:encode_in_json(Char)
]
- }
- ]
- }
+ end,
+ CharList
+ )
+ ]
).