示例#1
0
        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);
        }
示例#2
0
 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();
 }
示例#3
0
        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();
            }
        }
示例#4
0
        private static void OnUserLogin(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh)
        {
            GetUserData();
            GetUserReadOnlyData();

            GetUserPublisherData();
            GetUserPublisherReadOnlyData();
        }
示例#5
0
 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);
            }
        }
示例#7
0
        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);
            }
        }
示例#8
0
        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);
            }
        }
示例#9
0
        // 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);
        }
示例#10
0
        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();
            }
        }
示例#11
0
 private static void OnUserCharactersLoaded(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh)
 {
     if (eventSourceApi == PfSharedControllerEx.Api.Client)
     {
         GetCharacterVc(characterId);
     }
 }
示例#12
0
        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
        }
示例#13
0
 private static void OnUserLogin(string playFabId, string characterId, PfSharedControllerEx.Api eventSourceApi, bool requiresFullRefresh)
 {
     GetUserStatistics();
 }
示例#14
0
        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();
            }
        }