Skip to main content
Version: 5.15.0

GetOtherGuildLeaderboardPlace

public BackendGuildLeaderboardReturnObject GetOtherGuildLeaderboardPlace(string leaderboardUuid, string userInDate);
public BackendGuildLeaderboardReturnObject GetOtherGuildLeaderboardPlace(string leaderboardUuid, string userInDate, int gap);

Parameters

ValueTypeDescriptionDefault
leaderboardUuidstringuuid of the leaderboard to look up-
userIndatestringinDate of the guild to look up-
gapintNumber of rank holders above/below to be looked up together (0 - 25)0

The leaderboardUuid value can be checked using the following methods:

Description

Looks up the guild's rank in the leaderboard using a uuid value and userIndate.

  • 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_TEST.Leaderboard.BackendGuildLeaderboardReturnObject bro = null;
// Look up your own ranking only
bro = Backend.Leaderboard.Guild.GetOtherGuildLeaderboardPlace("01920444-612d-7802-8e30-f983de5220a9", "2024-05-08T07:17:20.830Z");
// Look up the leaderboard including three guilds above and below
// If the guild is the 4th, the 1st - 7th guilds are looked up.
bro = Backend.Leaderboard.Guild.GetOtherGuildLeaderboardPlace("01920444-612d-7802-8e30-f983de5220a9", "2024-05-08T07:17:20.830Z", 3);

Debug.Log("Total number of guilds registered to the leaderboard : " + bro.GetTotalCount());
foreach (BackEnd_TEST.Leaderboard.GuildLeaderboardItem item in bro.GetGuildLeaderboardList())
{
Debug.Log($"Rank {item.rank} : {item.guildName}");
Debug.Log(item.ToString());
}

Asynchronous

// Only look up the selected guild's leaderboard
Backend.Leaderboard.Guild.GetOtherGuildLeaderboardPlace("01920444-612d-7802-8e30-f983de5220a9", "2024-05-08T07:17:20.830Z", bro => {

if(bro.IsSuccess() == false) {
return;
}

Debug.Log("Total number of guilds registered to the leaderboard : " + bro.GetTotalCount());

foreach (BackEnd_TEST.Leaderboard.GuildLeaderboardItem item in bro.GetGuildLeaderboardList())
{
Debug.Log($"Rank {item.rank} : {item.guildName}");
Debug.Log(item.ToString());
}
});

// Look up the leaderboard including three guilds above and below
// If the guild is the 4th, the 1st - 9th guilds are looked up.
Backend.Leaderboard.Guild.GetOtherGuildLeaderboardPlace("01920444-612d-7802-8e30-f983de5220a9", "2024-05-08T07:17:20.830Z", 5, callback => {
// Post-process
});

ReturnCase

Success cases

When the guild exists in the leaderboard
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 there is an attempt to look up with a non-existent guildIndate
statusCode : 404
errorCode : NotFoundException
message : guild not found, guild cannot be found

When the guild does not exist in the ranking
statusCode : 404
errorCode : NotFoundException
message : guildRank not found, guildRank 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 (2024-05-08T07:17:20.830Z))

{
"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
}