Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
Filter players that didn't load into the game
Browse files Browse the repository at this point in the history
  • Loading branch information
robflop committed May 23, 2018
1 parent 2701982 commit 8d18b58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ const app = new Vue({
.sort((a, b) => a.piIndex - b.piIndex)
.map(player => player.leftGameReason === 'Reconnected' ? player.pConInt = 4 : null);
// sort by piIndex and adjust connection status for reconnection
this.parsedMatchInfo = this.parsedMatchInfo.filter(player => player.piIndex !== -1);
// filter out players that didn't load into the game (piIndex === -1)
this.parsedMatchInfo.map(player => { // eslint-disable-line array-callback-return
player.lastJournalLeft = player.lastJournalLeft.split('\n').filter(line => line).map(line => line.trim());
player.lastJournalRight = player.lastJournalRight.split('\n').filter(line => line).map(line => line.trim());
});
// parse player logs
this.parsedChatLogs = this.chatLogsInput.split('[,]').filter(line => line).map(line => line.trim());
// this character sequence is the line seperator in raw report logs
this.savedChatLogs = this.parsedChatLogs;
Expand Down

0 comments on commit 8d18b58

Please sign in to comment.