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"); } } }
// 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); }