public virtual void UpdateLocation(CommanderTravelLocation currentLocation)
        {
            // Nothing to see here
            if (currentLocation == null || string.IsNullOrEmpty(currentLocation.SystemName))
            {
                return;
            }

            LocationCurrent = new CommanderTravelLocation()
            {
                SystemName    = currentLocation.SystemName,
                SystemAddress = currentLocation.SystemAddress,
                BodyName      = currentLocation.BodyName,
                MarketId      = currentLocation.MarketId,
            };

            if (LocationStart == null)
            {
                LocationStart = new CommanderTravelLocation()
                {
                    SystemName    = currentLocation.SystemName,
                    SystemAddress = currentLocation.SystemAddress,
                    BodyName      = currentLocation.BodyName,
                    MarketId      = currentLocation.MarketId,
                };
            }
        }
Example #2
0
        private static void Events_SupercruiseEntryEvent(object sender, EliteAPI.Events.SupercruiseEntryInfo e)
        {
            var tmp = new CommanderTravelLocation()
            {
                SystemName    = e.StarSystem,
                SystemAddress = e.SystemAddress,
                BodyName      = currentSessions.CurrentLocation.BodyName,
                BodyType      = currentSessions.CurrentLocation.BodyType,
                MarketId      = null,
            };

            currentSessions.UpdatedLocation(e.Timestamp, tmp, EventReasons.EnteredSupercruise);
            // We're travelling now
            currentSessions.StartedTravelling(e.Timestamp, EventReasons.EnteredSupercruise);

            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedMining(e.Timestamp, EventReasons.EnteredSupercruise);
            }

            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedCombat(e.Timestamp, EventReasons.EnteredSupercruise);
            }

            // We will combine travel and trade in a summary
            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedTrading(e.Timestamp, EventReasons.EnteredSupercruise);
            }
        }
Example #3
0
        private static void Events_FSDJumpEvent(object sender, FSDJumpInfo e)
        {
            var reason = EventReasons.FSDJump;
            var tmp    = new CommanderTravelLocation()
            {
                SystemName    = e.StarSystem,
                SystemAddress = e.SystemAddress,
                BodyName      = e.Body,
                BodyType      = "Star",
                MarketId      = null
            };

            currentSessions.UpdatedLocation(e.Timestamp, tmp, reason);
            if (!currentSessions.IsActivelyTravelling)
            {
                //currentSessions.StartedTravelling(e.Timestamp);
            }

            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedMining(e.Timestamp, reason);
            }

            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedCombat(e.Timestamp, reason);
            }

            // We will combine travel and trade in a summary
            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedTrading(e.Timestamp, reason);
            }
        }
Example #4
0
        private static void Events_DockedEvent(object sender, DockedInfo e)
        {
            var tmp = new CommanderTravelLocation()
            {
                SystemName    = e.StarSystem,
                SystemAddress = e.SystemAddress,
                BodyName      = e.StationName,
                BodyType      = "Station",
                MarketId      = e.MarketId
            };

            currentSessions.UpdatedLocation(e.Timestamp, tmp, EventReasons.Docked);
            currentSessions.StoppedTravelling(e.Timestamp, EventReasons.Docked);

            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedCombat(e.Timestamp, EventReasons.Docked);
            }
            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedExploring(e.Timestamp, EventReasons.Docked);
            }
            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedMining(e.Timestamp, EventReasons.Docked);
            }
            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedScavenging(e.Timestamp, EventReasons.Docked);
            }
        }
        public void UpdatedLocation(DateTime timestamp, CommanderTravelLocation location, string reason)
        {
            this.CurrentLocation = location;
            var travelSession = StartedTravelling(timestamp, reason);

            foreach (var currentSession in CurrentSessions.Where(p => p != null))
            {
                currentSession.UpdateLocation(this.CurrentLocation);
            }
        }
 protected virtual void UpdateEndLocation(CommanderTravelLocation currentLocation)
 {
     if (LocationEnd == null)
     {
         LocationEnd = new CommanderTravelLocation()
         {
             SystemName = LocationCurrent.SystemName,
             BodyName   = LocationCurrent.BodyName,
             MarketId   = LocationCurrent.MarketId,
         };
     }
 }
Example #7
0
        private static void Events_SupercruiseExitEvent(object sender, EliteAPI.Events.SupercruiseExitInfo e)
        {
            var tmp = new CommanderTravelLocation()
            {
                SystemName    = e.StarSystem,
                SystemAddress = e.SystemAddress,
                BodyName      = e.Body,
                BodyType      = e.BodyType,
                MarketId      = null
            };

            currentSessions.UpdatedLocation(e.Timestamp, tmp, EventReasons.ExitedSupercruise);
        }
        public override void UpdateLocation(CommanderTravelLocation currentLocation)
        {
            // Nothing
            if (currentLocation == null || string.IsNullOrEmpty(currentLocation.SystemName))
            {
                return;
            }

            if (LocationStart == null)
            {
                this.ValueStat("Travel - Start", currentLocation.SystemName);
            }

            base.UpdateLocation(currentLocation);

            if (currentLocation.SystemName.HasValue() && (prevSystem == null || !this.prevSystem.Equals(currentLocation.SystemName)))
            {
                this.IncrementStat("Travel - Jumps", 1);
                this.ValueStat("Travel - Systems", currentLocation.SystemName);
            }

            if (currentLocation.BodyName.HasValue() && (prevBody == null || !this.prevBody.Equals(currentLocation.BodyName)))
            {
                if (currentLocation.BodyType.Equals("Station", StringComparison.OrdinalIgnoreCase))
                {
                    this.IncrementStat("Travel - Stations", 1);
                    this.ValueStat("Travel - Stations", currentLocation.BodyName);
                }
                else
                {
                    this.IncrementStat("Travel - Bodies", 1);
                    this.ValueStat("Travel - Bodies", currentLocation.BodyName);
                }
            }

            if (currentLocation.MarketId.HasValue && (!prevMarket.HasValue || !this.prevMarket.Equals(currentLocation.MarketId)))
            {
                this.IncrementStat("Travel - Markets", 1);
                this.ValueStat("Travel - Markets", currentLocation.MarketId.Value);
            }

            this.prevSystem = currentLocation.SystemName;
            this.prevBody   = currentLocation.BodyName;
            this.prevMarket = currentLocation.MarketId;
        }
Example #9
0
        private static void Events_LocationEvent(object sender, EliteAPI.Events.LocationInfo e)
        {
            var reason = EventReasons.ChangedLocation;
            var tmp    = new CommanderTravelLocation()
            {
                SystemName    = e.StarSystem,
                SystemAddress = e.SystemAddress,
                BodyName      = e.Body,
                BodyType      = e.BodyType,
                MarketId      = null,
            };

            currentSessions.UpdatedLocation(e.Timestamp.UtcDateTime, tmp, reason);
            // Should we start travelling?
            if (!currentSessions.IsActivelyTravelling)
            {
                //currentSessions.StartedTravelling(e.Timestamp);
            }
        }
Example #10
0
        private static void Events_UndockedEvent(object sender, EliteAPI.Events.UndockedInfo e)
        {
            currentSessions.StartedTravelling(e.Timestamp, EventReasons.Undocked);
            var tmp = new CommanderTravelLocation()
            {
                SystemName    = currentSessions.CurrentLocation.SystemName,
                SystemAddress = currentSessions.CurrentLocation.SystemAddress,
                BodyName      = e.StationName,
                BodyType      = "Station",
                MarketId      = e.MarketId
            };

            currentSessions.UpdatedLocation(e.Timestamp, tmp, EventReasons.Undocked);

            if (_stopMiningOnFsdJump)
            {
                currentSessions.StoppedTrading(e.Timestamp, EventReasons.Undocked);
            }
        }
 protected override void UpdateEndLocation(CommanderTravelLocation currentLocation)
 {
     base.UpdateEndLocation(currentLocation);
     this.ValueStat("Travel - End", currentLocation.SystemName);
 }
Example #12
0
 internal void RedeemedBountyVoucher(long amount, List <FSDJumpFaction> factions, CommanderTravelLocation currentLocation)
 {
     //  Need to figure how bounty vouchers effect anything
     this.IncrementStat($"Combat - Bounty Vouchers", amount);
     if (currentLocation.BodyType.Equals("Station", StringComparison.OrdinalIgnoreCase))
     {
         this.IncrementStat($"Combat - Bounty Vouchers - {currentLocation.SystemName} - {currentLocation.BodyName}", amount);
     }
     else
     {
         this.IncrementStat($"Combat - Bounty Vouchers - {currentLocation.SystemName} - MarketId:{currentLocation.MarketId}", amount);
     }
 }