Skip to content
Permalink
Browse files

more bugfixes (#752)

* bugfix sideboarding

* font size

* bugfix allowDowngrade

This will downgrade those who dont have beta channel enabled and try to install a beta version
  • Loading branch information
Manuel-777 committed Nov 23, 2019
1 parent 3ef2a08 commit 3dd01d222170e04d6936849b4a6a6ba27b1d6662
Showing with 16 additions and 19 deletions.
  1. +1 −1 src/main.js
  2. +1 −1 src/shared/shared.css
  3. +14 −17 src/window_background/labels.js
@@ -90,7 +90,7 @@ function startUpdater() {
updaterWindow.moveTop();
});

autoUpdater.allowDowngrade = true;
//autoUpdater.allowDowngrade = true;
let betaChannel = rememberStore.get("settings.beta_channel");
if (betaChannel) {
autoUpdater.allowPrerelease = true;

Some generated files are not rendered by default. Learn more.

@@ -50,11 +50,9 @@ function clearDraftData(draftId) {
}
}

function decodePayload(json) {
function decodePayload(payload, msgType) {
const messages = require("./messages_pb");

const msgType = json.clientToMatchServiceMessageType.split("_")[1],
binaryMsg = new Buffer.from(json.payload, "base64");
const binaryMsg = new Buffer.from(payload, "base64");

try {
let msgDeserialiser;
@@ -76,8 +74,6 @@ function decodePayload(json) {
return;
}
const msg = msgDeserialiser.deserializeBinary(binaryMsg);
//console.log(json.msgType);
//console.log(msg.toObject());
return msg.toObject();
} catch (e) {
console.log(e.message);
@@ -495,24 +491,25 @@ export function onLabelClientToMatchServiceMessageTypeClientToGREMessage(
const json = entry.json();
if (!json) return;
if (skipMatch) return;
let payload = json;
if (json.Payload) {
json.payload = json.Payload;
payload = json.Payload;
}
if (!json.payload) return;

if (typeof json.payload == "string") {
json.payload = decodePayload(json);
json.payload = normaliseFields(json.payload);
console.log("Client To GRE: ", json.payload);
if (typeof payload == "string") {
const msgType = entry.label.split("_")[1];
payload = decodePayload(payload, msgType);
payload = normaliseFields(payload);
//console.log("Client To GRE: ", payload);
}

if (json.payload.submitdeckresp) {
if (payload.submitdeckresp) {
// Get sideboard changes
let deckResp = json.payload.submitdeckresp.deck;
const deckResp = payload.submitdeckresp.deck;

let tempMain = new CardsList(deckResp.deckcards);
let tempSide = new CardsList(deckResp.sideboardcards);
let newDeck = globals.currentMatch.player.deck.clone();
const tempMain = new CardsList(deckResp.deckcards);
const tempSide = new CardsList(deckResp.sideboardcards);
const newDeck = globals.currentMatch.player.deck.clone();
newDeck.mainboard = tempMain;
newDeck.sideboard = tempSide;
newDeck.getColors();

0 comments on commit 3dd01d2

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