fix api tests
parent
8b3151db53
commit
db1222d0d5
|
@ -77,3 +77,9 @@
|
||||||
+ `BLUFOR`
|
+ `BLUFOR`
|
||||||
+ `OPFOR`
|
+ `OPFOR`
|
||||||
+ `NONE`
|
+ `NONE`
|
||||||
|
+ vehicleClass: `LIGHT` (enum, required) - class of shot vehicle
|
||||||
|
+ Members
|
||||||
|
+ `LIGHT`
|
||||||
|
+ `HEAVY`
|
||||||
|
+ `AIR`
|
||||||
|
+ `UNKNOWN`
|
||||||
|
|
|
@ -7,7 +7,9 @@ Basic player statistic information object
|
||||||
+ fraction: `OPFOR` (string, required) - fraction of the player
|
+ fraction: `OPFOR` (string, required) - fraction of the player
|
||||||
+ kill: 5 (number, required) - sum of kills
|
+ kill: 5 (number, required) - sum of kills
|
||||||
+ friendlyFire: 0 (number, required) - sum of friendly fire kills
|
+ friendlyFire: 0 (number, required) - sum of friendly fire kills
|
||||||
+ vehicle: 1 (number, required) - sum of vehicle kills
|
+ vehicleLight: 1 (number, required) - sum of light vehicle kills
|
||||||
|
+ vehicleHeavy: 1 (number, required) - sum of heavy vehicle kills
|
||||||
|
+ vehicleAir: 0 (number, required) - sum of air vehicle kills
|
||||||
+ death: 3 (number, required) - sum of deaths
|
+ death: 3 (number, required) - sum of deaths
|
||||||
+ respawn: 2 (number, required) - sum of respawns
|
+ respawn: 2 (number, required) - sum of respawns
|
||||||
+ flagTouch: 1 (number, required) - sum of flag captures
|
+ flagTouch: 1 (number, required) - sum of flag captures
|
||||||
|
|
|
@ -12,7 +12,9 @@ Every highscore player object contains a field *sum*, representing its order num
|
||||||
+ kill (array[HighscorePlayer],required) - player highscore for kill
|
+ kill (array[HighscorePlayer],required) - player highscore for kill
|
||||||
+ death (array[HighscorePlayer],required) - player highscore for death
|
+ death (array[HighscorePlayer],required) - player highscore for death
|
||||||
+ friendlyFire (array[HighscorePlayer],required) - player highscore for friendly fire
|
+ friendlyFire (array[HighscorePlayer],required) - player highscore for friendly fire
|
||||||
+ vehicle (array[HighscorePlayer],required) - player highscore for vehicle
|
+ vehicleLight (array[HighscorePlayer],required) - player highscore for light vehicle
|
||||||
|
+ vehicleHeavy (array[HighscorePlayer],required) - player highscore for heavy vehicle
|
||||||
|
+ vehicleAir (array[HighscorePlayer],required) - player highscore for air vehicle
|
||||||
+ revive (array[HighscorePlayer],required) - player highscore for revive
|
+ revive (array[HighscorePlayer],required) - player highscore for revive
|
||||||
+ respawn (array[HighscorePlayer],required) - player highscore for respawn
|
+ respawn (array[HighscorePlayer],required) - player highscore for respawn
|
||||||
+ flagTouch (array[HighscorePlayer],required) - player highscore for flag captures
|
+ flagTouch (array[HighscorePlayer],required) - player highscore for flag captures
|
||||||
|
|
|
@ -27,7 +27,7 @@ const LogVehicleKillSchema = new Schema({
|
||||||
},
|
},
|
||||||
vehicleClass: {
|
vehicleClass: {
|
||||||
type: String,
|
type: String,
|
||||||
enum: ['LIGHT', 'HEAVY', 'AIR', "UNKNOWN"],
|
enum: ['LIGHT', 'HEAVY', 'AIR', 'UNKNOWN'],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
|
|
@ -5,10 +5,10 @@ const playerArrayContains = require('./util').playerArrayContains;
|
||||||
const WHITESPACE = ' ';
|
const WHITESPACE = ' ';
|
||||||
|
|
||||||
const VehicleClasses = Object.freeze({
|
const VehicleClasses = Object.freeze({
|
||||||
LIGHT: "Leicht",
|
LIGHT: 'Leicht',
|
||||||
HEAVY: "Schwer",
|
HEAVY: 'Schwer',
|
||||||
AIR: "Flug",
|
AIR: 'Flug',
|
||||||
UNKNOWN: "Unbekannt"
|
UNKNOWN: 'Unbekannt',
|
||||||
});
|
});
|
||||||
|
|
||||||
const parseWarLog = (lineArray, war) => {
|
const parseWarLog = (lineArray, war) => {
|
||||||
|
@ -204,7 +204,7 @@ const parseWarLog = (lineArray, war) => {
|
||||||
|
|
||||||
stats.players[i]['kill'] = stats.kills.filter((kill) => kill.shooter === playerName && !kill.friendlyFire).length;
|
stats.players[i]['kill'] = stats.kills.filter((kill) => kill.shooter === playerName && !kill.friendlyFire).length;
|
||||||
|
|
||||||
//TODO: use vehicle class description from enum
|
// TODO: use vehicle class description from enum
|
||||||
stats.players[i]['vehicleLight'] = stats.vehicles.filter(
|
stats.players[i]['vehicleLight'] = stats.vehicles.filter(
|
||||||
(vehicle) => vehicle.shooter === playerName && vehicle.vehicleClass === 'LIGHT' &&
|
(vehicle) => vehicle.shooter === playerName && vehicle.vehicleClass === 'LIGHT' &&
|
||||||
VEHICLE_BLACKLIST.indexOf(vehicle.target) < 0).length;
|
VEHICLE_BLACKLIST.indexOf(vehicle.target) < 0).length;
|
||||||
|
@ -316,10 +316,6 @@ const transformMoneyString = (budgetString) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getFullTimeDate = (date, timeString) => {
|
const getFullTimeDate = (date, timeString) => {
|
||||||
|
|
||||||
console.log(date)
|
|
||||||
console.log(timeString)
|
|
||||||
|
|
||||||
const returnDate = new Date(date);
|
const returnDate = new Date(date);
|
||||||
const time = timeString.split(':');
|
const time = timeString.split(':');
|
||||||
returnDate.setHours(time[0]);
|
returnDate.setHours(time[0]);
|
||||||
|
|
Loading…
Reference in New Issue