GetMyLeaderboard
public BackendGuildLeaderboardReturnObject GetMyLeaderboard(string leaderboardUuid);
public BackendGuildLeaderboardReturnObject GetMyLeaderboard(string leaderboardUuid, int gap);
Parameters
Value | Type | Description | Default |
---|---|---|---|
leaderboardUuid | string | uuid of the ranking to look up | - |
gap | int | Number of rank holders above/below to be looked up together (0 - 25) | 0 |
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 guilds method
Description
Looks up your rank in the ranking using a uuid value.
- If there is a tie between guilds (with the same rank), guilds with the same ranks may be returned when the gap method is used for the lookup.
- This method cannot be called via SendQueue.
BackendGuildLeaderboardReturnObject
namespace BackEnd.Leaderboard
{
public class GuildLeaderboardItem
{
public string guildInDate;
public string guildName;
public string score;
public string index;
public string rank;
}
public class BackendGuildLeaderboardReturnObject : BackendReturnObject
{
public long GetTotalCount();
public List<GuildLeaderboardItem> GetGuildLeaderboardList();
}
}
Example
Synchronous
BackEnd.Leaderboard.BackendGuildLeaderboardReturnObject bro = null;
// Look up your own ranking only
bro = Backend.Leaderboard.Guild.GetMyLeaderboard("01920444-612d-7802-8e30-f983de5220a9");
// Look up the ranking including three guilds above and below
// If you are the 4th, the 1st - 7th guilds are looked up.
bro = Backend.Leaderboard.Guild.GetMyLeaderboard("01920444-612d-7802-8e30-f983de5220a9", 3);
if (bro.IsSuccess() == false)
{
return;
}
Debug.Log("Total number of guilds registered to the leaderboard : " + bro.GetTotalCount());
foreach (BackEnd.Leaderboard.GuildLeaderboardItem item in bro.GetGuildLeaderboardList())
{
Debug.Log($"Rank {item.rank} ({item.score}) : {item.guildName}");
Debug.Log(item.ToString());
}
Asynchronous
// Look up your own ranking only
Backend.Group.Leaderboard.Guild.GetMyLeaderboard("leaderboardUuid", bro => {
if(bro.IsSuccess() == false) {
return;
}
Debug.Log("Total number of guilds registered to the leaderboard : " + bro.GetTotalCount());
foreach (BackEnd.Leaderboard.GuildLeaderboardItem item in bro.GetGuildLeaderboardList())
{
Debug.Log($"Rank {item.rank} ({item.score}) : {item.guildName}");
Debug.Log(item.ToString());
}
});
// Look up the ranking including three guilds above and below
// If you are the 4th, the 1st - 9th guilds are looked up.
Backend.Leaderboard.Guild.GetMyLeaderboard("leaderboardUuid", 5, bro => {
// Post-process
});
ReturnCase
Success cases
When you are in the ranking and 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 your ranking does not exist
StatusCode : 404
ErrorCode : NotFoundException
Message : guild not found, guild cannot be found
GetReturnValuetoJSON
When the gap is 0
{
"rows": [
{
"guildName": "My guild",
"guildInDate": "2024-05-08T07:17:20.830Z",
"rank": 5,
"index": 4,
"score": "20"
}
],
"totalCount": 36
}
When the gap is 1 (based on my guild)
{
"rows": [
{
"guildName": "guild3",
"guildInDate": "2024-05-08T07:17:21.347Z",
"rank": 4,
"index": 3,
"score": "24"
},
{
"guildName": "My guild",
"guildInDate": "2024-05-08T07:17:20.830Z",
"rank": 5,
"index": 4,
"score": "20"
},
{
"guildName": "guild5",
"guildInDate": "2024-09-12T05:04:53.047Z",
"rank": 6,
"index": 5,
"score": "18"
}
],
"totalCount": 36
}