GetPastLeaderboard
public BackendGuildPastLeaderboardReturnObject GetPastLeaderboard(string leaderboardUuid, int limit = 10, int offset = 0)
Parameters
Value | Type | Description | Default |
---|---|---|---|
leaderboardUuid | string | uuid of the leaderboard to look up | - |
limit | int | Number of leaderboard guilds to load (1 - 100) | 10 |
offset | int | uuid of the leaderboard 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 guilds 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.
- Guilds 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 guild 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.
- This method cannot be called via SendQueue.
If there are withdrawn guilds in the past ranking list, the guild's guildInDate and guildName columns will not exist.
Check the columns using jsonData.ContainsKey("guildName") before processing the data.
Withdrawn guild
{"score":"7835","rank":1}
General guild
{"score":"7834","rank":2,"guildInDate":"2024-03-06T05:59:54.716Z","guildName":"Knights"}
BackendGuildPastLeaderboardReturnObject
namespace BackEnd.Leaderboard
{
public class GuildPastLeaderboardItem
{
public string guildName;
public string guildInDate;
public string score;
public string rank;
}
public class BackendGuildPastLeaderboardReturnObject : BackendReturnObject
{
public List<GuildPastLeaderboardItem> GetGuildPastLeaderboardList();
}
}
Example
Synchronous
// Leaderboard ranks 1 to 10
BackEnd.Leaderboard.BackendGuildPastLeaderboardReturnObject bro = Backend.Leaderboard.Guild.GetPastLeaderboard("01920445-a435-759e-bc3b-048a1e7a87aa");
foreach(BackEnd.Leaderboard.GuildPastLeaderboardItem item in bro.GetGuildPastLeaderboardList())
{
string name = $"[{item.rank}] {item.guildName} : {item.score}";
Debug.Log(item);
}
// Leaderboard ranks 11 (offset + 1) to 111 ((offset + 1 + limit)
Backend.Leaderboard.Guild.GetPastLeaderboard("a61c6980-db5f-11ee-95a9-73cbb1225013", 100, 10);
Asynchronous
Backend.Leaderboard.Guild.GetPastLeaderboard("a61c6980-db5f-11ee-95a9-73cbb1225013", 10, 0, callback => {
foreach(BackEnd.Leaderboard.GuildPastLeaderboardItem item in callback.GetGuildPastLeaderboardList())
{
string name = $"[{item.rank}] {item.guildName} : {item.score}";
Debug.Log(item);
}
});
ReturnCase
Success cases
When the lookup is successful
statusCode : 200
message : Success
returnValue : refer to GetReturnValuetoJSON
Error cases
If reward calculation has not been conducted for the past leaderboards
statusCode : 200
message : Success
returnValue : {"rows":[]}
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 an attempt is made to look up the past leaderboards for the cumulative leaderboards
statusCode : 428
errorCode : Precondition Required
message : Precondition Required rank initial type
GetReturnValuetoJSON
{
"rows": [
{
"score": "7835", // The nickname and inDate will not be printed for withdrawn guilds.
"rank": 1
}
{
"score": "5834",
"rank": 2,
"guildName": "Guild2",
"guildInDate": "2024-03-06T05:59:53.523Z"
},
{
"score": "5121",
"rank": 3,
"guildName": "Guild3",
"guildInDate": "2024-03-06T05:59:51.568Z"
}
]
}