public void RegisterVehicleDestroyed(VehicleDestroyedEventRecord record) { if (record.destroyedVehicle.Type?.InnerString != PS2APIConstants.TurretVehicleTypeId) { if (record.attacker.Id == record.victim.Id) { _stat.VehiclesSelfDestroyed++; } else if (record.attacker.Id == CharacterId) { if (record.victim.Faction != record.attacker.Faction) { _stat.VehiclesDestroyed++; } else { _stat.TeamVehiclesDestroyed++; } if (!string.IsNullOrEmpty(record.victim.Outfit) && record.victim.Outfit == record.attacker.Outfit) { _stat.OutfitVehiclesDestroyed++; } } if (record.victim.Id == CharacterId) { _stat.VehiclesLost++; } } Events.Add(record); }
public void Handle(VehicleDestroyedEventRecord record) { PlayerStats person; if (record.attacker.Id != null && Players.TryGetValue(record.attacker.Id, out person)) { lock (person) person.RegisterVehicleDestroyed(record); } if (record.victim.Id != null && record.victim.Id != record.attacker.Id && Players.TryGetValue(record.victim.Id, out person)) { lock (person) person.RegisterVehicleDestroyed(record); } }