批量查询数据
查询玩家本人数据。
调用信息
public void MultiPlayerDataLoad (MultiLoadParam storageKeys, PlayNANOODelegate callback) {}
调用详细信息
| 参数 | 说明 | 类型 |
|---|---|---|
| storageKeys | 玩家数据列表 | MultiLoadParam |
| callback | 通信结果 | PlayNANOODelegate |
源代码
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
PlayNANOO.Storage.MultiLoadParam multiLoadParam = new PlayNANOO.Storage.MultiLoadParam();
multiLoadParam.Items.Add(new PlayNANOO.Storage.MultiLoadParamValue { StorageKey = "STORAGE_KEY_1" });
multiLoadParam.Items.Add(new PlayNANOO.Storage.MultiLoadParamValue { StorageKey = "STORAGE_KEY_2" });
plugin.Storage.MultiLoad(multiLoadParam, (status, error, jsonString, values) => {
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
foreach (Dictionary<string, object> value in (ArrayList)values["Items"])
{
Debug.Log(value["PlayerId"]);
Debug.Log(value["StorageKey"]);
Debug.Log(value["StorageValue"]);
}
}
else
{
Debug.Log("Fail");
}
});
}
}
通信结果
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"Items" : [
{
"PlayerId" : "String",
"StorageKey" : "String",
"StorageValue" : "String"
}
]
}
结果详细信息
| 数据键 | 说明 | 类型 |
|---|---|---|
| Items.PlayerId | 玩家ID | string |
| Items.StorageKey | 存储数据键 | string |
| Items.StorageValue | 存储数据信息 | string |