본문으로 건너뛰기

순위 조회

리더보드에 기록 된 순위를 조회합니다.

호출 정보

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