GetCatalogItemDefinition
Reads an existing item definition from the server, with language fields limited to the current or default language.
Service | Operation |
---|---|
itemCatalog | GET_CATALOG_ITEM_DEFINITION |
Method Parameters
Parameter | Description |
---|---|
defId | The unique id of the item definition. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string defId = "sword001";
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.ItemCatalogService.GetCatalogItemDefinition(defId, successCallback, failureCallback);
const char *defId = "sword001";
_bc->getItemCatalogService()->getCatalogItemDefinition(defId, this);
NSString *defId = @"sword001";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc itemCatalogService] getCatalogItemDefinition:defId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String defId = "sword001";
this; // implements IServerCallback
_bc.getItemCatalogService().getCatalogItemDefinition(defId, 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 defId = "sword001";
_bc.itemCatalog.getCatalogItemDefinition(defId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var defId = "sword001";
ServerResponse result = await _bc.itemCatalogService.getCatalogItemDefinition(defId:defId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var defId = "sword001";
var itemCatalogProxy = bridge.getItemCatalogServiceProxy();
var postResult = itemCatalogProxy.getCatalogItemDefinition(defId);
if (postResult.status == 200) {
// Success!
}
{
"service": "itemCatalog",
"operation": "GET_CATALOG_ITEM_DEFINITION",
"data": {
"defId": "sword001"
}
}
JSON Response
{
"data": {
"defId": "boost_rapidfire",
"name": "Rapid Fire",
"desc": "Rapid fire for the next match.",
"type": "ITEM",
"category": "boost",
"tags": null,
"buyPrice": {
"coins": 200
},
"sellPrice": {
"coins": 400
},
"image": null,
"resourceGroup": null,
"resourceTag": null,
"meta": {},
"initData": {},
"pState": "PUBLISHED",
"publishedAt": 1566850042148,
"createdAt": 1566849704195,
"updatedAt": 1566850232538,
"version": 4,
"stackable": false,
"consumable": false,
"uses": null,
"coolDownSecs": 0,
"recoverySecs": 0,
"activatable": true,
"statusName": "boosted",
"activeSecs": 900000,
"tradable": true,
"blockchain": false,
"blockchainDefId": null
},
"status": 200
}