Beispiel #1
0
        /// <summary>
        /// Log the status of all battlefronts. , bool forceDefaultRealm = false ignored in lower tier.
        /// </summary>
        public void LockBattleFrontsAllRegions(int tier, bool forceDefaultRealm = false)
        {
            foreach (var regionMgr in RegionMgrs)
            {
                if (regionMgr.GetTier() == tier)
                {
                    // Find and update the status of the battlefront status (list of BFStatuses is only for this Tier)
                    foreach (var apocBattleFrontStatus in BattleFrontStatuses)
                    {
                        apocBattleFrontStatus.Locked            = true;
                        apocBattleFrontStatus.OpenTimeStamp     = FrameWork.TCPManager.GetTimeStamp();
                        apocBattleFrontStatus.LockingRealm      = (Realms)BattleFrontProgressions.Single(x => x.BattleFrontId == apocBattleFrontStatus.BattleFrontId).LastOwningRealm;
                        apocBattleFrontStatus.FinalVictoryPoint = new VictoryPointProgress();
                        apocBattleFrontStatus.LockTimeStamp     = FrameWork.TCPManager.GetTimeStamp();
                    }

                    if (regionMgr.Campaign == null)
                    {
                        continue;
                    }

                    regionMgr.Campaign.VictoryPointProgress = new VictoryPointProgress();


                    foreach (var objective in regionMgr.Campaign.Objectives)
                    {
                        objective.OwningRealm = (Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.LastOwningRealm;

                        objective.SetObjectiveLocked();
                        ProgressionLogger.Debug($" Locking BattlefieldObjective to {(Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.LastOwningRealm} {objective.Name} {objective.State} {objective.State}");
                    }
                }
            }
        }
        /// <summary>
        /// Sets up the Battlefront status list with default values.
        /// </summary>
        /// <param name="battleFrontProgressions"></param>
        private void BuildApocBattleFrontStatusList(List <RVRProgression> battleFrontProgressions)
        {
            lock (LockObject)
            {
                BattleFrontStatuses.Clear();
                foreach (var battleFrontProgression in battleFrontProgressions)
                {
                    // Keeps for this region.
                    var keeps = BattleFrontService.GetZoneKeeps(battleFrontProgression.RegionId, battleFrontProgression.ZoneId);
                    // BattleFront Objectives for this region.
                    var battlefieldObjectives = BattleFrontService.GetZoneBattlefrontObjectives(battleFrontProgression.RegionId, battleFrontProgression.ZoneId);

                    BattleFrontStatuses.Add(new BattleFrontStatus(ImpactMatrixManagerInstance, battleFrontProgression.BattleFrontId)
                    {
                        LockingRealm          = (Realms)BattleFrontProgressions.Single(x => x.BattleFrontId == battleFrontProgression.BattleFrontId).LastOwningRealm,
                        FinalVictoryPoint     = new VictoryPointProgress(battleFrontProgression.OrderVP, battleFrontProgression.DestroVP),
                        OpenTimeStamp         = 0,
                        LockTimeStamp         = 0,
                        Locked                = true,
                        RegionId              = battleFrontProgression.RegionId,
                        Description           = battleFrontProgression.Description,
                        ZoneId                = battleFrontProgression.ZoneId,
                        KeepList              = keeps,
                        BattlefieldObjectives = battlefieldObjectives
                    });
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Get the ActiveBattleFront to be Praag if no zones are marked open in rvr_progression, otherwise use the LastOpenedZone
        /// </summary>
        public RVRProgression GetActiveBattleFrontFromProgression()
        {
            ProgressionLogger.Debug($" Getting battlefront progression...");

            var list = BattleFrontProgressions.Select(x => x).Where(x => x.LastOpenedZone == 1).ToList();

            if (list == null || list.Count == 0)
            {
                ActiveBattleFront = GetBattleFrontByName("Norsca");
            }
            else
            {
                ActiveBattleFront = list.FirstOrDefault();
            }

            ProgressionLogger.Debug($"Active : {this.ActiveBattleFrontName}");
            return(ActiveBattleFront);
        }
Beispiel #4
0
 /// <summary>
 /// Sets up the Battlefront status list with default values.
 /// </summary>
 /// <param name="battleFrontProgressions"></param>
 private void BuildApocBattleFrontStatusList(List <RVRProgression> battleFrontProgressions)
 {
     lock (LockObject)
     {
         this.BattleFrontStatuses.Clear();
         foreach (var battleFrontProgression in battleFrontProgressions)
         {
             this.BattleFrontStatuses.Add(new BattleFrontStatus(this.ImpactMatrixManagerInstance, battleFrontProgression.BattleFrontId)
             {
                 LockingRealm      = (Realms)BattleFrontProgressions.Single(x => x.BattleFrontId == battleFrontProgression.BattleFrontId).LastOwningRealm,
                 FinalVictoryPoint = new VictoryPointProgress(battleFrontProgression.OrderVP, battleFrontProgression.DestroVP),
                 OpenTimeStamp     = 0,
                 LockTimeStamp     = 0,
                 Locked            = true,
                 RegionId          = battleFrontProgression.RegionId,
                 Description       = battleFrontProgression.Description
             });
         }
     }
 }
Beispiel #5
0
 public RVRProgression GetBattleFrontByBattleFrontId(int id)
 {
     return(BattleFrontProgressions.Single(x => x.BattleFrontId == id));
 }
Beispiel #6
0
 public RVRProgression GetBattleFrontByName(string name)
 {
     return(BattleFrontProgressions.Single(x => x.Description.Contains(name)));
 }
        /// <summary>
        /// Lock Battlefronts across all the regions.
        /// </summary>
        public void LockBattleFrontsAllRegions(int tier, bool forceDefaultRealm = false)
        {
            foreach (var regionMgr in RegionMgrs)
            {
                if (regionMgr.GetTier() == tier)
                {
                    // Find and update the status of the battlefront status (list of BFStatuses is only for this Tier)
                    foreach (var apocBattleFrontStatus in BattleFrontStatuses)
                    {
                        apocBattleFrontStatus.Locked        = true;
                        apocBattleFrontStatus.OpenTimeStamp = FrameWork.TCPManager.GetTimeStamp();
                        // Determine what the "start" realm this battlefront should be locked to.
                        if (forceDefaultRealm)
                        {
                            apocBattleFrontStatus.LockingRealm = (Realms)BattleFrontProgressions.Single(x => x.BattleFrontId == apocBattleFrontStatus.BattleFrontId).DefaultRealmLock;
                        }
                        else
                        {
                            apocBattleFrontStatus.LockingRealm = (Realms)BattleFrontProgressions.Single(x => x.BattleFrontId == apocBattleFrontStatus.BattleFrontId).LastOwningRealm;
                        }
                        apocBattleFrontStatus.FinalVictoryPoint = new VictoryPointProgress();
                        apocBattleFrontStatus.LockTimeStamp     = FrameWork.TCPManager.GetTimeStamp();
                    }

                    if (regionMgr.Campaign == null)
                    {
                        continue;
                    }

                    regionMgr.Campaign.VictoryPointProgress = new VictoryPointProgress();

                    foreach (var objective in regionMgr.Campaign.Objectives)
                    {
                        if (forceDefaultRealm)
                        {
                            objective.OwningRealm = (Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.DefaultRealmLock;
                        }
                        else
                        {
                            objective.OwningRealm = (Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.LastOwningRealm;
                        }
                        //objective.fsm.Fire(CampaignObjectiveStateMachine.Command.OnLockZone);
                        objective.SetObjectiveLocked();
                        ProgressionLogger.Debug($" Locking BattlefieldObjective to {(Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.LastOwningRealm} {objective.Name} {objective.State} {objective.State}");
                    }

                    foreach (var keep in regionMgr.Campaign.Keeps)
                    {
                        if (forceDefaultRealm)
                        {
                            keep.PendingRealm =
                                (Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.DefaultRealmLock;
                        }
                        else
                        {
                            keep.PendingRealm =
                                (Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.LastOwningRealm;
                        }
                        //keep.fsm.Fire(SM.Command.OnLockZone);
                        keep.SetKeepLocked();
                        ProgressionLogger.Debug($" Locking Keep {keep.Info.Name} to {(Realms)regionMgr.Campaign.BattleFrontManager.ActiveBattleFront.LastOwningRealm} {keep.KeepStatus} ");
                    }
                }
            }
        }