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

View File

@ -24,7 +24,7 @@
</ng-template> </ng-template>
</ngx-datatable-column> </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}}"> <ngx-datatable-column [width]="columnWidth" prop="{{column.prop}}">
<ng-template ngx-datatable-header-template let-sort="sortFn"> <ng-template ngx-datatable-header-template let-sort="sortFn">
<span class="datatable-header-cell-wrapper"> <span class="datatable-header-cell-wrapper">

View File

@ -50,7 +50,7 @@
[(ngModel)]="war.endBudgetBlufor" [(ngModel)]="war.endBudgetBlufor"
name="endBudgetBlufor" name="endBudgetBlufor"
id="endBudgetBlufor" id="endBudgetBlufor"
required /> required/>
<show-error displayName="Name" controlPath="endBudgetBlufor"></show-error> <show-error displayName="Name" controlPath="endBudgetBlufor"></show-error>
</div> </div>
@ -60,26 +60,23 @@
[(ngModel)]="war.endBudgetOpfor" [(ngModel)]="war.endBudgetOpfor"
name="endBudgetOpfor" name="endBudgetOpfor"
id="endBudgetOpfor" id="endBudgetOpfor"
required /> required/>
<show-error displayName="Name" controlPath="endBudgetOpfor"></show-error> <show-error displayName="Name" controlPath="endBudgetOpfor"></show-error>
</div> </div>
<button id="cancel" <button id="cancel"
*ngIf="!loading"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen Abbrechen
</button> </button>
<button id="save" <button id="save"
*ngIf="!loading"
(click)="updateWar()" (click)="updateWar()"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid"> [disabled]="!form.valid">
Bestätigen Bestätigen
</button> </button>
<span *ngIf="loading" class="load-indicator load-arrow glyphicon-refresh-animate"></span>
<span *ngIf="showErrorLabel" <span *ngIf="showErrorLabel"
class="center-block label label-danger" style="font-size: medium; padding: 2px; margin-top: 2px"> class="center-block label label-danger" style="font-size: medium; padding: 2px; margin-top: 2px">
{{error}} {{error}}

View File

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