ResetCurrency
caution
WARNING:
This call, ResetCurrency()
, is included in the client libraries for convenience and backwards compatibility, but for app security reasons we recommend it only be called server-side via Cloud Code. By default the brainCloud servers will block any client-side invocations of currency altering methods. To enable client-side support (not recommended), you need to enable the [x] Allow Currency Calls from Client compatibility setting on the Design | Core App Info | Advanced Settings page of the portal.
Resets the player's currency back to zero.
Service | Operation |
---|---|
product | RESET_PLAYER_VC |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
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.ProductService.ResetCurrency(successCallback, failureCallback);
_bc->getProductService()->resetCurrency(this);
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc productService] resetCurrency:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
this; // implements IServerCallback
_bc.getProductService().resetCurrency(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()));
}
_bc.product.resetCurrency(result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
// N/A
var productProxy = bridge.getProductServiceProxy();
var postResult = productProxy.resetCurrency();
if (postResult.status == 200) {
// Success!
}
{
"service": "product",
"operation": "RESET_PLAYER_VC"
}
JSON Response
{
"status": 200,
"data": null
}