Skip to main content
Version: 5.11.6

GetMyGuildRank

public BackendReturnObject GetMyGuildRank(string rankUuid);
public BackendReturnObject GetMyGuildRank(string rankUuid, int gap);

Note

Old version rankings cannot use this method.

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.  
Backend.URank.Guild.GetMyGuildRank("rankUuid");

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

Asynchronous

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

SendQueue

// Look up only the rank of the guild you joined.  
SendQueue.Enqueue(Backend.URank.Guild.GetMyGuildRank, "rankUuid", callback => {
// Post-process
});

// Look up the ranking including three guilds above and below
// When there are 10 guilds in the ranking, and your guild is the 9th,
// the 6th - 10th guilds are looked up.
SendQueue.Enqueue(Backend.URank.Guild.GetMyGuildRank, "rankUuid", 3 => {
// 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 GuildRankItem
{
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 GetMyRankTest()
{
int limit = 100;

List<GuildRankItem> rankItemList = new List<GuildRankItem>();
BackendReturnObject bro = Backend.URank.Guild.GetMyGuildRank(userUuid, limit);

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

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