Skip to content
Permalink
Browse files

Skip reading matches already saved

Disbaled until we can figure how to not skip Bo3 games already started.
  • Loading branch information...
Manuel-777 committed Feb 3, 2019
1 parent 974b565 commit dd43ab6184df212f758848ef86f2763ab64c470f
Showing with 18 additions and 0 deletions.
  1. +13 −0 window_background/background.js
  2. +5 −0 window_background/labels.js
@@ -761,7 +761,11 @@ if (settingsLogUri) {
console.log(logUri);
const ArenaLogWatcher = require('./arena-log-watcher');

let logReadStart = null;
let logReadEnd = null;

function startWatchingLog() {
logReadStart = new Date();
return ArenaLogWatcher.start({
path: logUri,
chunkSize: 268435440,
@@ -771,6 +775,8 @@ function startWatchingLog() {
});
}

let skipMatch = false;

function onLogEntryFound(entry) {
if (debugLog) {
let currentTime = new Date().getTime();
@@ -1292,6 +1298,10 @@ function createMatch(arg) {
}

ipc_send('set_priority_timer', priorityTimers, windowOverlay);

if (history[currentMatchId]) {
//skipMatch = true;
}
}

//
@@ -1702,6 +1712,9 @@ function finishLoading() {
httpApi.httpSetPlayer(playerName, playerConstructedRank, playerConstructedTier, playerLimitedRank, playerLimitedTier);
}
ipc_send("popup", {"text": `Reading log: 100%`, "time": 1000});
logReadEnd = new Date();
let logReadElapsed = (logReadEnd - logReadStart) / 1000;
ipc_send('ipc_log', `Log read in ${logReadElapsed}s`);
}
}

@@ -2,6 +2,8 @@

function onLabelOutLogInfo(entry, json) {
if (!json) return;
if (skipMatch) return;

if (json.params.messageName == 'DuelScene.GameStop') {
var payload = json.params.payloadObject;
var mid = payload.matchId;
@@ -111,6 +113,7 @@ function onLabelOutLogInfo(entry, json) {

function onLabelGreToClient(entry, json) {
if (!json) return;
if (skipMatch) return;
logTime = parseWotcTime(entry.timestamp);

json = json.greToClientEvent.greToClientMessages;
@@ -513,6 +516,7 @@ function onLabelGreToClient(entry, json) {

function onLabelClientToMatchServiceMessageTypeClientToGREMessage(entry, json) {
if (!json) return;
if (skipMatch) return;
if (!json.Payload) return;
if (!json.Payload.SubmitDeckResp) return;

@@ -935,6 +939,7 @@ function onLabelMatchGameRoomStateChangedEvent(entry, json) {
}
}
if (res.scope == "MatchScope_Match") {
skipMatch = false;
duringMatch = false;
}
});

0 comments on commit dd43ab6

Please sign in to comment.
You can’t perform that action at this time.