diff --git a/src/js/core/config.js b/src/js/core/config.js index c96aea20..47030972 100644 --- a/src/js/core/config.js +++ b/src/js/core/config.js @@ -17,7 +17,6 @@ export const THIRDPARTY_URLS = { privacyPolicy: "https://tobspr.io/privacy.html", - standaloneStorePage: "https://store.steampowered.com/app/1318690/shapezio/", stanaloneCampaignLink: "https://get.shapez.io", puzzleDlcStorePage: "https://store.steampowered.com/app/1625400/shapezio__Puzzle_DLC", diff --git a/src/js/game/modes/regular.js b/src/js/game/modes/regular.js index 6a276e4f..5b89ff4d 100644 --- a/src/js/game/modes/regular.js +++ b/src/js/game/modes/regular.js @@ -610,20 +610,13 @@ export class RegularGameMode extends GameMode { } get difficultyMultiplicator() { - switch (this.root.app.gameAnalytics.abtVariant) { - case "0": - return 0.2; - case "1": - return 0.5; - case "2": + if (G_IS_STANDALONE) { + if (G_IS_STEAM_DEMO) { return 0.75; - case "3": - return 1; - case "4": - return 1.25; - case "5": - return 2; + } + return 1; } + return 0.5; } /** diff --git a/src/js/platform/browser/game_analytics.js b/src/js/platform/browser/game_analytics.js index 4b3f0440..2b762f33 100644 --- a/src/js/platform/browser/game_analytics.js +++ b/src/js/platform/browser/game_analytics.js @@ -1,4 +1,4 @@ -import { globalConfig } from "../../core/config"; +import { globalConfig, THIRDPARTY_URLS } from "../../core/config"; import { createLogger } from "../../core/logging"; import { queryParamOptions } from "../../core/query_parameters"; import { randomInt } from "../../core/utils"; @@ -18,8 +18,8 @@ const analyticsUrl = G_IS_DEV ? "http://localhost:8001" : "https://analytics.sha // Be sure to increment the ID whenever it changes const analyticsLocalFile = G_IS_STEAM_DEMO ? "shapez_token_steamdemo.bin" : "shapez_token_123.bin"; -const CURRENT_ABT = "abt_dif"; -const CURRENT_ABT_COUNT = 6; +const CURRENT_ABT = "abt_spl"; +const CURRENT_ABT_COUNT = 2; export class ShapezGameAnalytics extends GameAnalyticsInterface { constructor(app) { @@ -52,29 +52,36 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface { } fetchABVariant() { - return this.app.storage.readFileAsync("shapez_" + CURRENT_ABT + ".bin").then( - abt => { - if (typeof queryParamOptions.abtVariant === "string") { - this.abtVariant = queryParamOptions.abtVariant; - logger.log("Set", CURRENT_ABT, "to (OVERRIDE) ", this.abtVariant); - } else { - this.abtVariant = abt; - logger.log("Read abtVariant:", abt); - } - }, - err => { - if (err === FILE_NOT_FOUND) { + return this.app.storage + .readFileAsync("shapez_" + CURRENT_ABT + ".bin") + .then( + abt => { if (typeof queryParamOptions.abtVariant === "string") { this.abtVariant = queryParamOptions.abtVariant; logger.log("Set", CURRENT_ABT, "to (OVERRIDE) ", this.abtVariant); } else { - this.abtVariant = String(randomInt(0, CURRENT_ABT_COUNT - 1)); - logger.log("Set", CURRENT_ABT, "to", this.abtVariant); + this.abtVariant = abt; + logger.log("Read abtVariant:", abt); + } + }, + err => { + if (err === FILE_NOT_FOUND) { + if (typeof queryParamOptions.abtVariant === "string") { + this.abtVariant = queryParamOptions.abtVariant; + logger.log("Set", CURRENT_ABT, "to (OVERRIDE) ", this.abtVariant); + } else { + this.abtVariant = String(randomInt(0, CURRENT_ABT_COUNT - 1)); + logger.log("Set", CURRENT_ABT, "to", this.abtVariant); + } + this.app.storage.writeFileAsync("shapez_" + CURRENT_ABT + ".bin", this.abtVariant); } - this.app.storage.writeFileAsync("shapez_" + CURRENT_ABT + ".bin", this.abtVariant); } - } - ); + ) + .then(() => { + if (this.abtVariant === "1") { + THIRDPARTY_URLS.stanaloneCampaignLink = "https://get.shapez.io/bundle"; + } + }); } /**