Fix war date and driver nptr; deactivate respawn log

pull/24/head
Florian Hartwich 2018-02-02 10:48:43 +01:00
parent c4f1cc7713
commit 5d1ac86b02
1 changed files with 9 additions and 8 deletions

View File

@ -63,7 +63,8 @@ const parseWarLog = (lineArray, war) => {
stats.war['budgetBlufor'] = transformMoneyString(budg[9]); stats.war['budgetBlufor'] = transformMoneyString(budg[9]);
stats.war['budgetOpfor'] = transformMoneyString(budg[12].slice(0,-1)); stats.war['budgetOpfor'] = transformMoneyString(budg[12].slice(0,-1));
// this date needs to be assigned in first place !important // 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')) { } else if (line.includes('Endbudget')) {
stats.war['endBudgetBlufor'] = transformMoneyString(budg[9].substr(1)); stats.war['endBudgetBlufor'] = transformMoneyString(budg[9].substr(1));
stats.war['endBudgetOpfor'] = transformMoneyString(budg[12].slice(0,-1)); stats.war['endBudgetOpfor'] = transformMoneyString(budg[12].slice(0,-1));
@ -111,11 +112,11 @@ const parseWarLog = (lineArray, war) => {
/** /**
* RESPAWN * RESPAWN
*/ */
else if (line.includes('Respawn')) { // else if (line.includes('Respawn')) {
const resp = line.split(' '); // const resp = line.split(' ');
const playerName = line.substring(line.lastIndexOf('Spieler:') + 9, line.lastIndexOf('- Kosten') -1); // const playerName = line.substring(line.lastIndexOf('Spieler:') + 9, line.lastIndexOf('- Kosten') -1);
stats.respawn.push(getRespawnEntry(resp, playerName, war._id, war.date)); // stats.respawn.push(getRespawnEntry(resp, playerName, war._id, war.date));
} // }
/** /**
* REVIVE * REVIVE
@ -153,9 +154,9 @@ const parseWarLog = (lineArray, war) => {
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 ? driver.name : null,
passenger: passenger ? passenger.name : null, passenger: passenger ? passenger.name : null,
fraction: driver.fraction, fraction: driver ? driver.fraction : 'NONE',
distance: distance distance: distance
}); });
} }