Skip to content

Commit 93daa71

Browse files
authored
Merge pull request #2 from bottosson/leaderboard-metadata
Added SDK support for leaderboard metadata
2 parents 671f13e + 4c77922 commit 93daa71

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,11 @@ public static void GetScoreListOriginal(int leaderboardId, int count, int after,
18631863
}
18641864

18651865
public static void SubmitScore(string memberId, int score, int leaderboardId, Action<LootLockerSubmitScoreResponse> onComplete)
1866+
{
1867+
SubmitScore(memberId, score, leaderboardId, "", onComplete);
1868+
}
1869+
1870+
public static void SubmitScore(string memberId, int score, int leaderboardId, string metadata, Action<LootLockerSubmitScoreResponse> onComplete)
18661871
{
18671872
if (!CheckInitialized())
18681873
{
@@ -1877,6 +1882,8 @@ public static void SubmitScore(string memberId, int score, int leaderboardId, Ac
18771882
LootLockerSubmitScoreRequest request = new LootLockerSubmitScoreRequest();
18781883
request.member_id = memberId;
18791884
request.score = score;
1885+
if (!string.IsNullOrEmpty(metadata))
1886+
request.metadata = metadata;
18801887

18811888
LootLockerAPIManager.SubmitScore(request, leaderboardId.ToString(), onComplete);
18821889
}

Runtime/Game/Requests/LeaderboardRequest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class LootLockerGetMemberRankResponse : LootLockerResponse
1717
public int rank { get; set; }
1818
public int score { get; set; }
1919
public LootLockerPlayer player { get; set; }
20+
public string metadata { get; set; }
2021
}
2122

2223
public class LootLockerPlayer
@@ -38,6 +39,7 @@ public class LootLockerLeaderboardMember
3839
public int rank { get; set; }
3940
public int score { get; set; }
4041
public LootLockerPlayer player { get; set; }
42+
public string metadata { get; set; }
4143
}
4244

4345
public class LootLockerGetScoreListResponse : LootLockerResponse
@@ -74,13 +76,15 @@ public class LootLockerSubmitScoreResponse : LootLockerResponse
7476
public string member_id { get; set; }
7577
public int rank { get; set; }
7678
public int score { get; set; }
79+
public string metadata { get; set; }
7780
}
7881

7982

8083
public class LootLockerSubmitScoreRequest
8184
{
8285
public string member_id { get; set; }
8386
public int score { get; set; }
87+
public string metadata { get; set; }
8488
}
8589

8690
public class LootLockerGetMemberRankRequest

0 commit comments

Comments
 (0)