Skip to main content
Version: 5.11.6

GetRankList

public BackendReturnObject GetRankList(string rankUuid);
public BackendReturnObject GetRankList(string rankUuid, int limit);
public BackendReturnObject GetRankList(string rankUuid, int limit, int offset);

Note

Old version rankings cannot use this method.

Parameters

ValueTypeDescriptionDefault
rankUuidstringuuid of the ranking to look up-
limitintNumber of guilds to look up(1 - 100)10
offsetintStarting point of the ranking to look up(0 or more)0

The rankUuid value can be checked using the following methods:

Description

Looks up list of guilds registered in the ranking using a uuid value.

Example

Synchronous

// Look up the 1st - 10th guilds in the rankUuid ranking
Backend.URank.Guild.GetRankList("rankUuid");
// Look up the 1st - 100th guilds in the rankUuid ranking
Backend.URank.Guild.GetRankList("rankUuid", 100);
// Look up the 11th - 20th guilds in the rankUuid ranking
Backend.URank.Guild.GetRankList("rankUuid", 10, 10);

Asynchronous

// Look up the 1st - 10th guilds in the rankUuid ranking
Backend.URank.Guild.GetRankList("rankUuid", callback=> {
// Post-process
});
// Look up the 1st - 100th guilds in the rankUuid ranking
Backend.URank.Guild.GetRankList("rankUuid", 100, callback=> {
// Post-process
});
// Look up the 11th - 20th guilds in the rankUuid ranking
Backend.URank.Guild.GetRankList("rankUuid", 10, 10, callback=> {
// Post-process
});

SendQueue

// Look up the 1st - 10th guilds in the rankUuid ranking
SendQueue.Enqueue(Backend.URank.Guild.GetRankList, "rankUuid", callback=> {
// Post-process
});
// Look up the 1st - 100th guilds in the rankUuid ranking
SendQueue.Enqueue(Backend.URank.Guild.GetRankList, "rankUuid", 100, callback=> {
// Post-process
});
// Look up the 11th - 20th guilds in the rankUuid ranking
SendQueue.Enqueue(Backend.URank.Guild.GetRankList, "rankUuid", 10, 10, callback=> {
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

When the lookup is successful but the rank holder is not in the lookup range
statusCode : 200

returnValue : {"rows":[]}

Error cases

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

When the uuid does not exist
statusCode : 404
errorCode : NotFoundException

GetReturnValuetoJSON

GetReturnValuetoJSON

{
"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
}
},
// and etc...
],
// Total number of guilds registered in the ranking
"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 GetRankListTest()
{
int limit = 43;

List<GuildRankItem> rankItemList = new List<GuildRankItem>();

BackendReturnObject bro = Backend.URank.Guild.GetRankList(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());
}
}
}