Permalink
Browse files

fix missing matches results

fixes #148
  • Loading branch information...
Manuel-777 committed Jan 11, 2019
1 parent f7f1adb commit 5248bf5b7d43feabdb626bb2b7ceba5c32fa6441
Showing with 10 additions and 1 deletion.
  1. +4 −1 window_background/arena-log-decoder/arena-log-decoder.js
  2. +6 −0 window_background/labels.js
@@ -5,9 +5,10 @@ const CONNECTION_JSON_PATTERN =
'\\[(?:UnityCrossThreadLogger|Client GRE)\\]WebSocketClient (.*) WebSocketSharp\\.WebSocket connecting to .*: (.*)\\r\\n';

const LABEL_JSON_PATTERNS = [
'\\[Client GRE\\](.*): .*: (.*)\\r\\n\\[Message (.*)\\]',
'\\[Client GRE\\](.*): .*: (.*)\\r\\n',
'\\[UnityCrossThreadLogger\\](.*)[\r\n]{0,}\\(.*\\) Incoming (.*) ',
'\\[UnityCrossThreadLogger\\]Received unhandled GREMessageType:() (.*)\\r\\n',
'\\[UnityCrossThreadLogger\\]Received unhandled GREMessageType:() (.*)\\r\\n'
];

const LABEL_ARROW_JSON_PATTERN = '\\[UnityCrossThreadLogger\\](.*)\\r\\n([<=]=[=>]) (.*)\\(.*\\):?\\r\\n';
@@ -128,6 +129,8 @@ function parseLogEntry(text, matchText, position) {
return ['full', matchText.length + jsonLen + textAfterJson.length, {
type: 'label_json',
label: rematches[2],
//matchText: matchText,
//text: text.substr(jsonStart, jsonLen),
timestamp: rematches[1],
json: () => JSON.parse(text.substr(jsonStart, jsonLen)),
}];
@@ -6,6 +6,12 @@ function onLabelOutLogInfo(entry, json) {
var mid = json.params.payloadObject.matchId;
var time = json.params.payloadObject.secondsCount;
if (mid == currentMatchId) {
if (playerWin == 0 && oppWin == 0) {
if (json.params.payloadObject.winningTeamId == playerSeat)
playerWin += 1;
else
oppWin += 1;
}
currentMatchTime += time;
saveMatch();
}

0 comments on commit 5248bf5

Please sign in to comment.