Compare commits
5 Commits
237926fdf6
...
7867c1d480
Author | SHA1 | Date |
---|---|---|
HardiReady | 7867c1d480 | |
HardiReady | 40931645d1 | |
HardiReady | 840695bf0e | |
HardiReady | 57f093f4dc | |
HardiReady | d18986cb1f |
|
@ -0,0 +1,34 @@
|
|||
"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);
|
|
@ -24,6 +24,12 @@ const PlayerSchema = new Schema({
|
|||
set: v => Math.round(v),
|
||||
required: true
|
||||
},
|
||||
vehicle: {
|
||||
type: Number,
|
||||
get: v => Math.round(v),
|
||||
set: v => Math.round(v),
|
||||
required: true
|
||||
},
|
||||
death: {
|
||||
type: Number,
|
||||
get: v => Math.round(v),
|
||||
|
|
|
@ -13,6 +13,7 @@ const LogBudgetModel = require('../models/logs/budget');
|
|||
const LogRespawnModel = require('../models/logs/respawn');
|
||||
const LogReviveModel = require('../models/logs/revive');
|
||||
const LogKillModel = require('../models/logs/kill');
|
||||
const LogVehicleModel = require('../models/logs/vehicle');
|
||||
const LogTransportModel = require('../models/logs/transport');
|
||||
const LogFlagModel = require('../models/logs/flag');
|
||||
const LogPointsModel = require('../models/logs/points');
|
||||
|
@ -43,6 +44,7 @@ logsRouter.route('/:warId')
|
|||
const respawnObjects = LogRespawnModel.find(filter, {}, sort);
|
||||
const reviveObjects = LogReviveModel.find(filter, {}, sort);
|
||||
const killObjects = LogKillModel.find(filter, {}, sort);
|
||||
const vehicleObjects = LogVehicleModel.find(filter, {}, sort);
|
||||
const transportObjects = LogTransportModel.find(filter, {}, sort);
|
||||
const flagObjects = LogFlagModel.find(filter, {}, sort);
|
||||
const resources = {
|
||||
|
@ -51,6 +53,7 @@ logsRouter.route('/:warId')
|
|||
respawn: respawnObjects.exec.bind(respawnObjects),
|
||||
revive: reviveObjects.exec.bind(reviveObjects),
|
||||
kill: killObjects.exec.bind(killObjects),
|
||||
vehicle: killObjects.exec.bind(vehicleObjects),
|
||||
transport: transportObjects.exec.bind(transportObjects),
|
||||
flag: flagObjects.exec.bind(flagObjects)
|
||||
};
|
||||
|
|
|
@ -38,6 +38,7 @@ campaignPlayer.route('/ranking/:campaignId')
|
|||
const resItem = {
|
||||
name: playerName,
|
||||
kill: 0,
|
||||
vehicle: 0,
|
||||
death: 0,
|
||||
friendlyFire: 0,
|
||||
revive: 0,
|
||||
|
@ -48,6 +49,7 @@ campaignPlayer.route('/ranking/:campaignId')
|
|||
resItem.kill += playerInstances[i].kill;
|
||||
resItem.death += playerInstances[i].death;
|
||||
resItem.friendlyFire += playerInstances[i].friendlyFire;
|
||||
resItem.vehicle += playerInstances[i].vehicle;
|
||||
resItem.revive += playerInstances[i].revive;
|
||||
resItem.respawn += playerInstances[i].respawn;
|
||||
resItem.flagTouch += playerInstances[i].flagTouch;
|
||||
|
@ -70,6 +72,7 @@ campaignPlayer.route('/ranking/:campaignId')
|
|||
kill: getSortedField('kill'),
|
||||
death: getSortedField('death'),
|
||||
friendlyFire: getSortedField('friendlyFire'),
|
||||
vehicle: getSortedField('vehicle'),
|
||||
revive: getSortedField('revive'),
|
||||
respawn: getSortedField('respawn'),
|
||||
flagTouch: getSortedField('flagTouch')
|
||||
|
|
|
@ -27,6 +27,7 @@ const CampaignModel = require('../models/campaign');
|
|||
const WarModel = require('../models/war');
|
||||
const PlayerModel = require('../models/player');
|
||||
const LogKillModel = require('../models/logs/kill');
|
||||
const LogVehicleKillModel = require('../models/logs/vehicle');
|
||||
const LogRespawnModel = require('../models/logs/respawn');
|
||||
const LogReviveModel = require('../models/logs/revive');
|
||||
const LogTransportModel = require('../models/logs/transport');
|
||||
|
@ -92,33 +93,36 @@ wars.route('/')
|
|||
return next(err);
|
||||
}
|
||||
LogKillModel.create(statsResult.kills, 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);
|
||||
LogVehicleKillModel.create(statsResult.vehicles, function () {
|
||||
|
||||
// save clean log file
|
||||
const cleanFile = fs.createWriteStream(folderName + '/clean.log');
|
||||
statsResult.clean.forEach(cleanLine => {
|
||||
cleanFile.write(cleanLine + '\n\n')
|
||||
});
|
||||
cleanFile.end();
|
||||
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);
|
||||
|
||||
// save raw log file
|
||||
const rawFile = fs.createWriteStream(folderName + '/war.log');
|
||||
lineArray.forEach(rawLine => {
|
||||
rawFile.write(rawLine + '\n')
|
||||
});
|
||||
rawFile.end();
|
||||
// save clean log file
|
||||
const cleanFile = fs.createWriteStream(folderName + '/clean.log');
|
||||
statsResult.clean.forEach(cleanLine => {
|
||||
cleanFile.write(cleanLine + '\n\n')
|
||||
});
|
||||
cleanFile.end();
|
||||
|
||||
res.status(codes.created);
|
||||
res.locals.items = war;
|
||||
next();
|
||||
// save raw log file
|
||||
const rawFile = fs.createWriteStream(folderName + '/war.log');
|
||||
lineArray.forEach(rawLine => {
|
||||
rawFile.write(rawLine + '\n')
|
||||
});
|
||||
rawFile.end();
|
||||
|
||||
res.status(codes.created);
|
||||
res.locals.items = war;
|
||||
next();
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -5,6 +5,7 @@ const playerArrayContains = require('./util').playerArrayContains;
|
|||
const WHITESPACE = ' ';
|
||||
|
||||
const parseWarLog = (lineArray, war) => {
|
||||
|
||||
const NAME_TOO_LONG_ERROR = 'Error: ENAMETOOLONG: name too long, open \'';
|
||||
|
||||
const stats = {
|
||||
|
@ -13,6 +14,7 @@ const parseWarLog = (lineArray, war) => {
|
|||
budget: [],
|
||||
points: [],
|
||||
kills: [],
|
||||
vehicles: [],
|
||||
respawn: [],
|
||||
revive: [],
|
||||
flag: [],
|
||||
|
@ -20,6 +22,8 @@ const parseWarLog = (lineArray, war) => {
|
|||
players: []
|
||||
};
|
||||
|
||||
const vehicleBlacklist = ['Prowler (Unbewaffnet)', 'Qilin (Unbewaffnet)', 'Quad Bike', 'HuntIR'];
|
||||
|
||||
const addPlayerIfNotExists = (inputPlayer, steamUUID) => {
|
||||
const player = getPlayerAndFractionFromString(inputPlayer);
|
||||
if (player && player.name && player.fraction && !playerArrayContains(stats.players, player)) {
|
||||
|
@ -38,23 +42,38 @@ const parseWarLog = (lineArray, war) => {
|
|||
}
|
||||
|
||||
/**
|
||||
* KILLS
|
||||
* KILLS & VEHICLE KILLS
|
||||
*/
|
||||
if (line.includes('(Abschuss)') && !line.includes('Fahrzeug')) {
|
||||
if (line.includes('(Abschuss)')) {
|
||||
stats.clean.push(line);
|
||||
|
||||
const shooterString = line.substring(line.lastIndexOf(' von: ') + 6, line.lastIndexOf('."'));
|
||||
const shooter = getPlayerAndFractionFromString(shooterString);
|
||||
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'
|
||||
});
|
||||
if (line.includes('Fahrzeug:')) {
|
||||
const targetString = line.substring(line.lastIndexOf(' --- Fahrzeug: ') + 15, line.lastIndexOf(' von:'));
|
||||
const target = getVehicleAndFractionFromString(targetString);
|
||||
if (target && shooter && target.fraction !== shooter.fraction) {
|
||||
stats.vehicles.push({
|
||||
war: war._id,
|
||||
time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]),
|
||||
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'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,6 +200,7 @@ const parseWarLog = (lineArray, war) => {
|
|||
const playerName = stats.players[i].name;
|
||||
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]['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]['death'] = stats.kills.filter(kill => kill.target === playerName).length;
|
||||
stats.players[i]['revive'] = stats.revive.filter(rev => rev.medic === playerName && !rev.stabilized).length;
|
||||
|
@ -233,6 +253,21 @@ 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) => {
|
||||
if (!budgetString.includes('e+')) {
|
||||
return parseInt(budgetString);
|
||||
|
|
|
@ -24,6 +24,7 @@ export interface Player {
|
|||
name?: string;
|
||||
warId?: War;
|
||||
kill?: number;
|
||||
vehicle?: number;
|
||||
death?: number;
|
||||
friendlyFire?: number;
|
||||
revive?: number;
|
||||
|
|
|
@ -81,6 +81,26 @@
|
|||
</ngx-charts-line-chart>
|
||||
</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">
|
||||
<ngx-charts-line-chart
|
||||
[results]="deathData"
|
||||
|
|
|
@ -25,6 +25,7 @@ export class CampaignPlayerDetailComponent {
|
|||
sumData: any[] = [];
|
||||
killData: any[] = [];
|
||||
friendlyFireData: any[] = [];
|
||||
vehicleKillData: any[] = [];
|
||||
deathData: any[] = [];
|
||||
respawnData: any[] = [];
|
||||
reviveData: any[] = [];
|
||||
|
@ -32,6 +33,7 @@ export class CampaignPlayerDetailComponent {
|
|||
|
||||
yAxisKill = 'Kills';
|
||||
yAxisFriendlyFire = 'FriendlyFire';
|
||||
yAxisVehicleKill = 'Farzeug-Kills';
|
||||
yAxisDeath = 'Tode';
|
||||
yAxisRespawn = 'Respawn';
|
||||
yAxisRevive = 'Revive';
|
||||
|
@ -49,6 +51,7 @@ export class CampaignPlayerDetailComponent {
|
|||
showRefLines = true;
|
||||
showRefLabels = true;
|
||||
killRefLines = [];
|
||||
vehicleKillRefLines = [];
|
||||
deathRefLines = [];
|
||||
captureRefLines = [];
|
||||
friendlyFireRefLines = [];
|
||||
|
@ -67,6 +70,7 @@ export class CampaignPlayerDetailComponent {
|
|||
|
||||
totalKills;
|
||||
totalFriendlyFire;
|
||||
totalVehicleKills;
|
||||
totalDeath;
|
||||
totalRespawn;
|
||||
totalRevive;
|
||||
|
@ -87,6 +91,7 @@ export class CampaignPlayerDetailComponent {
|
|||
.subscribe(campaignPlayer => {
|
||||
this.campaignPlayer = campaignPlayer;
|
||||
this.killData = this.assignData(this.yAxisKill, "kill");
|
||||
this.vehicleKillData = this.assignData(this.yAxisVehicleKill, "vehicle");
|
||||
this.friendlyFireData = this.assignData(this.yAxisFriendlyFire, "friendlyFire");
|
||||
this.deathData = this.assignData(this.yAxisDeath, "death");
|
||||
this.respawnData = this.assignData(this.yAxisRespawn, "respawn");
|
||||
|
@ -107,6 +112,10 @@ export class CampaignPlayerDetailComponent {
|
|||
name: this.yAxisFriendlyFire,
|
||||
value: this.totalFriendlyFire
|
||||
},
|
||||
{
|
||||
name: this.yAxisVehicleKill,
|
||||
value: this.totalVehicleKills
|
||||
},
|
||||
{
|
||||
name: this.yAxisDeath,
|
||||
value: this.totalDeath
|
||||
|
@ -125,7 +134,7 @@ export class CampaignPlayerDetailComponent {
|
|||
}
|
||||
];
|
||||
|
||||
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.deathData, this.respawnData, this.reviveData, this.captureData]);
|
||||
Object.assign(this, [this.sumData, this.killData, this.friendlyFireData, this.vehicleKillData, this.deathData, this.respawnData, this.reviveData, this.captureData]);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -138,12 +147,12 @@ export class CampaignPlayerDetailComponent {
|
|||
let total = 0;
|
||||
for (let i = 0; i < playerLength; i++) {
|
||||
const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date);
|
||||
const warKills = this.campaignPlayer.players[i][field];
|
||||
const value = this.campaignPlayer.players[i][field];
|
||||
killObj.series.push({
|
||||
name: warDateString,
|
||||
value: warKills
|
||||
value: value
|
||||
});
|
||||
total += warKills;
|
||||
total += value;
|
||||
}
|
||||
switch (field) {
|
||||
case 'kill':
|
||||
|
@ -154,6 +163,10 @@ export class CampaignPlayerDetailComponent {
|
|||
this.friendlyFireRefLines.push({value: total / playerLength, name: this.avgLabel});
|
||||
this.totalFriendlyFire = total;
|
||||
break;
|
||||
case 'vehicle':
|
||||
this.vehicleKillRefLines.push({value: total / playerLength, name: this.avgLabel});
|
||||
this.totalVehicleKills = total;
|
||||
break;
|
||||
case 'death':
|
||||
this.deathRefLines.push({value: total / playerLength, name: this.avgLabel});
|
||||
this.totalDeath = total;
|
||||
|
|
|
@ -18,8 +18,6 @@ ngx-datatable {
|
|||
float: left;
|
||||
border: solid #dfdfdf 1px;
|
||||
border-radius: 10px 10px 2px 2px;
|
||||
border-right-style: none;
|
||||
border-top-style: none;
|
||||
}
|
||||
|
||||
:host /deep/ .datatable-header {
|
||||
|
|
|
@ -36,6 +36,48 @@
|
|||
<ngx-datatable-column [width]="valueColWidth" name="Kills" prop="kill"></ngx-datatable-column>
|
||||
</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
|
||||
[rows]="players.death"
|
||||
[messages]="emptyMessage"
|
||||
|
@ -78,27 +120,6 @@
|
|||
<ngx-datatable-column [width]="valueColWidth" name="Respawn" prop="respawn"></ngx-datatable-column>
|
||||
</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.revive"
|
||||
[messages]="emptyMessage"
|
||||
|
|
|
@ -86,6 +86,7 @@ export class StatisticHighScoreComponent {
|
|||
this.players = {
|
||||
kill: this.filterPlayerAttribute('kill'),
|
||||
friendlyFire: this.filterPlayerAttribute('friendlyFire'),
|
||||
vehicle: this.filterPlayerAttribute('vehicle'),
|
||||
death: this.filterPlayerAttribute('death'),
|
||||
respawn: this.filterPlayerAttribute('respawn'),
|
||||
revive: this.filterPlayerAttribute('revive'),
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
btnRadio="{{labelKill}}">{{labelKill}}</label>
|
||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
|
||||
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"
|
||||
btnRadio="{{labelRevive}}">{{labelRevive}}</label>
|
||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
|
||||
|
|
|
@ -34,6 +34,7 @@ export class FractionStatsComponent {
|
|||
tmpBudgetData;
|
||||
tmpKillData;
|
||||
tmpFrienlyFireData;
|
||||
tmpVehicleData;
|
||||
tmpTransportData;
|
||||
tmpReviveData;
|
||||
tmpStabilizeData;
|
||||
|
@ -47,6 +48,7 @@ export class FractionStatsComponent {
|
|||
labelBudget = 'Budget';
|
||||
labelKill = 'Kills';
|
||||
labelFriendlyFire = 'FriendlyFire';
|
||||
labelVehicle = 'Fahrzeug-Kills';
|
||||
labelTransport = 'Lufttransport';
|
||||
labelRevive = 'Revive';
|
||||
labelStabilize = 'Stabilisiert';
|
||||
|
@ -111,6 +113,10 @@ export class FractionStatsComponent {
|
|||
this.initKillData();
|
||||
this.lineChartData = this.tmpFrienlyFireData;
|
||||
break;
|
||||
case this.labelVehicle:
|
||||
this.initVehicleData();
|
||||
this.lineChartData = this.tmpVehicleData;
|
||||
break;
|
||||
case this.labelRevive:
|
||||
this.initRevive();
|
||||
this.lineChartData = this.tmpReviveData;
|
||||
|
@ -250,6 +256,30 @@ export class FractionStatsComponent {
|
|||
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() {
|
||||
if (this.initialized.transport) {
|
||||
return;
|
||||
|
@ -272,7 +302,6 @@ export class FractionStatsComponent {
|
|||
}
|
||||
this.addFinalTimeData(this.tmpTransportData);
|
||||
this.initialized.transport = true;
|
||||
|
||||
}
|
||||
|
||||
initFlagHoldData() {
|
||||
|
@ -308,12 +337,13 @@ export class FractionStatsComponent {
|
|||
this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpKillData = 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.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
|
||||
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => {
|
||||
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => {
|
||||
[0, 1].forEach(index => {
|
||||
tmp[index].series.push(ChartUtils.getSeriesEntry(this.startDateObj, 0));
|
||||
})
|
||||
|
|
|
@ -25,15 +25,16 @@
|
|||
</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]="90" name="Fahrzeug" prop="vehicle"></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]="70" name="Tod" prop="death"></ngx-datatable-column>
|
||||
<ngx-datatable-column [width]="90" name="Respawn" prop="respawn"></ngx-datatable-column>
|
||||
<ngx-datatable-column [width]="80" name="" prop="name">
|
||||
<ng-template ngx-datatable-cell-template let-value="value">
|
||||
<span class="btn btn-sm btn-default in-table-btn disabled">Detail</span>
|
||||
</ng-template>
|
||||
</ngx-datatable-column>
|
||||
<!--<ngx-datatable-column [width]="80" name="" prop="name">-->
|
||||
<!--<ng-template ngx-datatable-cell-template let-value="value">-->
|
||||
<!--<span class="btn btn-sm btn-default in-table-btn disabled">Detail</span>-->
|
||||
<!--</ng-template>-->
|
||||
<!--</ngx-datatable-column>-->
|
||||
<ngx-datatable-column [width]="80" name="" prop="name">
|
||||
<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>
|
||||
|
|
|
@ -1,21 +1,3 @@
|
|||
.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 {
|
||||
width: 920px;
|
||||
min-height: 168px;
|
||||
|
@ -28,6 +10,10 @@
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.war-header {
|
||||
border-bottom: thin solid lightgrey;
|
||||
}
|
||||
|
||||
.nav-tabs > li.active > a {
|
||||
background: #222222;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue