private static void OnUserLogin(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { var catalogRequest = new ServerModels.GetCatalogItemsRequest(); PlayFabServerAPI.GetCatalogItems(catalogRequest, GetCatalogCallback, PfSharedControllerEx.FailCallback("GetCatalogItems")); GetUserInventory(playFabId); }
public void UpdateInvDisplay(PfSharedControllerEx.Api inv) { PfSharedControllerEx.sb.Length = 0; if (inv == PfSharedControllerEx.Api.Client && clientUserItems != null) { for (int i = 0; i < clientUserItems.Count; i++) { if (i != 0) { PfSharedControllerEx.sb.Append(", "); } PfSharedControllerEx.sb.Append(clientUserItems[i].DisplayName); } } else if (serverUserItems != null) { for (int i = 0; i < serverUserItems.Count; i++) { if (i != 0) { PfSharedControllerEx.sb.Append(", "); } PfSharedControllerEx.sb.Append(serverUserItems[i].DisplayName); } } userInvDisplay = PfSharedControllerEx.sb.ToString(); }
private static void OnInventoryChanged(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { if (!requiresFullRefresh && (eventSourceApi & PfSharedControllerEx.Api.Client) == PfSharedControllerEx.Api.Client) { return; // Don't need to handle this event } if (string.IsNullOrEmpty(characterId)) { // Reload the user inventory GetUserInventory(); } else { // Reload the character inventory CharacterModel tempCharacter; if (!PfSharedModelEx.globalClientUser.clientCharacterModels.TryGetValue(characterId, out tempCharacter)) { return; } PfInvClientChar eachCharacter = tempCharacter as PfInvClientChar; if (eachCharacter == null || eachCharacter.inventory == null) { return; } eachCharacter.GetInventory(); } }
private static void OnUserLogin(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { GetUserData(); GetUserReadOnlyData(); GetUserPublisherData(); GetUserPublisherReadOnlyData(); }
private static void OnCatalogLoaded(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { // Find the designated trade target item foreach (var catalogPair in PfSharedModelEx.clientCatalog) { if (catalogPair.Value.DisplayName.ToLower().Contains(PfSharedModelEx.SWILL_NAME.ToLower())) { PfSharedModelEx.swillItemId = catalogPair.Key; } } }
private static void OnVcChanged(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { if (!requiresFullRefresh) { return; } if (characterId == null) // Reload the user inventory { GetUserVc(); } else // Reload the character inventory { GetCharacterVc(characterId); } }
private static void OnVcChanged(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { UserModel updatedUser; if (!requiresFullRefresh || !PfSharedModelEx.serverUsers.TryGetValue(playFabId, out updatedUser)) { return; } if (characterId == null) { // Reload the user VC GetUserVc(playFabId); } else { // Reload the character VC GetCharacterVc(playFabId, characterId); } }
private static void OnUserCharactersLoaded(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { if (eventSourceApi != PfSharedControllerEx.Api.Server) { return; } UserModel updatedUser; if (PfSharedModelEx.serverUsers.TryGetValue(playFabId, out updatedUser)) { GetCharacterVc(playFabId, characterId); } }
// The static constructor is called as a by-product of this call } private static void OnUserLogin(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { // Reload the user VC GetUserVc(playFabId); }
private static void OnUserCharactersLoaded(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { if (eventSourceApi != PfSharedControllerEx.Api.Server) { return; } UserModel updatedUser; CharacterModel charModel; if (PfSharedModelEx.serverUsers.TryGetValue(playFabId, out updatedUser) && updatedUser.serverCharacterModels.TryGetValue(characterId, out charModel)) { ((PfInvServerChar)charModel).GetInventory(); } }
private static void OnUserCharactersLoaded(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { if (eventSourceApi == PfSharedControllerEx.Api.Client) { GetCharacterVc(characterId); } }
private static void OnUserCharactersLoaded(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { if (eventSourceApi != PfSharedControllerEx.Api.Client) { return; } // Cannot get character statistics on the client right now }
private static void OnUserLogin(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { GetUserStatistics(); }
private static void OnUserCharactersLoaded(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh) { if (eventSourceApi != PfSharedControllerEx.Api.Client) { return; } CharacterModel charModel; if (PfSharedModelEx.globalClientUser.clientCharacterModels.TryGetValue(characterId, out charModel)) { ((PfInvClientChar)charModel).GetInventory(); } }