Fix war date and driver nptr; deactivate respawn log
parent
c4f1cc7713
commit
5d1ac86b02
|
@ -63,7 +63,8 @@ const parseWarLog = (lineArray, war) => {
|
|||
stats.war['budgetBlufor'] = transformMoneyString(budg[9]);
|
||||
stats.war['budgetOpfor'] = transformMoneyString(budg[12].slice(0,-1));
|
||||
// this date needs to be assigned in first place !important
|
||||
stats.war.date = new Date(budg[0].slice(0,-1).split('/').join('-'));
|
||||
const dateString = budg[0].slice(0,-1).split('/');
|
||||
stats.war.date = new Date(dateString[0], dateString[1], dateString[2])
|
||||
} else if (line.includes('Endbudget')) {
|
||||
stats.war['endBudgetBlufor'] = transformMoneyString(budg[9].substr(1));
|
||||
stats.war['endBudgetOpfor'] = transformMoneyString(budg[12].slice(0,-1));
|
||||
|
@ -111,11 +112,11 @@ const parseWarLog = (lineArray, war) => {
|
|||
/**
|
||||
* RESPAWN
|
||||
*/
|
||||
else if (line.includes('Respawn')) {
|
||||
const resp = line.split(' ');
|
||||
const playerName = line.substring(line.lastIndexOf('Spieler:') + 9, line.lastIndexOf('- Kosten') -1);
|
||||
stats.respawn.push(getRespawnEntry(resp, playerName, war._id, war.date));
|
||||
}
|
||||
// else if (line.includes('Respawn')) {
|
||||
// const resp = line.split(' ');
|
||||
// const playerName = line.substring(line.lastIndexOf('Spieler:') + 9, line.lastIndexOf('- Kosten') -1);
|
||||
// stats.respawn.push(getRespawnEntry(resp, playerName, war._id, war.date));
|
||||
// }
|
||||
|
||||
/**
|
||||
* REVIVE
|
||||
|
@ -153,9 +154,9 @@ const parseWarLog = (lineArray, war) => {
|
|||
stats.transport.push({
|
||||
war: war._id,
|
||||
time: getFullTimeDate(war.date, line.split(' ')[5]),
|
||||
driver: driver.name,
|
||||
driver: driver ? driver.name : null,
|
||||
passenger: passenger ? passenger.name : null,
|
||||
fraction: driver.fraction,
|
||||
fraction: driver ? driver.fraction : 'NONE',
|
||||
distance: distance
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue