Skip to main content
Version: 6.0.0

GetMyLeaderboard

public BackndGuildLeaderboardReturnObject GetMyLeaderboard(string rankUuid);
public BackndGuildLeaderboardReturnObject GetMyLeaderboard(string rankUuid, int gap);

Note

Old version rankings cannot use this method.

BackndGuildLeaderboardReturnObject

GetReturnValueByGuildLeaderboardList

If an error occurred, null is returned.

BackndGuildLeaderboardReturnObject bro = Backnd.Leaderboard.Guild.GetMyLeaderboard("rankUuid");

foreach(BackndGuildLeaderboardItem item in bro.GetReturnValueByGuildLeaderboardList()) {
Debug.Log(item.ToString());
}

BackndGuildLeaderboardItem

public class BackndGuildLeaderboardItem
{
public string guildInDate;
public string guildName;
public string score;
public string index;
public string rank;
public string totalCount;

}

Parameters

ValueTypeDescriptionDefault
rankUuidstringuuid of the ranking to look up-
gapintNumber of guilds above/below to be looked up together(0 - 100)0

The rankUuid value can be checked using the following methods:

Description

Looks up the rank of the guild you joined 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.

Example

Synchronous

// Look up only the rank of the guild you joined.  
Backnd.Leaderboard.Guild.GetMyLeaderboard("rankUuid");

// Look up the ranking including three guilds above and below
// If your guild is the 4th, the 1st - 7th guilds are looked up.
Backnd.Leaderboard.Guild.GetMyLeaderboard("rankUuid", 3);

Asynchronous

// Look up only the rank of the guild you joined.  
Backnd.Leaderboard.Guild.GetMyLeaderboard("rankUuid", callback => {
// Post-process
});

// Look up the ranking including three guilds above and below
// If your guild is the 4th, the 1st - 7th guilds are looked up.
Backnd.Leaderboard.Guild.GetMyLeaderboard("rankUuid", 5 => {
// Post-process
});

Return cases

Success cases

When your guild is in the ranking and 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 your guild does not exist in the ranking
statusCode : 404
errorCode : NotFoundException

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

GetReturnValuetoJSON

When the gap is 0

{
"rows": [
{
// Guild name
"guildName": {
"S": "guildName"
},
// Guild inDate
"guildInDate": {
"S": "2021-03-11T03:23:24.913Z"
},
// Guild score
// All 'score,' regardless of meta rankings and goods rankings.
"score": {
"N": "9999"
},
// offset
"index": {
"N": 0
},
// Guild rank
"rank": {
"N": 1
}
}
],
// Total number of guilds registered in the ranking
"totalCount": 100
}

When the gap is 1

{
"rows": [
// The guild whose rank is 1 place higher than your guild
{
"guildName": {
"S": "guildName0"
},
"guildInDate": {
"S": "2021-03-11T03:23:24.913Z"
},
"score": {
"N": 10000
},
"index": {
"N": 0
},
"rank": {
"N": 1
}
},
// The guild you joined
{
"guildName": {
"S": "guildName1"
},
"guildInDate": {
"S": "2021-03-11T03:23:24.912Z"
},
"score": {
"N": 9999
},
"index": {
"N": 1
},
"rank": {
"N": 2
}
},
// User whose rank is 1 place lower than your rank
{
"guildName": {
"S": "guildName2"
},
"guildInDate": {
"S": "2021-03-11T03:23:24.900Z"
},
"score": {
"N": 9998
},
"index": {
"N": 2
},
"rank": {
"N": 3
}
}
],
"totalCount": 100
}

Sample code

public class GuildLeaderboardItem
{
public string guildInDate;
public string guildName;
public string score;
public string index;
public string rank;
public string totalCount;

public override string ToString()
{
return $"guildInDate:{guildInDate}\nGuild name:{guildName}\nScore:{score}\nSort:{index}\nRank:{rank}\nTotal:{totalCount}\n";
}
}
public void GetMyLeaderboardTest()
{
int limit = 100;

List<GuildLeaderboardItem> rankItemList = new List<GuildLeaderboardItem>();
BackndGuildLeaderboardReturnObject bro = Backnd.Leaderboard.Guild.GetMyLeaderboard(userUuid, limit);

if(bro.IsSuccess())
{
BACKND.LitJson.JsonData rankListJson = bro.GetFlattenJSON();
for(int i = 0; i < rankListJson["rows"].Count; i++)
{
GuildLeaderboardItem rankItem = new GuildLeaderboardItem();

rankItem.guildInDate = rankListJson["rows"][i]["guildInDate"].ToString();
rankItem.guildName = rankListJson["rows"][i]["guildName"].ToString();
rankItem.score = rankListJson["rows"][i]["score"].ToString();
rankItem.index = rankListJson["rows"][i]["index"].ToString();
rankItem.rank = rankListJson["rows"][i]["rank"].ToString();
rankItem.totalCount = rankListJson["totalCount"].ToString();
rankItemList.Add(rankItem);

Debug.Log(rankItem.ToString());
}
}
}