Example #1
0
        public void GetJuggernautTrainerFromServer(string trainerUID, int sceneViewID, int recursionCount)
        {
            int       num       = 100;
            Character character = CharacterManager.Instance.GetCharacter(trainerUID);
            bool      flag      = character != null;

            if (flag)
            {
                JuggernautTrainer.SetupTrainerClientSide(character.gameObject, sceneViewID);
            }
            else
            {
                bool flag2 = recursionCount * num < 5000;
                if (flag2)
                {
                    DelayedTask.GetTask(num).ContinueWith(delegate(Task _)
                    {
                        this.GetJuggernautTrainerFromServer(trainerUID, sceneViewID, recursionCount + 1);
                    });
                    Console.Read();
                }
                else
                {
                    Debug.Log("Juggernaut could not fetch trainer ID from Server");
                }
            }
        }
Example #2
0
        // Token: 0x06000005 RID: 5 RVA: 0x000021B0 File Offset: 0x000003B0
        public static GameObject SetupTrainerServerSide()
        {
            string     text       = UID.Generate().ToString();
            int        num        = PhotonNetwork.AllocateSceneViewID();
            GameObject gameObject = CustomCharacters.CreateCharacter(JuggernautTrainer.TrainerLocation, text, "SL_Character", false, null);
            Character  component  = gameObject.GetComponent <Character>();

            At.SetValue <CharacterManager.CharacterInstantiationTypes>(CharacterManager.CharacterInstantiationTypes.Item, typeof(Character), component, "m_instantiationType");
            foreach (int itemID in JuggernautTrainer.TrainerEquipment)
            {
                component.Inventory.Equipment.EquipInstantiate(ResourcesPrefabManager.Instance.GetItemPrefab(itemID) as Equipment);
            }
            component.ChangeFaction(Character.Factions.NONE, true);
            gameObject.SetActive(true);
            bool offlineMode = PhotonNetwork.offlineMode;

            if (offlineMode)
            {
                JuggernautTrainer.SetupTrainerClientSide(gameObject, num);
            }
            else
            {
                RPCManager.Instance.photonView.RPC("GetJuggernautTrainerFromServer", 0, new object[]
                {
                    text.ToString(),
                    num,
                    0
                });
            }
            return(gameObject);
        }
Example #3
0
        // Token: 0x06000004 RID: 4 RVA: 0x0000214C File Offset: 0x0000034C
        public static void OnSceneChange()
        {
            GameObject gameObject = GameObject.Find("UNPC_The Juggernaut");
            bool       flag       = gameObject != null;

            if (flag)
            {
                bool flag2 = SceneManagerHelper.ActiveSceneName != "Berg";
                if (flag2)
                {
                    UnityEngine.Object.DestroyImmediate(gameObject);
                }
            }
            else
            {
                bool flag3 = SceneManagerHelper.ActiveSceneName == "Berg" && !PhotonNetwork.isNonMasterClientInRoom;
                if (flag3)
                {
                    JuggernautTrainer.SetupTrainerServerSide();
                }
            }
        }
 // Token: 0x0600004E RID: 78 RVA: 0x0000395A File Offset: 0x00001B5A
 private void OnSceneLoaded()
 {
     JuggernautTrainer.OnSceneChange();
 }