Fix respawn log parsing (CC-22)

pull/34/head
HardiReady 2018-04-29 12:00:21 +02:00
parent 63a89ebf7b
commit f0e5b11054
4 changed files with 10 additions and 16 deletions

View File

@ -106,6 +106,12 @@ const parseWarLog = (lineArray, war) => {
stats.war['endBudgetBlufor'] = transformMoneyString(budg[9]);
stats.war['endBudgetOpfor'] = transformMoneyString(budg[12].slice(0, -2));
stats.war.endDate = getFullTimeDate(war.date, budg[5]);
} else if (line.includes('Respawn von ')) {
/**
* RESPAWN
*/
const playerName = line.substring(line.lastIndexOf('Respawn von ') + 12, line.lastIndexOf('"'));
stats.respawn.push(getRespawnEntry(budg, playerName, war._id, war.date));
} else {
stats.budget.push(getBudgetEntry(budg, war._id, war.date));
}
@ -140,13 +146,6 @@ const parseWarLog = (lineArray, war) => {
} else {
stats.points.push(getPointsEntry(pt, line, war._id, war.date));
}
} else if (line.includes('(Respawn)')) {
/**
* RESPAWN
*/
const resp = line.split(WHITESPACE);
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('(Revive)')) {
/**
* REVIVE

View File

@ -24,7 +24,7 @@
</ng-template>
</ngx-datatable-column>
<div *ngFor="let column of tableHead.slice(2, tableHead.length-1) ">
<div *ngFor="let column of tableHead.slice(2, tableHead.length) ">
<ngx-datatable-column [width]="columnWidth" prop="{{column.prop}}">
<ng-template ngx-datatable-header-template let-sort="sortFn">
<span class="datatable-header-cell-wrapper">

View File

@ -65,21 +65,18 @@
</div>
<button id="cancel"
*ngIf="!loading"
(click)="cancel()"
class="btn btn-default">
Abbrechen
</button>
<button id="save"
*ngIf="!loading"
(click)="updateWar()"
class="btn btn-default"
[disabled]="!form.valid">
Bestätigen
</button>
<span *ngIf="loading" class="load-indicator load-arrow glyphicon-refresh-animate"></span>
<span *ngIf="showErrorLabel"
class="center-block label label-danger" style="font-size: medium; padding: 2px; margin-top: 2px">
{{error}}

View File

@ -19,8 +19,6 @@ export class WarEditComponent {
subscription: Subscription;
showFileError = false;
showErrorLabel = false;
error;
@ -30,7 +28,7 @@ export class WarEditComponent {
constructor(private route: ActivatedRoute,
private router: Router,
private warService: WarService,
private campaignService: CampaignService) {
public campaignService: CampaignService) {
this.subscription = this.route.params
.map(params => params['id'])
.filter(id => id !== undefined)