GetLeaderboardReward
BackendLeaderboardReturnObject GetLeaderboardReward(string leaderboardUuid);
Parameter
Value | Type | Description |
---|---|---|
leaderboardUuid | string | uuid of the ranking to look up |
The leaderboardUuid value can be checked using the following methods:
- Create a ranking in BACKND Console and check the uuid value from the information of the ranking
- Check the uuid value using the Look up leaderboard information of all users method
Description
Looks up the reward information of the ranking using a uuid value.
- This method cannot be called via SendQueue.
This method is to look up the reward information of the ranking registered in the console, not to receive ranking rewards.
For more information on how to receive ranking rewards, please refer to the Look up mail and Receive mail documentation.
BackendLeaderboardReturnObject
namespace BackEnd.Leaderboard
{
public class LeaderboardRewardItem
{
public int startRank;
public int endRank;
public int rewardItemCount;
public string rewardChartName;
public Dictionary<string, string> rewardItems = new Dictionary<string, string>();
}
public class BackendLeaderboardRewardReturnObject : BackendReturnObject
{
public List<LeaderboardRewardItem> GetLeaderboardRewardList();
}
}
Example
Synchronous
BackEnd.Leaderboard.BackendLeaderboardRewardReturnObject bro = Backend.Leaderboard.User.GetLeaderboardReward("uuid");
foreach(BackEnd.Leaderboard.LeaderboardRewardItem item in bro.GetLeaderboardRewardList())
{
Debug.Log(item);
if(item.rewardItems.ContainsKey("level"))
{
int level = int.Parse(item.rewardItems["level"]);
}
}
Asynchronous
Backend.Leaderboard.User.GetLeaderboardReward("leaderboardUuid", bro => {
foreach(BackEnd.Leaderboard.LeaderboardRewardItem item in bro.GetLeaderboardRewardList())
{
Debug.Log(item);
if(item.rewardItems.ContainsKey("level"))
{
int level = int.Parse(item.rewardItems["level"]);
}
}
});
ReturnCase
Success cases
When the lookup is successful
statusCode : 200
message : Success
returnValue : refer to GetReturnValuetoJSON
Error cases
When the uuid is null or string.Empty
statusCode : 400
errorCode : ValidationException
message : leaderboardUuid is null or empty
When there is an attempt to look up with a non-existent uuid
StatusCode : 404
ErrorCode : NotFoundException
Message : leaderboard not found, leaderboard cannot be found
When there is an attempt to look up with a uuid that has no reward
statusCode : 404
errorCode : NotFoundException
message : rank reward not found, rank reward cannot be found
GetReturnValuetoJSON
{
"rows": [
{
"rewardItems": {
"chartFileName": "LevelChart.csv",
"maxExperience": "100",
"level": "1",
"rewardGold": "1111"
},
"startRank": 0,
"endRank": 0,
"rewardItemCount": 123,
"rewardChartName": "LevelChart"
}
]
}