Skip to main content
Version: 5.11.6

GetRankRewardList

BackendReturnObject GetRankRewardList(string rankUuid);

Note

Old version rankings cannot use this method.

Parameter

ValueTypeDescription
rankUuidstringuuid of the ranking to look up

The rankUuid value can be checked using the following methods:

Description

Looks up the reward information of the ranking using a uuid value.
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.

Example

Synchronous

Backend.URank.Guild.GetRankRewardList("rankUuid");

Asynchronous

Backend.URank.Guild.GetRankRewardList("rankUuid", callback => {
// Post-process
});

SendQueue

SendQueue(Backend.URank.Guild.GetRankRewardList, "rankUuid", callback => {
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

Error cases

When the uuid is null or string.Empty
statusCode : 400
errorCode : ValidationException

When there is an attempt to look up with a non-existent uuid
statusCode : 404
errorCode : NotFoundException

When there is an attempt to look up with a uuid that has no reward
statusCode : 404
errorCode : NotFoundException

GetReturnValuetoJSON

{
"rows": [
{
// Ranking reward item information
"rewardItems": {
// Item information
},
// First rank that will receive the ranking reward
"startRank": "1",
// Last rank that will receive the ranking reward
"endRank": "1",
// Number of items to be awarded
"rewardItemCount": "1",
// Name of the chart containing item information
"rewardChartName": "weaponTable"
},
// and etc...
]
}

Sample code

public class RankRewardItem
{
public int startRank;
public int endRank;
public int rewardItemCount;
public string rewardChartName;
public Dictionary<string, string> rewardItems = new Dictionary<string, string>();
public override string ToString()
{
string str = string.Empty;
foreach(var dic in rewardItems)
{
str += $"reward : {dic.Key} : {dic.Value}\n";
}
return $"startRank : {startRank}\n" +
$"endRank : {endRank}\n" +
$"rewardItemCount : {rewardItemCount}\n" +
$"rewardChartName : {rewardChartName}\n" + str;
}
}
public void GetRankRewardList()
{
BackendReturnObject bro = Backend.URank.User.GetRankRewardList("9b41d1c0-8ef0-11ec-b651-c7dd98f693dc");

if(!bro.IsSuccess())
{
Debug.LogError(bro.ToString());
return;
}

List<RankRewardItem> rankRewardList = new List<RankRewardItem>();

LitJson.JsonData rankRewardListJson = bro.FlattenRows();

for(int i = 0; i < rankRewardListJson.Count; i++)
{
RankRewardItem rankRewardItem = new RankRewardItem();

rankRewardItem.rewardItemCount = int.Parse(rankRewardListJson[i]["rewardItemCount"].ToString());
rankRewardItem.startRank = int.Parse(rankRewardListJson[i]["startRank"].ToString());
rankRewardItem.endRank = int.Parse(rankRewardListJson[i]["endRank"].ToString());
rankRewardItem.rewardChartName = rankRewardListJson[i]["rewardChartName"].ToString();

foreach(var column in rankRewardListJson[i]["rewardItems"].Keys)
{
rankRewardItem.rewardItems.Add(column, rankRewardListJson[i]["rewardItems"][column].ToString());
}

rankRewardList.Add(rankRewardItem);
Debug.Log(rankRewardItem.ToString());
}
}