private void PrecacheMissionChances() { IEnumerator enumerator = PersistentMissionData.missionDictionary.get_Values().GetEnumerator(); try { while (enumerator.MoveNext()) { JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)enumerator.get_Current(); GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(jamGarrisonMobileMission.MissionRecID); if (record.GarrFollowerTypeID == 4u) { if (jamGarrisonMobileMission.MissionState == 1) { List <JamGarrisonFollower> list = new List <JamGarrisonFollower>(); using (Dictionary <int, JamGarrisonFollower> .ValueCollection.Enumerator enumerator2 = PersistentFollowerData.followerDictionary.get_Values().GetEnumerator()) { while (enumerator2.MoveNext()) { JamGarrisonFollower current = enumerator2.get_Current(); if (current.CurrentMissionID == jamGarrisonMobileMission.MissionRecID) { list.Add(current); } } } MobilePlayerEvaluateMission mobilePlayerEvaluateMission = new MobilePlayerEvaluateMission(); mobilePlayerEvaluateMission.GarrMissionID = jamGarrisonMobileMission.MissionRecID; mobilePlayerEvaluateMission.GarrFollowerID = new int[list.get_Count()]; int num = 0; using (List <JamGarrisonFollower> .Enumerator enumerator3 = list.GetEnumerator()) { while (enumerator3.MoveNext()) { JamGarrisonFollower current2 = enumerator3.get_Current(); mobilePlayerEvaluateMission.GarrFollowerID[num++] = current2.GarrFollowerID; } } Login.instance.SendToMobileServer(mobilePlayerEvaluateMission); } } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public void UpdateMissionStatus(int garrMissionID) { MissionMechanic[] componentsInChildren = this.enemyPortraitsGroup.GetComponentsInChildren <MissionMechanic>(true); if (componentsInChildren == null) { return; } for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].SetCountered(false, false, true); } AbilityDisplay[] componentsInChildren2 = this.enemyPortraitsGroup.GetComponentsInChildren <AbilityDisplay>(true); if (componentsInChildren2 == null) { return; } for (int j = 0; j < componentsInChildren2.Length; j++) { componentsInChildren2[j].SetCountered(false, true); } MissionMechanicTypeCounter[] componentsInChildren3 = base.get_gameObject().GetComponentsInChildren <MissionMechanicTypeCounter>(true); if (componentsInChildren3 == null) { return; } for (int k = 0; k < componentsInChildren3.Length; k++) { componentsInChildren3[k].usedIcon.get_gameObject().SetActive(false); for (int l = 0; l < componentsInChildren.Length; l++) { if (componentsInChildren3[k].countersMissionMechanicTypeID == componentsInChildren[l].m_missionMechanicTypeID && !componentsInChildren[l].IsCountered()) { componentsInChildren[l].SetCountered(true, false, false); componentsInChildren2[l].SetCountered(true, false); break; } } } MissionFollowerSlot[] componentsInChildren4 = base.get_gameObject().GetComponentsInChildren <MissionFollowerSlot>(true); List <JamGarrisonFollower> list = new List <JamGarrisonFollower>(); for (int m = 0; m < componentsInChildren4.Length; m++) { int currentGarrFollowerID = componentsInChildren4[m].GetCurrentGarrFollowerID(); if (PersistentFollowerData.followerDictionary.ContainsKey(currentGarrFollowerID)) { JamGarrisonFollower jamGarrisonFollower = PersistentFollowerData.followerDictionary.get_Item(currentGarrFollowerID); list.Add(jamGarrisonFollower); } } int chance = -1000; if (MissionDataCache.missionDataDictionary.ContainsKey(this.m_garrMissionID)) { chance = (int)MissionDataCache.missionDataDictionary.get_Item(this.m_garrMissionID); } else { MobilePlayerEvaluateMission mobilePlayerEvaluateMission = new MobilePlayerEvaluateMission(); mobilePlayerEvaluateMission.GarrMissionID = garrMissionID; mobilePlayerEvaluateMission.GarrFollowerID = new int[list.get_Count()]; int num = 0; using (List <JamGarrisonFollower> .Enumerator enumerator = list.GetEnumerator()) { while (enumerator.MoveNext()) { JamGarrisonFollower current = enumerator.get_Current(); mobilePlayerEvaluateMission.GarrFollowerID[num++] = current.GarrFollowerID; } } Login.instance.SendToMobileServer(mobilePlayerEvaluateMission); } this.OnMissionSuccessChanceChanged(chance); }