Esempio n. 1
0
        private void _handleBountyIncurredEvent(BountyIncurredEvent @event)
        {
            int    shipId        = EDDI.Instance?.CurrentShip?.LocalId ?? 0;
            Crime  crime         = Crime.FromEDName(@event.crimetype);
            string currentSystem = EDDI.Instance?.CurrentStarSystem?.systemname;

            // Get victim allegiance from the 'Ship targeted' data
            Target target = shipTargets.FirstOrDefault(t => t.name == @event.victim);

            FactionReport report = new FactionReport(@event.timestamp, true, shipId, crime, currentSystem, @event.bounty)
            {
                station          = EDDI.Instance?.CurrentStation?.name,
                body             = EDDI.Instance?.CurrentStellarBody?.bodyname,
                victim           = @event.victim,
                victimAllegiance = (target?.Allegiance ?? Superpower.None).invariantName
            };

            FactionRecord record = GetRecordWithFaction(@event.faction);

            if (record == null)
            {
                record = AddRecord(@event.faction);
            }
            AddCrimeToRecord(record, report);
        }
Esempio n. 2
0
 private void handleBountyIncurredEvent(BountyIncurredEvent @event)
 {
     if (@event.timestamp > updateDat)
     {
         updateDat = @event.timestamp;
         _handleBountyIncurredEvent(@event);
         writeRecord();
     }
 }
Esempio n. 3
0
 private void handleBountyIncurredEvent(BountyIncurredEvent @event)
 {
     if (@event.timestamp > updateDat || (@event.timestamp == updateDat && [email protected]))
     {
         updateDat = @event.timestamp;
         _handleBountyIncurredEvent(@event);
         writeRecord();
     }
 }
Esempio n. 4
0
        private void _handleBountyIncurredEvent(BountyIncurredEvent @event)
        {
            crimeAuthorityFaction = @event.faction;
            var crime         = Crime.FromEDName(@event.crimetype);
            var currentSystem = EDDI.Instance?.CurrentStarSystem?.systemname;

            // Get victim allegiance from the 'Ship targeted' data
            var target = shipTargets.FirstOrDefault(t => t.name == @event.victim);

            // Create a bounty report and add it to our record
            var report = new FactionReport(@event.timestamp, true, crime, currentSystem, @event.bounty)
            {
                station          = EDDI.Instance?.CurrentStation?.name,
                body             = EDDI.Instance?.CurrentStellarBody?.bodyname,
                victim           = @event.victim,
                victimAllegiance = (target?.Allegiance ?? Superpower.None).invariantName
            };
            var record = GetRecordWithFaction(@event.faction)
                         ?? AddRecord(@event.faction);

            AddReportToRecord(record, report);
        }