fix lint & improve kill log parse -> add friendlyFire default

pull/51/head
HardiReady 2019-02-10 01:04:19 +01:00
parent 79aec147e3
commit 2fffad3c60
2 changed files with 9 additions and 8 deletions

View File

@ -127,6 +127,7 @@ const parseWarLog = (lineArray, war) => {
const kill = { const kill = {
war: war._id, war: war._id,
time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]), time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]),
friendlyFire: false,
}; };
if (shooter) { if (shooter) {
kill.shooter = shooter.name; kill.shooter = shooter.name;

View File

@ -108,14 +108,14 @@ export class ServerStatsComponent implements OnInit, OnChanges {
} }
initializeChartData() { initializeChartData() {
this.tmpAvgTimeline = ChartUtils.getMultiDataArray("min", "avg", "max"); this.tmpAvgTimeline = ChartUtils.getMultiDataArray('min', 'avg', 'max');
this.tmpMinTimeline = ChartUtils.getMultiDataArray("min", "avg", "max"); this.tmpMinTimeline = ChartUtils.getMultiDataArray('min', 'avg', 'max');
this.tmpServerTimeline = ChartUtils.getMultiDataArray("min", "avg"); this.tmpServerTimeline = ChartUtils.getMultiDataArray('min', 'avg');
const diffMs = (new Date(this.war.endDate).getTime() - new Date(this.war.date).getTime()); const diffMs = (new Date(this.war.endDate).getTime() - new Date(this.war.date).getTime());
const warDurationMinutes = Math.round(diffMs / 60000); const warDurationMinutes = Math.round(diffMs / 60000);
let dateObj = new Date(this.war.date); const dateObj = new Date(this.war.date);
dateObj.setHours(0); dateObj.setHours(0);
dateObj.setMinutes(1); dateObj.setMinutes(1);
@ -126,11 +126,11 @@ export class ServerStatsComponent implements OnInit, OnChanges {
const maxMinIdx = Math.min(this.performanceData.map(p => p.avgFps.length) const maxMinIdx = Math.min(this.performanceData.map(p => p.avgFps.length)
.sort((a, b) => b - a)[0], warDurationMinutes); .sort((a, b) => b - a)[0], warDurationMinutes);
let tmpAvgArray = new Array(maxAvgIdx).fill(0); let tmpAvgArray = new Array(maxAvgIdx).fill(0);
let tmpAvgMin = new Array(maxAvgIdx).fill(1000); const tmpAvgMin = new Array(maxAvgIdx).fill(1000);
let tmpAvgMax = new Array(maxAvgIdx).fill(0); const tmpAvgMax = new Array(maxAvgIdx).fill(0);
let tmpMinArray = new Array(maxMinIdx).fill(0); let tmpMinArray = new Array(maxMinIdx).fill(0);
let tmpMinMin = new Array(maxMinIdx).fill(1000); const tmpMinMin = new Array(maxMinIdx).fill(1000);
let tmpMinMax = new Array(maxMinIdx).fill(0); const tmpMinMax = new Array(maxMinIdx).fill(0);
this.performanceData.forEach((entry) => { this.performanceData.forEach((entry) => {
if (entry.entityName !== 'SERVER') { if (entry.entityName !== 'SERVER') {