跳转到主要内容

批量查询玩家数据

查询其他玩家数据。

调用信息

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 { PlayerId = "PLAYER_ID_1", StorageKey = "STORAGE_KEY_1" });
multiLoadParam.Items.Add(new PlayNANOO.Storage.MultiLoadParamValue { PlayerId = "PLAYER_ID_2", StorageKey = "STORAGE_KEY_2" });

plugin.Storage.MultiPlayerDataLoad(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玩家IDstring
Items.StorageKey存储数据键string
Items.StorageValue存储数据信息string