Skip to main content
Version: 5.11.8

GetPastRankList

public BackendReturnObject GetPastRankList(string rankUuid, int limit = 10, int offset = 0)

Parameters

ValueTypeDescriptionDefault
rankUuidstringuuid of the ranking to look up-
limitintNumber of ranking users to load ( 1 - 100)10
offsetintuuid of the ranking to look up (above 0)0

Description

Loads the last ranking list before the renewal of the ranking that has been measured for ranking rewards.

  • This is only possible for rankings with rewards.
  • Only the past rankings for users who have received ranking rewards are displayed.
    • If ranking rewards are given to the top 10, past rankings from 11th place and below cannot be loaded.
    • Users that are not on the ranking list but have received the reward for all are not included in the past rankings.
  • You cannot load the past rankings for a certain user or for yourself.
  • Among the past rankings, the single latest past ranking will be loaded.
    • For daily rankings, the past rankings for the previous day will be loaded, and the rankings for 2 days prior cannot be loaded.
  • If a number smaller than 0 is entered for the limit, it will be adjusted to 1. If a number exceeding 100 is entered, it will be adjusted to 100.
  • If a number smaller than 0 is entered for the offset, it will be adjusted to 0.
  • Users without nicknames will be marked as "".
For withdrawn users

If there are withdrawn users in the past ranking list, the user’s nickname and inDate columns will not exist.
Check the columns using jsonData.ContainsKey("nickname") before processing the data.

Withdrawn user

{"score":"7835","rank":1}

General user

{"score":"7833","rank":3,"nickname":"user1","inDate":"2024-03-06T05:59:53.523Z"}

Example

Synchronous


// Rankings 1 to 10
Backend.URank.User.GetPastRankList("a61c6980-db5f-11ee-95a9-73cbb1225013", 10, 0);

// Rank 11 (offset + 1) to 111 ((offset + 1 + limit)
Backend.URank.User.GetPastRankList("a61c6980-db5f-11ee-95a9-73cbb1225013", 100, 10);

Asynchronous

Backend.URank.User.GetPastRankList("a61c6980-db5f-11ee-95a9-73cbb1225013", 10, 0, callback => {

});

SendQueue

SendQueue(Backend.URank.User.GetPastRankList, "a61c6980-db5f-11ee-95a9-73cbb1225013", 10, 0, callback => {

});

ReturnCase

Success case

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

Error cases

If reward calculation has not been conducted for the past rankings
statusCode : 200

returnValue : {"rows":[]}

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 attempting to look up the past rankings for the cumulative rankings
statusCode : 428
errorCode : Precondition Required

GetReturnValuetoJSON

{
"rows": [
{
"score": "7835", // The nickname and inDate will not be printed for withdrawn users.
"rank": 1
}
{
"score": "5834",
"rank": 2,
"nickname": "user2",// Users without nicknames will be printed as "".
"inDate": "2024-03-06T05:59:53.523Z"
},
{
"score": "5121",
"rank": 3,
"nickname": "user3",
"inDate": "2024-03-06T05:59:51.568Z"
}
]
}

Sample code

public void GetRankRewardList()
{
string rankingUUID = "a61c6980-db5f-11ee-95a9-73cbb1225013";

var bro = Backend.URank.User.GetPastRankList(rankingUUID, 100, 0);

if(bro.IsSuccess() == false) {
Debug.LogError("GetPastRankList : " + bro);
}

foreach(LitJson.JsonData jsonData in bro.Rows()) {

// If the user has withdrawn, the nickname and inDate columns do not exist.
string nickname = jsonData.ContainsKey("nickname") ? jsonData["nickname"].ToString() : "Deleted User";
string inDate = jsonData.ContainsKey("inDate") ? jsonData["inDate"].ToString() : string.Empty;
string score = jsonData["score"].ToString();
string rank = jsonData["rank"].ToString();

Debug.Log($"{rank}.{nickname}({inDate}) : {score} points");
}
}