Compare commits

..

No commits in common. "7867c1d48098eb044672d7e5ef19ffc8096dbaf3" and "237926fdf671594d11fc979be4c83fcee91f1ac7" have entirely different histories.

16 changed files with 88 additions and 246 deletions

View File

@ -1,34 +0,0 @@
"use strict";
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const LogVehicleKillSchema = new Schema({
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
required: true
},
time: {
type: Date,
required: true
},
shooter: {
type: String
},
target: {
type: String,
required: true
},
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'NONE'],
required: true
}
}, {
collection: 'logVehicle'
});
// optional more indices
LogVehicleKillSchema.index({war: 1, shooter: 1, target: 1});
module.exports = mongoose.model('LogVehicle', LogVehicleKillSchema);

View File

@ -24,12 +24,6 @@ const PlayerSchema = new Schema({
set: v => Math.round(v), set: v => Math.round(v),
required: true required: true
}, },
vehicle: {
type: Number,
get: v => Math.round(v),
set: v => Math.round(v),
required: true
},
death: { death: {
type: Number, type: Number,
get: v => Math.round(v), get: v => Math.round(v),

View File

@ -13,7 +13,6 @@ const LogBudgetModel = require('../models/logs/budget');
const LogRespawnModel = require('../models/logs/respawn'); const LogRespawnModel = require('../models/logs/respawn');
const LogReviveModel = require('../models/logs/revive'); const LogReviveModel = require('../models/logs/revive');
const LogKillModel = require('../models/logs/kill'); const LogKillModel = require('../models/logs/kill');
const LogVehicleModel = require('../models/logs/vehicle');
const LogTransportModel = require('../models/logs/transport'); const LogTransportModel = require('../models/logs/transport');
const LogFlagModel = require('../models/logs/flag'); const LogFlagModel = require('../models/logs/flag');
const LogPointsModel = require('../models/logs/points'); const LogPointsModel = require('../models/logs/points');
@ -44,7 +43,6 @@ logsRouter.route('/:warId')
const respawnObjects = LogRespawnModel.find(filter, {}, sort); const respawnObjects = LogRespawnModel.find(filter, {}, sort);
const reviveObjects = LogReviveModel.find(filter, {}, sort); const reviveObjects = LogReviveModel.find(filter, {}, sort);
const killObjects = LogKillModel.find(filter, {}, sort); const killObjects = LogKillModel.find(filter, {}, sort);
const vehicleObjects = LogVehicleModel.find(filter, {}, sort);
const transportObjects = LogTransportModel.find(filter, {}, sort); const transportObjects = LogTransportModel.find(filter, {}, sort);
const flagObjects = LogFlagModel.find(filter, {}, sort); const flagObjects = LogFlagModel.find(filter, {}, sort);
const resources = { const resources = {
@ -53,7 +51,6 @@ logsRouter.route('/:warId')
respawn: respawnObjects.exec.bind(respawnObjects), respawn: respawnObjects.exec.bind(respawnObjects),
revive: reviveObjects.exec.bind(reviveObjects), revive: reviveObjects.exec.bind(reviveObjects),
kill: killObjects.exec.bind(killObjects), kill: killObjects.exec.bind(killObjects),
vehicle: killObjects.exec.bind(vehicleObjects),
transport: transportObjects.exec.bind(transportObjects), transport: transportObjects.exec.bind(transportObjects),
flag: flagObjects.exec.bind(flagObjects) flag: flagObjects.exec.bind(flagObjects)
}; };

View File

@ -38,7 +38,6 @@ campaignPlayer.route('/ranking/:campaignId')
const resItem = { const resItem = {
name: playerName, name: playerName,
kill: 0, kill: 0,
vehicle: 0,
death: 0, death: 0,
friendlyFire: 0, friendlyFire: 0,
revive: 0, revive: 0,
@ -49,7 +48,6 @@ campaignPlayer.route('/ranking/:campaignId')
resItem.kill += playerInstances[i].kill; resItem.kill += playerInstances[i].kill;
resItem.death += playerInstances[i].death; resItem.death += playerInstances[i].death;
resItem.friendlyFire += playerInstances[i].friendlyFire; resItem.friendlyFire += playerInstances[i].friendlyFire;
resItem.vehicle += playerInstances[i].vehicle;
resItem.revive += playerInstances[i].revive; resItem.revive += playerInstances[i].revive;
resItem.respawn += playerInstances[i].respawn; resItem.respawn += playerInstances[i].respawn;
resItem.flagTouch += playerInstances[i].flagTouch; resItem.flagTouch += playerInstances[i].flagTouch;
@ -72,7 +70,6 @@ campaignPlayer.route('/ranking/:campaignId')
kill: getSortedField('kill'), kill: getSortedField('kill'),
death: getSortedField('death'), death: getSortedField('death'),
friendlyFire: getSortedField('friendlyFire'), friendlyFire: getSortedField('friendlyFire'),
vehicle: getSortedField('vehicle'),
revive: getSortedField('revive'), revive: getSortedField('revive'),
respawn: getSortedField('respawn'), respawn: getSortedField('respawn'),
flagTouch: getSortedField('flagTouch') flagTouch: getSortedField('flagTouch')

View File

@ -27,7 +27,6 @@ const CampaignModel = require('../models/campaign');
const WarModel = require('../models/war'); const WarModel = require('../models/war');
const PlayerModel = require('../models/player'); const PlayerModel = require('../models/player');
const LogKillModel = require('../models/logs/kill'); const LogKillModel = require('../models/logs/kill');
const LogVehicleKillModel = require('../models/logs/vehicle');
const LogRespawnModel = require('../models/logs/respawn'); const LogRespawnModel = require('../models/logs/respawn');
const LogReviveModel = require('../models/logs/revive'); const LogReviveModel = require('../models/logs/revive');
const LogTransportModel = require('../models/logs/transport'); const LogTransportModel = require('../models/logs/transport');
@ -93,36 +92,33 @@ wars.route('/')
return next(err); return next(err);
} }
LogKillModel.create(statsResult.kills, function () { LogKillModel.create(statsResult.kills, function () {
LogVehicleKillModel.create(statsResult.vehicles, function () { LogRespawnModel.create(statsResult.respawn, function () {
LogReviveModel.create(statsResult.revive, function () {
LogFlagModel.create(statsResult.flag, function () {
LogBudgetModel.create(statsResult.budget, function () {
LogTransportModel.create(statsResult.transport, function () {
LogPointsModel.create(statsResult.points, function () {
const folderName = __dirname + '/../resource/logs/' + war._id;
mkdirp(folderName, function (err) {
if (err) return next(err);
LogRespawnModel.create(statsResult.respawn, function () { // save clean log file
LogReviveModel.create(statsResult.revive, function () { const cleanFile = fs.createWriteStream(folderName + '/clean.log');
LogFlagModel.create(statsResult.flag, function () { statsResult.clean.forEach(cleanLine => {
LogBudgetModel.create(statsResult.budget, function () { cleanFile.write(cleanLine + '\n\n')
LogTransportModel.create(statsResult.transport, function () { });
LogPointsModel.create(statsResult.points, function () { cleanFile.end();
const folderName = __dirname + '/../resource/logs/' + war._id;
mkdirp(folderName, function (err) {
if (err) return next(err);
// save clean log file // save raw log file
const cleanFile = fs.createWriteStream(folderName + '/clean.log'); const rawFile = fs.createWriteStream(folderName + '/war.log');
statsResult.clean.forEach(cleanLine => { lineArray.forEach(rawLine => {
cleanFile.write(cleanLine + '\n\n') rawFile.write(rawLine + '\n')
}); });
cleanFile.end(); rawFile.end();
// save raw log file res.status(codes.created);
const rawFile = fs.createWriteStream(folderName + '/war.log'); res.locals.items = war;
lineArray.forEach(rawLine => { next();
rawFile.write(rawLine + '\n')
});
rawFile.end();
res.status(codes.created);
res.locals.items = war;
next();
})
}) })
}) })
}) })

View File

@ -5,7 +5,6 @@ const playerArrayContains = require('./util').playerArrayContains;
const WHITESPACE = ' '; const WHITESPACE = ' ';
const parseWarLog = (lineArray, war) => { const parseWarLog = (lineArray, war) => {
const NAME_TOO_LONG_ERROR = 'Error: ENAMETOOLONG: name too long, open \''; const NAME_TOO_LONG_ERROR = 'Error: ENAMETOOLONG: name too long, open \'';
const stats = { const stats = {
@ -14,7 +13,6 @@ const parseWarLog = (lineArray, war) => {
budget: [], budget: [],
points: [], points: [],
kills: [], kills: [],
vehicles: [],
respawn: [], respawn: [],
revive: [], revive: [],
flag: [], flag: [],
@ -22,8 +20,6 @@ const parseWarLog = (lineArray, war) => {
players: [] players: []
}; };
const vehicleBlacklist = ['Prowler (Unbewaffnet)', 'Qilin (Unbewaffnet)', 'Quad Bike', 'HuntIR'];
const addPlayerIfNotExists = (inputPlayer, steamUUID) => { const addPlayerIfNotExists = (inputPlayer, steamUUID) => {
const player = getPlayerAndFractionFromString(inputPlayer); const player = getPlayerAndFractionFromString(inputPlayer);
if (player && player.name && player.fraction && !playerArrayContains(stats.players, player)) { if (player && player.name && player.fraction && !playerArrayContains(stats.players, player)) {
@ -42,38 +38,23 @@ const parseWarLog = (lineArray, war) => {
} }
/** /**
* KILLS & VEHICLE KILLS * KILLS
*/ */
if (line.includes('(Abschuss)')) { if (line.includes('(Abschuss)') && !line.includes('Fahrzeug')) {
stats.clean.push(line); stats.clean.push(line);
const shooterString = line.substring(line.lastIndexOf(' von: ') + 6, line.lastIndexOf('."')); const shooterString = line.substring(line.lastIndexOf(' von: ') + 6, line.lastIndexOf('."'));
const shooter = getPlayerAndFractionFromString(shooterString); const shooter = getPlayerAndFractionFromString(shooterString);
const targetString = line.substring(line.lastIndexOf(' --- ') + 5, line.lastIndexOf(' von:'));
const target = getPlayerAndFractionFromString(targetString);
if (line.includes('Fahrzeug:')) { stats.kills.push({
const targetString = line.substring(line.lastIndexOf(' --- Fahrzeug: ') + 15, line.lastIndexOf(' von:')); war: war._id,
const target = getVehicleAndFractionFromString(targetString); time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]),
if (target && shooter && target.fraction !== shooter.fraction) { shooter: shooter ? shooter.name : null,
stats.vehicles.push({ target: target ? target.name : null,
war: war._id, friendlyFire: shooter ? target.fraction === shooter.fraction : false,
time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]), fraction: shooter ? shooter.fraction : 'NONE'
shooter: shooter ? shooter.name : null, });
target: target ? target.name : null,
fraction: shooter ? shooter.fraction : 'NONE'
})
}
} else {
const targetString = line.substring(line.lastIndexOf(' --- ') + 5, line.lastIndexOf(' von:'));
const target = getPlayerAndFractionFromString(targetString);
stats.kills.push({
war: war._id,
time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]),
shooter: shooter ? shooter.name : null,
target: target ? target.name : null,
friendlyFire: shooter ? target.fraction === shooter.fraction : false,
fraction: shooter ? shooter.fraction : 'NONE'
});
}
} }
/** /**
@ -200,7 +181,6 @@ const parseWarLog = (lineArray, war) => {
const playerName = stats.players[i].name; const playerName = stats.players[i].name;
stats.players[i]['respawn'] = stats.respawn.filter(res => res.player === playerName).length; stats.players[i]['respawn'] = stats.respawn.filter(res => res.player === playerName).length;
stats.players[i]['kill'] = stats.kills.filter(kill => kill.shooter === playerName && !kill.friendlyFire).length; stats.players[i]['kill'] = stats.kills.filter(kill => kill.shooter === playerName && !kill.friendlyFire).length;
stats.players[i]['vehicle'] = stats.vehicles.filter(vehicle => vehicle.shooter === playerName && vehicleBlacklist.indexOf(vehicle.target) < 0).length;
stats.players[i]['friendlyFire'] = stats.kills.filter(kill => kill.shooter === playerName && kill.friendlyFire).length; stats.players[i]['friendlyFire'] = stats.kills.filter(kill => kill.shooter === playerName && kill.friendlyFire).length;
stats.players[i]['death'] = stats.kills.filter(kill => kill.target === playerName).length; stats.players[i]['death'] = stats.kills.filter(kill => kill.target === playerName).length;
stats.players[i]['revive'] = stats.revive.filter(rev => rev.medic === playerName && !rev.stabilized).length; stats.players[i]['revive'] = stats.revive.filter(rev => rev.medic === playerName && !rev.stabilized).length;
@ -253,21 +233,6 @@ const getPlayerAndFractionFromString = (nameAndFractionString) => {
} }
}; };
const getVehicleAndFractionFromString = (nameAndFractionString) => {
const nameArray = nameAndFractionString.trim().split(WHITESPACE);
const fractionPart = nameArray[nameArray.length - 1];
// escape it is some parachute fraction identifier
if (fractionPart === 'OPF_F' || fractionPart === 'BLU_F') {
return;
}
const fraction = fractionPart === '(OPT_NATO)' || fractionPart === '(OPT_NATO_T)' ? 'BLUFOR' : 'OPFOR';
const name = nameAndFractionString.substring(0, nameAndFractionString.indexOf(fractionPart) - 1);
return {name: name, fraction: fraction};
};
const transformMoneyString = (budgetString) => { const transformMoneyString = (budgetString) => {
if (!budgetString.includes('e+')) { if (!budgetString.includes('e+')) {
return parseInt(budgetString); return parseInt(budgetString);

View File

@ -24,7 +24,6 @@ export interface Player {
name?: string; name?: string;
warId?: War; warId?: War;
kill?: number; kill?: number;
vehicle?: number;
death?: number; death?: number;
friendlyFire?: number; friendlyFire?: number;
revive?: number; revive?: number;

View File

@ -81,26 +81,6 @@
</ngx-charts-line-chart> </ngx-charts-line-chart>
</div> </div>
<div class="chart-container">
<ngx-charts-line-chart
[results]="vehicleKillData"
[showRefLines]="showRefLines"
[showRefLabels]="showRefLabels"
[referenceLines]="killRefLines"
[scheme]="colorScheme"
[gradient]="gradient"
[xAxis]="xAxis"
[yAxis]="yAxis"
[legend]="legend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="yAxisVehicleKill"
[autoScale]="autoscale"
[timeline]="timeline"
[roundDomains]="roundDomains">
</ngx-charts-line-chart>
</div>
<div class="chart-container"> <div class="chart-container">
<ngx-charts-line-chart <ngx-charts-line-chart
[results]="deathData" [results]="deathData"

View File

@ -25,7 +25,6 @@ export class CampaignPlayerDetailComponent {
sumData: any[] = []; sumData: any[] = [];
killData: any[] = []; killData: any[] = [];
friendlyFireData: any[] = []; friendlyFireData: any[] = [];
vehicleKillData: any[] = [];
deathData: any[] = []; deathData: any[] = [];
respawnData: any[] = []; respawnData: any[] = [];
reviveData: any[] = []; reviveData: any[] = [];
@ -33,7 +32,6 @@ export class CampaignPlayerDetailComponent {
yAxisKill = 'Kills'; yAxisKill = 'Kills';
yAxisFriendlyFire = 'FriendlyFire'; yAxisFriendlyFire = 'FriendlyFire';
yAxisVehicleKill = 'Farzeug-Kills';
yAxisDeath = 'Tode'; yAxisDeath = 'Tode';
yAxisRespawn = 'Respawn'; yAxisRespawn = 'Respawn';
yAxisRevive = 'Revive'; yAxisRevive = 'Revive';
@ -51,7 +49,6 @@ export class CampaignPlayerDetailComponent {
showRefLines = true; showRefLines = true;
showRefLabels = true; showRefLabels = true;
killRefLines = []; killRefLines = [];
vehicleKillRefLines = [];
deathRefLines = []; deathRefLines = [];
captureRefLines = []; captureRefLines = [];
friendlyFireRefLines = []; friendlyFireRefLines = [];
@ -70,7 +67,6 @@ export class CampaignPlayerDetailComponent {
totalKills; totalKills;
totalFriendlyFire; totalFriendlyFire;
totalVehicleKills;
totalDeath; totalDeath;
totalRespawn; totalRespawn;
totalRevive; totalRevive;
@ -91,7 +87,6 @@ export class CampaignPlayerDetailComponent {
.subscribe(campaignPlayer => { .subscribe(campaignPlayer => {
this.campaignPlayer = campaignPlayer; this.campaignPlayer = campaignPlayer;
this.killData = this.assignData(this.yAxisKill, "kill"); this.killData = this.assignData(this.yAxisKill, "kill");
this.vehicleKillData = this.assignData(this.yAxisVehicleKill, "vehicle");
this.friendlyFireData = this.assignData(this.yAxisFriendlyFire, "friendlyFire"); this.friendlyFireData = this.assignData(this.yAxisFriendlyFire, "friendlyFire");
this.deathData = this.assignData(this.yAxisDeath, "death"); this.deathData = this.assignData(this.yAxisDeath, "death");
this.respawnData = this.assignData(this.yAxisRespawn, "respawn"); this.respawnData = this.assignData(this.yAxisRespawn, "respawn");
@ -112,10 +107,6 @@ export class CampaignPlayerDetailComponent {
name: this.yAxisFriendlyFire, name: this.yAxisFriendlyFire,
value: this.totalFriendlyFire value: this.totalFriendlyFire
}, },
{
name: this.yAxisVehicleKill,
value: this.totalVehicleKills
},
{ {
name: this.yAxisDeath, name: this.yAxisDeath,
value: this.totalDeath value: this.totalDeath
@ -134,7 +125,7 @@ export class CampaignPlayerDetailComponent {
} }
]; ];
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData, this.deathData, this.respawnData, this.reviveData, this.captureData]); Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.deathData, this.respawnData, this.reviveData, this.captureData]);
}); });
} }
@ -147,12 +138,12 @@ export class CampaignPlayerDetailComponent {
let total = 0; let total = 0;
for (let i = 0; i < playerLength; i++) { for (let i = 0; i < playerLength; i++) {
const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date); const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date);
const value = this.campaignPlayer.players[i][field]; const warKills = this.campaignPlayer.players[i][field];
killObj.series.push({ killObj.series.push({
name: warDateString, name: warDateString,
value: value value: warKills
}); });
total += value; total += warKills;
} }
switch (field) { switch (field) {
case 'kill': case 'kill':
@ -163,10 +154,6 @@ export class CampaignPlayerDetailComponent {
this.friendlyFireRefLines.push({value: total / playerLength, name: this.avgLabel}); this.friendlyFireRefLines.push({value: total / playerLength, name: this.avgLabel});
this.totalFriendlyFire = total; this.totalFriendlyFire = total;
break; break;
case 'vehicle':
this.vehicleKillRefLines.push({value: total / playerLength, name: this.avgLabel});
this.totalVehicleKills = total;
break;
case 'death': case 'death':
this.deathRefLines.push({value: total / playerLength, name: this.avgLabel}); this.deathRefLines.push({value: total / playerLength, name: this.avgLabel});
this.totalDeath = total; this.totalDeath = total;

View File

@ -18,6 +18,8 @@ ngx-datatable {
float: left; float: left;
border: solid #dfdfdf 1px; border: solid #dfdfdf 1px;
border-radius: 10px 10px 2px 2px; border-radius: 10px 10px 2px 2px;
border-right-style: none;
border-top-style: none;
} }
:host /deep/ .datatable-header { :host /deep/ .datatable-header {

View File

@ -36,48 +36,6 @@
<ngx-datatable-column [width]="valueColWidth" name="Kills" prop="kill"></ngx-datatable-column> <ngx-datatable-column [width]="valueColWidth" name="Kills" prop="kill"></ngx-datatable-column>
</ngx-datatable> </ngx-datatable>
<ngx-datatable
[rows]="players.friendlyFire"
[messages]="emptyMessage"
[headerHeight]="cellHeight"
[rowHeight]="cellHeight"
[cssClasses]='customClasses'
[columnMode]="'force'"
[scrollbarV]="true"
[selectionType]="'single'">
<ngx-datatable-column [width]="numberColWidth" name="#" prop="num"></ngx-datatable-column>
<ngx-datatable-column name="Spieler" prop="name" [width]="nameColWidth" style="padding-left:10px">
<ng-template ngx-datatable-cell-template let-row="row" let-value="value">
<span class="player-name"
[style.color]="row['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{value}}
</span>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column [width]="valueColWidth" name="FriendlyFire" prop="friendlyFire"></ngx-datatable-column>
</ngx-datatable>
<ngx-datatable
[rows]="players.vehicle"
[messages]="emptyMessage"
[headerHeight]="cellHeight"
[rowHeight]="cellHeight"
[cssClasses]='customClasses'
[columnMode]="'force'"
[scrollbarV]="true"
[selectionType]="'single'">
<ngx-datatable-column [width]="numberColWidth" name="#" prop="num"></ngx-datatable-column>
<ngx-datatable-column name="Spieler" prop="name" [width]="nameColWidth" style="padding-left:10px">
<ng-template ngx-datatable-cell-template let-row="row" let-value="value">
<span class="player-name"
[style.color]="row['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{value}}
</span>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column [width]="valueColWidth" name="Fahrzeug-Kills" prop="vehicle"></ngx-datatable-column>
</ngx-datatable>
<ngx-datatable <ngx-datatable
[rows]="players.death" [rows]="players.death"
[messages]="emptyMessage" [messages]="emptyMessage"
@ -120,6 +78,27 @@
<ngx-datatable-column [width]="valueColWidth" name="Respawn" prop="respawn"></ngx-datatable-column> <ngx-datatable-column [width]="valueColWidth" name="Respawn" prop="respawn"></ngx-datatable-column>
</ngx-datatable> </ngx-datatable>
<ngx-datatable
[rows]="players.friendlyFire"
[messages]="emptyMessage"
[headerHeight]="cellHeight"
[rowHeight]="cellHeight"
[cssClasses]='customClasses'
[columnMode]="'force'"
[scrollbarV]="true"
[selectionType]="'single'">
<ngx-datatable-column [width]="numberColWidth" name="#" prop="num"></ngx-datatable-column>
<ngx-datatable-column name="Spieler" prop="name" [width]="nameColWidth" style="padding-left:10px">
<ng-template ngx-datatable-cell-template let-row="row" let-value="value">
<span class="player-name"
[style.color]="row['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{value}}
</span>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column [width]="valueColWidth" name="FriendlyFire" prop="friendlyFire"></ngx-datatable-column>
</ngx-datatable>
<ngx-datatable <ngx-datatable
[rows]="players.revive" [rows]="players.revive"
[messages]="emptyMessage" [messages]="emptyMessage"

View File

@ -86,7 +86,6 @@ export class StatisticHighScoreComponent {
this.players = { this.players = {
kill: this.filterPlayerAttribute('kill'), kill: this.filterPlayerAttribute('kill'),
friendlyFire: this.filterPlayerAttribute('friendlyFire'), friendlyFire: this.filterPlayerAttribute('friendlyFire'),
vehicle: this.filterPlayerAttribute('vehicle'),
death: this.filterPlayerAttribute('death'), death: this.filterPlayerAttribute('death'),
respawn: this.filterPlayerAttribute('respawn'), respawn: this.filterPlayerAttribute('respawn'),
revive: this.filterPlayerAttribute('revive'), revive: this.filterPlayerAttribute('revive'),

View File

@ -28,8 +28,6 @@
btnRadio="{{labelKill}}">{{labelKill}}</label> btnRadio="{{labelKill}}">{{labelKill}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelFriendlyFire}}">{{labelFriendlyFire}}</label> btnRadio="{{labelFriendlyFire}}">{{labelFriendlyFire}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelVehicle}}">{{labelVehicle}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelRevive}}">{{labelRevive}}</label> btnRadio="{{labelRevive}}">{{labelRevive}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"

View File

@ -34,7 +34,6 @@ export class FractionStatsComponent {
tmpBudgetData; tmpBudgetData;
tmpKillData; tmpKillData;
tmpFrienlyFireData; tmpFrienlyFireData;
tmpVehicleData;
tmpTransportData; tmpTransportData;
tmpReviveData; tmpReviveData;
tmpStabilizeData; tmpStabilizeData;
@ -48,7 +47,6 @@ export class FractionStatsComponent {
labelBudget = 'Budget'; labelBudget = 'Budget';
labelKill = 'Kills'; labelKill = 'Kills';
labelFriendlyFire = 'FriendlyFire'; labelFriendlyFire = 'FriendlyFire';
labelVehicle = 'Fahrzeug-Kills';
labelTransport = 'Lufttransport'; labelTransport = 'Lufttransport';
labelRevive = 'Revive'; labelRevive = 'Revive';
labelStabilize = 'Stabilisiert'; labelStabilize = 'Stabilisiert';
@ -113,10 +111,6 @@ export class FractionStatsComponent {
this.initKillData(); this.initKillData();
this.lineChartData = this.tmpFrienlyFireData; this.lineChartData = this.tmpFrienlyFireData;
break; break;
case this.labelVehicle:
this.initVehicleData();
this.lineChartData = this.tmpVehicleData;
break;
case this.labelRevive: case this.labelRevive:
this.initRevive(); this.initRevive();
this.lineChartData = this.tmpReviveData; this.lineChartData = this.tmpReviveData;
@ -256,30 +250,6 @@ export class FractionStatsComponent {
this.initialized.revive = true; this.initialized.revive = true;
} }
initVehicleData() {
if (this.initialized.vehicle) {
return;
}
let vehicleKillCountBlufor = 0, vehicleKillCountOpfor = 0;
for (const {transportEntry: vehicleEntry, index} of this.logData.vehicle.map((transportEntry, index) => ({
transportEntry,
index
}))) {
const vehicleEntryDate = new Date(vehicleEntry.time);
if (vehicleEntry.fraction === 'BLUFOR') {
vehicleKillCountBlufor++;
} else {
vehicleKillCountOpfor++;
}
if (this.isTwoMinutesAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) {
this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor));
this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor));
}
}
this.addFinalTimeData(this.tmpVehicleData);
this.initialized.vehicle = true;
}
initTransportData() { initTransportData() {
if (this.initialized.transport) { if (this.initialized.transport) {
return; return;
@ -302,6 +272,7 @@ export class FractionStatsComponent {
} }
this.addFinalTimeData(this.tmpTransportData); this.addFinalTimeData(this.tmpTransportData);
this.initialized.transport = true; this.initialized.transport = true;
} }
initFlagHoldData() { initFlagHoldData() {
@ -337,13 +308,12 @@ export class FractionStatsComponent {
this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpKillData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpKillData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpFrienlyFireData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpFrienlyFireData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpVehicleData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpTransportData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpTransportData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => { [this.tmpKillData, this.tmpFrienlyFireData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => {
[0, 1].forEach(index => { [0, 1].forEach(index => {
tmp[index].series.push(ChartUtils.getSeriesEntry(this.startDateObj, 0)); tmp[index].series.push(ChartUtils.getSeriesEntry(this.startDateObj, 0));
}) })

View File

@ -25,16 +25,15 @@
</ngx-datatable-column> </ngx-datatable-column>
<ngx-datatable-column [width]="90" name="Kills" prop="kill"></ngx-datatable-column> <ngx-datatable-column [width]="90" name="Kills" prop="kill"></ngx-datatable-column>
<ngx-datatable-column [width]="104" name="FriendlyFire" prop="friendlyFire"></ngx-datatable-column> <ngx-datatable-column [width]="104" name="FriendlyFire" prop="friendlyFire"></ngx-datatable-column>
<ngx-datatable-column [width]="90" name="Fahrzeug" prop="vehicle"></ngx-datatable-column>
<ngx-datatable-column [width]="80" name="Revive" prop="revive"></ngx-datatable-column> <ngx-datatable-column [width]="80" name="Revive" prop="revive"></ngx-datatable-column>
<ngx-datatable-column [width]="100" name="Eroberung" prop="flagTouch"></ngx-datatable-column> <ngx-datatable-column [width]="100" name="Eroberung" prop="flagTouch"></ngx-datatable-column>
<ngx-datatable-column [width]="70" name="Tod" prop="death"></ngx-datatable-column> <ngx-datatable-column [width]="70" name="Tod" prop="death"></ngx-datatable-column>
<ngx-datatable-column [width]="90" name="Respawn" prop="respawn"></ngx-datatable-column> <ngx-datatable-column [width]="90" name="Respawn" prop="respawn"></ngx-datatable-column>
<!--<ngx-datatable-column [width]="80" name="" prop="name">--> <ngx-datatable-column [width]="80" name="" prop="name">
<!--<ng-template ngx-datatable-cell-template let-value="value">--> <ng-template ngx-datatable-cell-template let-value="value">
<!--<span class="btn btn-sm btn-default in-table-btn disabled">Detail</span>--> <span class="btn btn-sm btn-default in-table-btn disabled">Detail</span>
<!--</ng-template>--> </ng-template>
<!--</ngx-datatable-column>--> </ngx-datatable-column>
<ngx-datatable-column [width]="80" name="" prop="name"> <ngx-datatable-column [width]="80" name="" prop="name">
<ng-template ngx-datatable-cell-template let-value="value"> <ng-template ngx-datatable-cell-template let-value="value">
<span class="btn btn-sm btn-default in-table-btn" (click)="selectPlayerDetail(1, value)">Gesamt</span> <span class="btn btn-sm btn-default in-table-btn" (click)="selectPlayerDetail(1, value)">Gesamt</span>

View File

@ -1,3 +1,21 @@
.war-header {
position: fixed;
left: 35%;
border-bottom: thin solid lightgrey;
}
@media only screen and (max-width: 1950px) {
.war-header {
left: 30%;
}
}
@media only screen and (max-width: 1500px) {
.war-header {
left: 380px;
}
}
.war-header-container { .war-header-container {
width: 920px; width: 920px;
min-height: 168px; min-height: 168px;
@ -10,10 +28,6 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
.war-header {
border-bottom: thin solid lightgrey;
}
.nav-tabs > li.active > a { .nav-tabs > li.active > a {
background: #222222; background: #222222;
} }