查询道具
查询玩家邮箱中保管的道具信息。
调用信息
public void Items (string tableCode, PlayNANOODelegate callback);
调用详细信息
| 参数 | 说明 | 类型 |
|---|---|---|
| tableCode | 表代码 | string |
| callback | 通信结果 | PlayNANOODelegate |
源代码
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
string tableCode = "TABLE_CODE";
plugin.InboxManager.Items(tableCode, (status, error, jsonString, values) =>
{
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
foreach (Dictionary<string, object> value in (ArrayList)values["Items"])
{
Debug.Log(value["Type"]);
Debug.Log(value["ItemKey"]);
Debug.Log(value["ExpireSec"]);
PlayNANOO.Inbox.ItemValueModel[] items = value["Items"] as PlayNANOO.Inbox.ItemValueModel[];
foreach (PlayNANOO.Inbox.ItemValueModel item in items)
{
Debug.Log(item.item_code);
Debug.Log(item.item_count);
}
PlayNANOO.Inbox.MessageValueModel[] messages = value["Messages"] as PlayNANOO.Inbox.MessageValueModel[];
foreach (PlayNANOO.Inbox.MessageValueModel message in messages)
{
Debug.Log(message.language);
Debug.Log(message.title);
Debug.Log(message.content);
}
}
}
else
{
Debug.Log("Fail");
}
});
}
}
通信结果
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"items": [
{
"type": "item",
"item_key": "itemKey",
"items": [
{
"item_code": "gold",
"item_count": 100
}
],
"messages": [
{
"language": "default",
"title": "hello",
"content": "hello world"
}
],
"expire_sec": 3600
}
]
}
通信结果详细信息
| 数据键 | 说明 | 类型 |
|---|---|---|
| type | 道具发放类型 event : 活动发放道具 item : 基础道具 | string |
| item_key | 道具识别键 | string |
| items.item_code | 道具代码 | string |
| items.item_count | 道具数量 | integer |
| messages.language | 消息语言代码 | string |
| messages.title | 消息标题 | string |
| messages.content | 消息正文 | string |
| expire_sec | 道具过期时间 过期时间以秒为单位提供。 | integer |