UpdateReady
Updates the ready status and extra json for the given lobby member.
Service | Operation |
---|---|
lobby | UPDATE_READY |
Method Parameters
Parameter | Description |
---|---|
lobbyId | Id of chosen lobby. |
isReady | Initial ready-status of this user. |
extraJson | Initial extra-data about this user. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string lobbyId = "55555:4v4:19";
bool isReady = true;
string extraJson = "{}";
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.LobbyService.UpdateReady(lobbyId, isReady, extraJson, successCallback, failureCallback);
const char *lobbyId = "55555:4v4:19";
bool isReady = true;
const char *extraJson = "{}";
_bc->getLobbyService()->updateReady(lobbyId, isReady, extraJson, this);
NSString *lobbyId = @"55555:4v4:19";
bool isReady = true;
NSString *extraJson = @"{}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc lobbyService] updateReady:lobbyId
isReady:isReady
extraJson:extraJson
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String lobbyId = "55555:4v4:19";
boolean isReady = true;
String extraJson = "{}";
this; // implements IServerCallback
_bc.getLobbyService().updateReady(lobbyId, isReady, extraJson, 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 lobbyId = "55555:4v4:19";
var isReady = true;
var extraJson = {};
_bc.lobby.updateReady(lobbyId, isReady, extraJson, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var lobbyId = "55555:4v4:19";
var isReady = true;
var extraJson = {};
ServerResponse result = await _bc.lobbyService.updateReady(lobbyId:lobbyId, isReady:isReady, extraJson:extraJson);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var lobbyId = "55555:4v4:19";
var isReady = true;
var extraJson = {};
var lobbyProxy = bridge.getLobbyServiceProxy();
var postResult = lobbyProxy.updateReady(lobbyId, isReady, extraJson);
if (postResult.status == 200) {
// Success!
}
{
"service": "lobby",
"operation": "UPDATE_READY",
"data": {
"lobbyId": "55555:4v4:19",
"isReady": true,
"extraJson": {}
}
}
JSON Response
{
"status": 200,
"data": {}
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
40601 | RTT_NOT_ENABLED | RTT must be enabled for this feature |