summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-12-13 19:09:49 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-12-13 19:09:49 +0100 |
commit | 3ffb430c28ba3c04835d2762a17aac39a1e64ded (patch) | |
tree | e0200629f57ad717cb247a2cae71d266217848a7 /src/special/spe_map.erl | |
parent | da06d32b135b3bc29cedd15ed8630a0eef0c2ab3 (diff) |
...
Diffstat (limited to 'src/special/spe_map.erl')
-rw-r--r-- | src/special/spe_map.erl | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/special/spe_map.erl b/src/special/spe_map.erl index 418d6b5..94075d9 100644 --- a/src/special/spe_map.erl +++ b/src/special/spe_map.erl @@ -16,35 +16,40 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --spec grant_additional (binary()) -> map_map:type(). +-spec grant_additional (ataxia_id:type()) -> map_map:type(). grant_additional (OwnerID) -> Map = map_map:default(OwnerID), {ok, MapID} = - shr_database:insert + ataxia_client:add ( map_db, - any, - [{user, OwnerID}], + ataxia_security:any(), + [ataxia_security:user_from_id(OwnerID)], Map ), MapSummary = shr_map_summary:new(MapID, <<"Untitled Map">>), - PlayerUpdateQueryOps = - [ - shr_db_query:add_to_field + PlayerUpdateQueryOp = + ataxic:on_field + ( + shr_player:get_map_summaries_field(), + ataxic:apply_function ( - shr_player:get_map_summaries_field(), - [MapSummary], - false + lists, + append, + [ataxic:constant([MapSummary]), ataxic:current_value()] ) - ], + ), ok = - shr_database:commit + ataxia_client:update ( - shr_db_query:new(player_db, OwnerID, admin, PlayerUpdateQueryOps) + player_db, + ataxia_security:admin(), + PlayerUpdateQueryOp, + OwnerID ), Map. |