summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-11-26 18:57:42 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-11-26 18:57:42 +0100
commitac2a82ce6bbaeccdb0081bc637a5cbb13272efd9 (patch)
treed227e626208ce2e8a21523edbc399917e8b083c4 /src
parent9939f0f046198823857e316faaf08b267e7ec03d (diff)
...
Diffstat (limited to 'src')
-rw-r--r--src/shared/struct/shr_battle_summary.erl13
-rw-r--r--src/shared/struct/shr_player.erl11
2 files changed, 22 insertions, 2 deletions
diff --git a/src/shared/struct/shr_battle_summary.erl b/src/shared/struct/shr_battle_summary.erl
index 3470575..9af72b4 100644
--- a/src/shared/struct/shr_battle_summary.erl
+++ b/src/shared/struct/shr_battle_summary.erl
@@ -24,7 +24,8 @@
-export
(
[
- new/4
+ new/4,
+ none/0
]
).
@@ -83,6 +84,16 @@ new (ID, Name, Time, IsPlayersTurn) ->
is_players_turn = IsPlayersTurn
}.
+-spec none () -> type().
+none () ->
+ #battle_summary
+ {
+ id = <<"">>,
+ name = <<"">>,
+ last_edit = <<"">>,
+ is_players_turn = false
+ }.
+
%%%% Accessors
-spec get_id (type()) -> binary().
get_id (BattleSummary) -> BattleSummary#battle_summary.id.
diff --git a/src/shared/struct/shr_player.erl b/src/shared/struct/shr_player.erl
index 5577615..056afaa 100644
--- a/src/shared/struct/shr_player.erl
+++ b/src/shared/struct/shr_player.erl
@@ -115,6 +115,7 @@ secure_value (Salt, Val) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-spec new (binary(), binary(), binary(), binary()) -> type().
new (ID, Username, Password, Email) ->
+ NoInvasion = shr_battle_summary:none(),
Result =
#player
{
@@ -126,7 +127,15 @@ new (ID, Username, Password, Email) ->
last_active = 0,
maps = [],
campaigns = [],
- invasions = [],
+ invasions =
+ [
+ NoInvasion,
+ NoInvasion,
+ NoInvasion,
+ NoInvasion,
+ NoInvasion,
+ NoInvasion
+ ],
events = [],
inventory_id = <<"0">>,
roster_id = <<"0">>