Skip to content

Commit f45a530

Browse files
authored
Merge pull request #38 from TaloDev/develop
Release 0.10.0
2 parents 8fa75db + 1bbf177 commit f45a530

File tree

9 files changed

+42
-16
lines changed

9 files changed

+42
-16
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[System.Serializable]
2+
public class Group
3+
{
4+
public string id, name;
5+
}

Packages/com.trytalo.talo/Runtime/Entities/Group.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.trytalo.talo/Runtime/Entities/Player.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class Player
99
{
1010
public string id;
1111
public Prop[] props;
12+
public Group[] groups;
1213

1314
public override string ToString()
1415
{
@@ -49,6 +50,11 @@ public void DeleteProp(string key)
4950
prop.value = null;
5051

5152
Talo.Players.Update();
53+
}
54+
55+
public bool IsInGroup(string groupId)
56+
{
57+
return groups.Any((group) => group.id == groupId);
5258
}
5359
}
5460
}

Packages/com.trytalo.talo/Runtime/PlayersAPI.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ public async Task Identify(string service, string identifier)
1717

1818
Talo.CurrentAlias = res.alias;
1919

20-
await Talo.Saves.GetSaves();
20+
try
21+
{
22+
await Talo.Saves.GetSaves();
23+
}
24+
catch (Exception err)
25+
{
26+
Debug.LogError(err.Message);
27+
}
2128
}
2229

2330
public async void Update()
@@ -31,10 +38,10 @@ public async void Update()
3138
Talo.CurrentPlayer = res.player;
3239
}
3340

34-
public async Task<Player> Merge(string alias1, string alias2)
41+
public async Task<Player> Merge(string playerId1, string playerId2)
3542
{
3643
var uri = new Uri(baseUrl + "/merge");
37-
string content = JsonUtility.ToJson(new PlayersMergeRequest(alias1, alias2));
44+
string content = JsonUtility.ToJson(new PlayersMergeRequest(playerId1, playerId2));
3845

3946
string json = await Call(uri, "POST", content);
4047
var res = JsonUtility.FromJson<PlayersUpdateResponse>(json);
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
using System.Collections;
2-
using UnityEngine;
3-
4-
public class PlayersMergeRequest
1+
public class PlayersMergeRequest
52
{
6-
public string alias1, alias2;
3+
public string playerId1, playerId2;
74

8-
public PlayersMergeRequest(string alias1, string alias2)
5+
public PlayersMergeRequest(string playerId1, string playerId2)
96
{
10-
this.alias1 = alias1;
11-
this.alias2 = alias2;
7+
this.playerId1 = playerId1;
8+
this.playerId2 = playerId2;
129
}
1310
}

Packages/com.trytalo.talo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.trytalo.talo",
3-
"version": "0.9.0",
3+
"version": "0.10.0",
44
"displayName": "Talo Game Services",
55
"description": "Talo (https://trytalo.com) is an open-source game backend with services designed to help you build games faster. You can currently:\n\n- Identify players\n- Store persistent data across players\n- Track events (levelling up, finding loot, etc)\n- Display high scores with leaderboards\n- Store and load player saves",
66
"unity": "2019.1",

Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"com.unity.ide.visualstudio": "2.0.15",
3+
"com.unity.ide.visualstudio": "2.0.16",
44
"com.unity.ide.vscode": "1.2.5",
55
"com.unity.test-framework": "1.1.31",
66
"com.unity.ugui": "1.0.0",

Packages/packages-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "https://packages.unity.com"
1515
},
1616
"com.unity.ide.visualstudio": {
17-
"version": "2.0.15",
17+
"version": "2.0.16",
1818
"depth": 0,
1919
"source": "registry",
2020
"dependencies": {

ProjectSettings/ProjectVersion.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2021.3.1f1
2-
m_EditorVersionWithRevision: 2021.3.1f1 (3b70a0754835)
1+
m_EditorVersion: 2021.3.11f1
2+
m_EditorVersionWithRevision: 2021.3.11f1 (0a5ca18544bf)

0 commit comments

Comments
 (0)