GetTournamentStatus
Get tournament status associated with a leaderboard.
Service | Operation |
---|---|
tournament | GET_TOURNAMENT_STATUS |
Method Parameters
Parameter | Description |
---|---|
leaderboardId | The leaderboard for the tournament |
versionId | Version of the tournament, use -1 for the latest version |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string leaderboardId = "leaderboardId1";
int versionId = 1;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.TournamentService.GetTournamentStatus(leaderboardId, versionId, successCallback, failureCallback);
const char *leaderboardId = "leaderboardId1";
int versionId = 1;
_bc->getTournamentService()->getTournamentStatus(leaderboardId, versionId, this);
NSString *leaderboardId = @"leaderboardId1";
int versionId = 1;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc tournamentService] getTournamentStatus:leaderboardId
versionId:versionId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String leaderboardId = "leaderboardId1";
int versionId = 1;
this; // implements IServerCallback
_bc.getTournamentService().getTournamentStatus(leaderboardId, versionId, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var leaderboardId = "leaderboardId1";
var versionId = 1;
_bc.tournament.getTournamentStatus(leaderboardId, versionId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var leaderboardId = "leaderboardId1";
var versionId = 1;
ServerResponse result = await _bc.tournamentService.getTournamentStatus(leaderboardId:leaderboardId, versionId:versionId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var leaderboardId = "leaderboardId1";
var versionId = 1;
var tournamentProxy = bridge.getTournamentServiceProxy();
var postResult = tournamentProxy.getTournamentStatus(leaderboardId, versionId);
if (postResult.status == 200) {
// Success!
}
{
"service": "tournament",
"operation": "GET_TOURNAMENT_STATUS",
"data": {
"leaderboardId": "the-leaderboard-id",
"versionId": 1
}
}
JSON Response
{
"status": 200,
"data": {
"enrolled": true,
"versionId": 4,
"server_time": 1483719062011,
"tournamentTimetable": {
"tRegistrationStart": 1483704035003,
"tRegistrationEnd": 1483790435003,
"tState": "ACTIVE",
"tPlayEnd": 1483790435003,
"tPlayStart": 1483704035003
},
"tournamentConfigs": [{
"tournamentCode": "testTournament",
"description": {
"name": {
"en": "Test Tournament"
},
"desc": {
"en": "Test Tournament"
}
},
"customJson": {},
"payoutRules": [{
"reward": {
"currency": {
"credits": 1
}
},
"rank": {
"rankAbs": 1
}
}, {
"reward": {},
"rank": {
"rankRemainder": -1
}
}],
"entryFee": {}
}],
"leaderboardEnrollment": {
"score": 989,
"data": null,
"createdAt": 1483719061830,
"updatedAt": 1483719061830,
"tCode": "testTournament",
"tRank": 0,
"tClaimedAt": 0
}
}
}