public static string GetUserInventory(string playFabId) { string result = ""; if (!PlayFabClientAPI.IsClientLoggedIn()) { return result; } try { string name = PhotonNetwork.PlayerListOthers.ToList<Player>().Find((Player plyer) => plyer.UserId == playFabId).NickName; GorillaLocalLogs.logger.Log(LogLevel.Info, "Getting items for " + name); PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest { FunctionName = "GetPlayFabUserInventory", FunctionParameter = new { PlayFabId = playFabId } }, delegate(ExecuteCloudScriptResult resultObject) { try { string text = (string)resultObject.FunctionResult; result = text; GorillaLocalLogs.logger.Log(LogLevel.Info, name + "'s items: " + text); } catch (Exception ex2) { GorillaLocalLogs.logger.Log(LogLevel.Error, "Failed to get items: " + ex2.ToString()); } }, delegate(PlayFabError error) { GorillaLocalLogs.logger.Log(LogLevel.Error, string.Concat(new string[] { "Failed to get items for " + name + ": " + error.GenerateErrorReport() })); }, null, null); } catch (Exception ex) { GorillaLocalLogs.logger.Log(LogLevel.Error, "Failed to get items: " + ex.ToString()); } return result; }