Skip to main content
Version: 6.0.0

GetOtherGuildLeaderboardPlace

public BackndGuildLeaderboardReturnObject GetOtherGuildLeaderboardPlace(string rankUuid, string guildIndate);
public BackndGuildLeaderboardReturnObject GetOtherGuildLeaderboardPlace(string rankUuid, string guildIndate, int gap);

Note

Old version rankings cannot use this method.

BackndGuildLeaderboardReturnObject

GetReturnValueByGuildLeaderboardList

If an error occurred, null is returned.

BackndGuildLeaderboardReturnObject bro = Backnd.Leaderboard.Guild.GetOtherGuildLeaderboardPlace("rankUuid", "guildInDate");

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-
guildIndatestringinDate of the guild 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 guild's rank in the ranking using a uuid value and guildIndate.

  • 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.GetOtherGuildLeaderboardPlace("rankUuid", "guildIndate");

// 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.GetOtherGuildLeaderboardPlace("rankUuid", "guildIndate", 3);

Asynchronous

// Look up only the rank of the guild you joined.  
Backnd.Leaderboard.Guild.GetOtherGuildLeaderboardPlace("rankUuid", "guildIndate", 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.GetOtherGuildLeaderboardPlace("rankUuid", "guildIndate", 5, callback => {
// Post-process
});

Return cases

Success cases

When the ranking of the guild is looked up successfully
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

Error cases

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

When the guildIndate 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 non-existent guildIndate
statusCode : 404
errorCode : NotFoundException

When the guild does not exist in the ranking
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": [
// Guild whose rank is 1 place lower than that of the looked-up guild
{
"guildName": {
"S": "guildName0"
},
"guildInDate": {
"S": "2021-03-11T03:23:24.913Z"
},
"score": {
"N": 10000
},
"index": {
"N": 0
},
"rank": {
"N": 1
}
},
// The looked-up guild
{
"guildName": {
"S": "guildName1"
},
"guildInDate": {
"S": "2021-03-11T03:23:24.912Z"
},
"score": {
"N": 9999
},
"index": {
"N": 1
},
"rank": {
"N": 2
}
},
// Guild whose rank is 1 place lower than that of the looked-up guild
{
"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 GetOtherGuildLeaderboardPlaceTest()
{
string guildUUID = "";
string guildIndate = "";

List<GuildLeaderboardItem> rankItemList = new List<GuildLeaderboardItem>();
BackndGuildLeaderboardReturnObject bro = Backnd.Leaderboard.Guild.GetOtherGuildLeaderboardPlace(guildUUID , guildIndate , 3);

if(bro.IsSuccess())
{
BACKND.LitJson.JsonData rankListJson = bro.GetFlattenJSON();
string extraName = string.Empty;

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());
}
}
}