fix api tests

pull/33/head
HardiReady 2018-04-15 13:47:48 +02:00
parent 8b3151db53
commit db1222d0d5
5 changed files with 18 additions and 12 deletions

View File

@ -77,3 +77,9 @@
+ `BLUFOR`
+ `OPFOR`
+ `NONE`
+ vehicleClass: `LIGHT` (enum, required) - class of shot vehicle
+ Members
+ `LIGHT`
+ `HEAVY`
+ `AIR`
+ `UNKNOWN`

View File

@ -7,7 +7,9 @@ Basic player statistic information object
+ fraction: `OPFOR` (string, required) - fraction of the player
+ kill: 5 (number, required) - sum of 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
+ respawn: 2 (number, required) - sum of respawns
+ flagTouch: 1 (number, required) - sum of flag captures

View File

@ -12,7 +12,9 @@ Every highscore player object contains a field *sum*, representing its order num
+ kill (array[HighscorePlayer],required) - player highscore for kill
+ death (array[HighscorePlayer],required) - player highscore for death
+ 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
+ respawn (array[HighscorePlayer],required) - player highscore for respawn
+ flagTouch (array[HighscorePlayer],required) - player highscore for flag captures

View File

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

View File

@ -5,10 +5,10 @@ const playerArrayContains = require('./util').playerArrayContains;
const WHITESPACE = ' ';
const VehicleClasses = Object.freeze({
LIGHT: "Leicht",
HEAVY: "Schwer",
AIR: "Flug",
UNKNOWN: "Unbekannt"
LIGHT: 'Leicht',
HEAVY: 'Schwer',
AIR: 'Flug',
UNKNOWN: 'Unbekannt',
});
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;
//TODO: use vehicle class description from enum
// TODO: use vehicle class description from enum
stats.players[i]['vehicleLight'] = stats.vehicles.filter(
(vehicle) => vehicle.shooter === playerName && vehicle.vehicleClass === 'LIGHT' &&
VEHICLE_BLACKLIST.indexOf(vehicle.target) < 0).length;
@ -316,10 +316,6 @@ const transformMoneyString = (budgetString) => {
};
const getFullTimeDate = (date, timeString) => {
console.log(date)
console.log(timeString)
const returnDate = new Date(date);
const time = timeString.split(':');
returnDate.setHours(time[0]);