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
Parameter | Description | Type |
---|---|---|
tableCode | Table Code | string |
rotationCount | Table cycle | integer |
rangeStart | Ranking range start | integer |
rangeEnd | Ranking range end | integer |
callback | Communication result | PlayNANOODelegate |
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 Key | Description | Type |
---|---|---|
Items.Rank | Rank | integer |
Items.RotationCount | Leaderboard table cycle | integer |
Items.RecordId | Record ID | string |
Items.Score | Score | integer |
Items.ExtraData | Additional data | string |