Compare commits

..

1 Commits

7 changed files with 16 additions and 41 deletions

View File

@ -85,7 +85,6 @@
+ `LIGHT` + `LIGHT`
+ `HEAVY` + `HEAVY`
+ `AIR` + `AIR`
+ `BOAT`
+ `UNKNOWN` + `UNKNOWN`
+ shooterVehicle: `FV-720 Mora` (string, optional) - vehicle in whiock the shooting player sat + shooterVehicle: `FV-720 Mora` (string, optional) - vehicle in whiock the shooting player sat
+ magazine: `30 mm APFSDS` (string, optional) - magazine name used to execute the kill + magazine: `30 mm APFSDS` (string, optional) - magazine name used to execute the kill

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -30,7 +30,7 @@ const LogVehicleKillSchema = new Schema({
}, },
vehicleClass: { vehicleClass: {
type: String, type: String,
enum: ['LIGHT', 'HEAVY', 'AIR', 'BOAT', 'UNKNOWN'], enum: ['LIGHT', 'HEAVY', 'AIR', 'UNKNOWN'],
required: true, required: true,
}, },
magazine: { magazine: {

View File

@ -42,12 +42,6 @@ const PlayerSchema = new Schema({
set: (v) => Math.round(v), set: (v) => Math.round(v),
required: true, required: true,
}, },
vehicleBoat: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
death: { death: {
type: Number, type: Number,
get: (v) => Math.round(v), get: (v) => Math.round(v),

View File

@ -172,11 +172,6 @@ wars.route('/:id')
return next(err); return next(err);
} }
// TODO: temp solution for CC-93 - add boat kills to light vehicle kills until FE available
items.forEach((player) => {
player.vehicleLight = player.vehicleLight + player.vehicleBoat;
});
const responseObj = item.toObject(); const responseObj = item.toObject();
responseObj.players = items; responseObj.players = items;
res.locals.items = responseObj; res.locals.items = responseObj;

View File

@ -8,7 +8,6 @@ const VehicleClasses = Object.freeze({
LIGHT: 'Leicht', LIGHT: 'Leicht',
HEAVY: 'Schwer', HEAVY: 'Schwer',
AIR: 'Flug', AIR: 'Flug',
BOAT: 'Boot',
UNKNOWN: 'Unbekannt', UNKNOWN: 'Unbekannt',
}); });
@ -74,8 +73,6 @@ const parseWarLog = (lineArray, war) => {
'Tempest-Transporter', 'Tempest-Transporter (abgedeckt)', 'Tempest Sanitätsfahrzeug', 'Tempest-Transporter', 'Tempest-Transporter (abgedeckt)', 'Tempest Sanitätsfahrzeug',
'Remote Designator [CSAT]', 'UBF Saif', 'Remote Designator [CSAT]', 'UBF Saif',
'Quad Bike', 'HuntIR', 'Offroad', 'Quad Bike', 'HuntIR', 'Offroad',
// boats
'RHIB', 'Kampfboot', 'SDV',
]; ];
const addPlayerIfNotExists = (inputPlayer, steamUUID) => { const addPlayerIfNotExists = (inputPlayer, steamUUID) => {
@ -83,10 +80,6 @@ const parseWarLog = (lineArray, war) => {
if (player && player.name && player.fraction && !playerArrayContains(stats.players, player)) { if (player && player.name && player.fraction && !playerArrayContains(stats.players, player)) {
player['warId'] = war._id; player['warId'] = war._id;
player['steamUUID'] = steamUUID; player['steamUUID'] = steamUUID;
player['vehicleLight'] = 0;
player['vehicleHeavy'] = 0;
player['vehicleAir'] = 0;
player['vehicleBoat'] = 0;
stats.players.push(player); stats.players.push(player);
} }
}; };
@ -342,27 +335,21 @@ const parseWarLog = (lineArray, war) => {
stats.players[i]['kill'] = stats.kills.filter( stats.players[i]['kill'] = stats.kills.filter(
(kill) => kill.shooter === playerName && !kill.friendlyFire).length; (kill) => kill.shooter === playerName && !kill.friendlyFire).length;
stats.vehicles // TODO: use vehicle class description from enum
.filter((vehicle) => VEHICLE_BLACKLIST.indexOf(vehicle.target) < 0) stats.players[i]['vehicleLight'] = stats.vehicles.filter(
.forEach((vehicle) => { (vehicle) => (vehicle.shooter === playerName ||
if (vehicle.shooter === playerName || (vehicle.additionalShooter && vehicle.additionalShooter.indexOf(playerName)) > -1) && vehicle.vehicleClass ===
(vehicle.additionalShooter && vehicle.additionalShooter.indexOf(playerName)) > -1) { 'LIGHT' && VEHICLE_BLACKLIST.indexOf(vehicle.target) < 0).length;
switch (vehicle.vehicleClass) {
case 'LIGHT': stats.players[i]['vehicleHeavy'] = stats.vehicles.filter(
stats.players[i].vehicleLight++; (vehicle) => (vehicle.shooter === playerName ||
break; (vehicle.additionalShooter && vehicle.additionalShooter.indexOf(playerName)) > -1) && vehicle.vehicleClass ===
case 'HEAVY': 'HEAVY' && VEHICLE_BLACKLIST.indexOf(vehicle.target) < 0).length;
stats.players[i].vehicleHeavy++;
break; stats.players[i]['vehicleAir'] = stats.vehicles.filter(
case 'AIR': (vehicle) => (vehicle.shooter === playerName ||
stats.players[i].vehicleAir++; (vehicle.additionalShooter && vehicle.additionalShooter.indexOf(playerName)) > -1) && vehicle.vehicleClass ===
break; 'AIR' && VEHICLE_BLACKLIST.indexOf(vehicle.target) < 0).length;
case 'BOAT':
stats.players[i].vehicleBoat++;
break;
}
}
});
stats.players[i]['friendlyFire'] = stats.kills.filter( stats.players[i]['friendlyFire'] = stats.kills.filter(
(kill) => kill.shooter === playerName && kill.friendlyFire).length; (kill) => kill.shooter === playerName && kill.friendlyFire).length;