Skip to main content

Query Rank

Queries ranking recorded on the leaderboard.

Call Information

public void Range (string tableCode, int rangeStart, int rangeEnd, PlayNANOODelegate callback){}

// Query ranking for previous cycles
public void RangePrev (string uid, int rotationCount, int rangeStart, int rangeEnd, PlayNANOODelegate callback){}

Call Information Details

ParameterDescriptionType
tableCodeTable Codestring
rotationCountTable cycleinteger
rangeStartRanking range startinteger
rangeEndRanking range endinteger
callbackCommunication resultPlayNANOODelegate

Source Code

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

void Awake()
{
plugin = Plugin.GetInstance();

string tableCode = "TableCode";
int rangeStart = 0;
int rangeEnd = 100;

plugin.LeaderboardManagerV20240301.Range(tableCode, rangeStart, rangeEnd, (status, errorCode, jsonString, values) => {
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
foreach (Dictionary<string, object> value in (ArrayList)values["Items"])
{
Debug.Log(value["Rank"]);
Debug.Log(value["RotationCount"]);
Debug.Log(value["RecordId"]);
Debug.Log(value["Score"]);
Debug.Log(value["ExtraData"]);
}
}
else
{
Debug.Log("Fail");
}
});

// Query previous cycle ranking
int rotationCount = 1;

plugin.LeaderboardManagerV20240301.RangePrev(tableCode, rotationCount, rangeStart, rangeEnd, (status, errorCode, jsonString, values) => {
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
foreach (Dictionary<string, object> value in (ArrayList)values["Items"])
{
Debug.Log(value["Rank"]);
Debug.Log(value["RotationCount"]);
Debug.Log(value["RecordId"]);
Debug.Log(value["Score"]);
Debug.Log(value["ExtraData"]);
}
}
else
{
Debug.Log("Fail");
}
});
}
}

Communication Result

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"Items": [
{
"Rank": 1,
"RotationCount": 1,
"RecordId": "TEST0001",
"Score": 20,
"ExtraData": "ssss"
}
]
}

Communication Result

Data KeyDescriptionType
Items.RankRankinteger
Items.RotationCountLeaderboard table cycleinteger
Items.RecordIdRecord IDstring
Items.ScoreScoreinteger
Items.ExtraDataAdditional datastring