Skip to content

Commit 338c200

Browse files
committed
Adding metadata to leaderboards API
1 parent 671f13e commit 338c200

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ public static void GetScoreListOriginal(int leaderboardId, int count, int after,
18621862
LootLockerAPIManager.GetScoreList(request, onComplete);
18631863
}
18641864

1865-
public static void SubmitScore(string memberId, int score, int leaderboardId, Action<LootLockerSubmitScoreResponse> onComplete)
1865+
public static void SubmitScore(string memberId, int score, int leaderboardId, Action<LootLockerSubmitScoreResponse> onComplete, string metadata = "")
18661866
{
18671867
if (!CheckInitialized())
18681868
{
@@ -1877,6 +1877,8 @@ public static void SubmitScore(string memberId, int score, int leaderboardId, Ac
18771877
LootLockerSubmitScoreRequest request = new LootLockerSubmitScoreRequest();
18781878
request.member_id = memberId;
18791879
request.score = score;
1880+
if (!string.IsNullOrEmpty(metadata))
1881+
request.metadata = metadata;
18801882

18811883
LootLockerAPIManager.SubmitScore(request, leaderboardId.ToString(), onComplete);
18821884
}

Runtime/Game/Requests/LeaderboardRequest.cs

Lines changed: 6 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,17 @@ public class LootLockerSubmitScoreResponse : LootLockerResponse
7476
public string member_id { get; set; }
7577
public int rank { get; set; }
7678
public int score { get; set; }
79+
80+
public string metadata { get; set; }
7781
}
7882

7983

8084
public class LootLockerSubmitScoreRequest
8185
{
8286
public string member_id { get; set; }
8387
public int score { get; set; }
88+
89+
public string metadata { get; set; }
8490
}
8591

8692
public class LootLockerGetMemberRankRequest

0 commit comments

Comments
 (0)