Add new transport parsing to stats upload
parent
8ae4999593
commit
c6b9858420
|
@ -140,26 +140,26 @@ const parseWarLog = (lineArray, war) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * TRANSPORT
|
* TRANSPORT
|
||||||
// */
|
*/
|
||||||
// else if (line.includes('Transport ||')) {
|
else if (line.includes('(Transport)')) {
|
||||||
// stats.clean.push(line);
|
stats.clean.push(line);
|
||||||
// const driverString = line.substring(line.lastIndexOf('wurde von ') + 10, line.lastIndexOf(' eingeflogen'));
|
const driverString = line.substring(line.lastIndexOf('wurde von ') + 10, line.lastIndexOf(' eingeflogen'));
|
||||||
// const driver = getPlayerAndFractionFromString(driverString);
|
const driver = getPlayerAndFractionFromString(driverString);
|
||||||
// const passengerString = line.substring(line.lastIndexOf('|| ') + 3, line.lastIndexOf(' wurde von'));
|
const passengerString = line.substring(line.lastIndexOf('--- ') + 3, line.lastIndexOf(' wurde von'));
|
||||||
// const passenger = getPlayerAndFractionFromString(passengerString);
|
const passenger = getPlayerAndFractionFromString(passengerString);
|
||||||
// const distance = parseInt(line.substring(line.lastIndexOf('eingeflogen (') + 13, line.lastIndexOf('m)') - 1));
|
const distance = parseInt(line.substring(line.lastIndexOf('eingeflogen (') + 13, line.lastIndexOf('m)') - 1));
|
||||||
//
|
|
||||||
// stats.transport.push({
|
stats.transport.push({
|
||||||
// war: war._id,
|
war: war._id,
|
||||||
// time: getFullTimeDate(war.date, line.split(' ')[5]),
|
time: getFullTimeDate(war.date, line.split(' ')[5]),
|
||||||
// driver: driver.name,
|
driver: driver.name,
|
||||||
// passenger: passenger ? passenger.name : null,
|
passenger: passenger ? passenger.name : null,
|
||||||
// fraction: driver.fraction,
|
fraction: driver.fraction,
|
||||||
// distance: distance
|
distance: distance
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PLAYERS
|
* PLAYERS
|
||||||
|
|
Loading…
Reference in New Issue