순위 조회
리더보드에 기록 된 순위를 조회합니다.
호출 정보
public void Range (string tableCode, int rangeStart, int rangeEnd, PlayNANOODelegate callback){}
// 지난 회차 랭킹 조회
public void RangePrev (string uid, int rotationCount, int rangeStart, int rangeEnd, PlayNANOODelegate callback){}
호출 상세 정보
파라미터 | 설명 | 타입 |
---|---|---|
tableCode | 테이블 코드 | string |
rotationCount | 테이블 회차 | integer |
rangeStart | 순위 시작 범위 | integer |
rangeEnd | 순위 종료 범위 | integer |
callback | 통신 결과 | PlayNANOODelegate |
소스 코드
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");
}
});
// 지난 회차 랭킹 조회
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");
}
});
}
}
통신 결과
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"Items": [
{
"Rank": 1,
"RotationCount": 1,
"RecordId": "TEST0001",
"Score": 20,
"ExtraData": "ssss"
}
]
}
통신 결과 상세 정보
데이터키 | 설명 | 타입 |
---|---|---|
Items.Rank | 랭킹 | integer |
Items.RotationCount | 리더보드 테이블 회차 | integer |
Items.RecordId | 기록 아이디 | string |
Items.Score | 점수 | integer |
Items.ExtraData | 추가 데이터 | string |