internal void AcceptedMission(MissionDetails deets)
        {
            this.IncrementStat("Missions - Accepted", 1);
            this.IncrementStat($"Missions - Accepted - {deets.Faction}", 1);
            this.ValueStat("Missions - Factions", deets.Faction);

            missionList.Add(deets);
        }
        internal void CompletedMission(MissionDetails deets)
        {
            var origMission = missionList.Where(p => p.MissionId == deets.MissionId).FirstOrDefault();

            if (origMission != null)
            {
                this.IncrementStat("Missions - Completed", 1);
                this.IncrementStat($"Missions - Completed - {deets.Faction}", 1);

                if (deets.FactionEffects.Any())
                {
                    if (deets.FactionEffects.Any(p => p.Influence.Any()))
                    {
                        foreach (var factEffect in deets.FactionEffects)
                        {
                            if (!string.IsNullOrEmpty(factEffect.Reputation))
                            {
                                var repNum = factEffect.Reputation.Length;
                                if (!factEffect.ReputationTrend.StartsWith("Up"))
                                {
                                    repNum = -repNum;
                                }

                                this.IncrementStat($"Missions - FactionRep - {factEffect.Faction}", repNum);
                            }
                            foreach (var infEffect in factEffect.Influence)
                            {
                                // Based on infEffect
                                {
                                    var infNum = infEffect.InfluenceInfluence.Length;
                                    if (!infEffect.Trend.StartsWith("Up"))
                                    {
                                        infNum = -infNum;
                                    }

                                    this.IncrementStat($"Missions - FactionInfluence - {factEffect.Faction} - SystemAddress:{infEffect.SystemAddress}", infNum);
                                }
                                // Based on initial mission inf
                                {
                                    var infNum = origMission.Influence.Length;
                                    if (!infEffect.Trend.StartsWith("Up"))
                                    {
                                        infNum = -infNum;
                                    }

                                    this.IncrementStat($"Missions - FactionInfluence2 - {factEffect.Faction} - SystemAddress:{infEffect.SystemAddress}", infNum);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                // ?
            }
        }
예제 #3
0
        private static void Events_MissionAbandonedEvent(object sender, EliteAPI.Events.MissionAbandonedInfo e)
        {
            var session = currentSessions.StartedMissionRunning(e.Timestamp, EventReasons.MissionAbandoned);
            var deets   = new MissionDetails()
            {
                MissionId = e.MissionId,
                Timestamp = e.Timestamp,
            };

            session.AbandonedMission(deets);
        }
        internal void AbandonedMission(MissionDetails deets)
        {
            var origMission = missionList.Where(p => p.MissionId == deets.MissionId).FirstOrDefault();

            if (origMission != null)
            {
                this.IncrementStat("Missions - Abandoned", 1);
            }
            else
            {
                // ?
            }
        }
예제 #5
0
        private static void Events_MissionCompletedEvent(object sender, EliteAPI.Events.MissionCompletedInfo e)
        {
            var session = currentSessions.StartedMissionRunning(e.Timestamp, EventReasons.MissionCompleted);
            var deets   = new MissionDetails()
            {
                MissionId     = e.MissionId,
                Faction       = e.Faction,
                TargetFaction = e.TargetFaction,
                //DestinationSystem = e.DestinationSystem,
                //DestinationStation = e.DestinationStation,
                FactionEffects  = e.FactionEffects,
                MaterialsReward = e.MaterialsReward,
                Timestamp       = e.Timestamp,
            };

            session.CompletedMission(deets);
        }
예제 #6
0
        private static void Events_MissionAcceptedEvent(object sender, EliteAPI.Events.MissionAcceptedInfo e)
        {
            var session = currentSessions.StartedMissionRunning(e.Timestamp, EventReasons.MissionAccepted);
            var deets   = new MissionDetails()
            {
                MissionId = e.MissionId,
                Faction   = e.Faction,
                Expiry    = e.Expiry,
                //DestinationSystem = e.DestinationSystem,
                //DestinationStation = e.DestinationStation,
                PassengerCount = e.PassengerCount,
                CommodityName  = e.CommodityLocalised,
                CommodityCount = e.Count,
                Timestamp      = e.Timestamp,
                Influence      = e.Influence,
                Reputation     = e.Reputation,
            };

            session.AcceptedMission(deets);
        }