Compare commits
4 Commits
c51468157f
...
a5022443f3
Author | SHA1 | Date |
---|---|---|
tobspr | a5022443f3 | |
tobspr | 8ff2f43d0c | |
tobspr | 934cba22a2 | |
tobspr | 3b79662721 |
|
@ -28,8 +28,6 @@
|
||||||
"@babel/plugin-transform-classes": "^7.5.5",
|
"@babel/plugin-transform-classes": "^7.5.5",
|
||||||
"@babel/preset-env": "^7.5.4",
|
"@babel/preset-env": "^7.5.4",
|
||||||
"@nastyox/rando.js": "^2.0.5",
|
"@nastyox/rando.js": "^2.0.5",
|
||||||
"@openreplay/tracker": "^3.5.12",
|
|
||||||
"@openreplay/tracker-fetch": "^3.5.3",
|
|
||||||
"@types/cordova": "^0.0.34",
|
"@types/cordova": "^0.0.34",
|
||||||
"@types/filesystem": "^0.0.29",
|
"@types/filesystem": "^0.0.29",
|
||||||
"ajv": "^6.10.2",
|
"ajv": "^6.10.2",
|
||||||
|
|
|
@ -10,25 +10,8 @@ import { InGameState } from "../../states/ingame";
|
||||||
import { SteamAchievementProvider } from "../electron/steam_achievement_provider";
|
import { SteamAchievementProvider } from "../electron/steam_achievement_provider";
|
||||||
import { GameAnalyticsInterface } from "../game_analytics";
|
import { GameAnalyticsInterface } from "../game_analytics";
|
||||||
import { FILE_NOT_FOUND } from "../storage";
|
import { FILE_NOT_FOUND } from "../storage";
|
||||||
|
|
||||||
import OR from "@openreplay/tracker";
|
|
||||||
import OR_fetch from "@openreplay/tracker-fetch";
|
|
||||||
import { WEB_STEAM_SSO_AUTHENTICATED } from "../../core/steam_sso";
|
import { WEB_STEAM_SSO_AUTHENTICATED } from "../../core/steam_sso";
|
||||||
|
|
||||||
let eventConnector;
|
|
||||||
if (!G_IS_STANDALONE && !G_IS_DEV) {
|
|
||||||
eventConnector = new OR({
|
|
||||||
projectKey: "mhZgUFQBI6QAtt3PRLer",
|
|
||||||
respectDoNotTrack: true,
|
|
||||||
revID: G_BUILD_COMMIT_HASH,
|
|
||||||
heatmaps: false,
|
|
||||||
verbose: false,
|
|
||||||
captureIFrames: false,
|
|
||||||
});
|
|
||||||
eventConnector.start({});
|
|
||||||
eventConnector.use(OR_fetch({ overrideGlobal: true }));
|
|
||||||
}
|
|
||||||
|
|
||||||
const logger = createLogger("game_analytics");
|
const logger = createLogger("game_analytics");
|
||||||
|
|
||||||
const analyticsUrl = G_IS_DEV ? "http://localhost:8001" : "https://analytics.shapez.io";
|
const analyticsUrl = G_IS_DEV ? "http://localhost:8001" : "https://analytics.shapez.io";
|
||||||
|
@ -123,15 +106,7 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
noteMinor(action, payload = "") {
|
noteMinor(action, payload = "") {}
|
||||||
if (eventConnector) {
|
|
||||||
try {
|
|
||||||
eventConnector.event(action, payload);
|
|
||||||
} catch (ex) {
|
|
||||||
console.warn("Failed to note event:", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
|
@ -175,9 +150,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
||||||
syncKey => {
|
syncKey => {
|
||||||
this.syncKey = syncKey;
|
this.syncKey = syncKey;
|
||||||
logger.log("Player sync key read:", this.syncKey);
|
logger.log("Player sync key read:", this.syncKey);
|
||||||
if (eventConnector) {
|
|
||||||
eventConnector.setUserID(syncKey);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
// File was not found, retrieve new key
|
// File was not found, retrieve new key
|
||||||
|
@ -217,9 +189,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
||||||
this.syncKey = res.key;
|
this.syncKey = res.key;
|
||||||
logger.log("Key retrieved:", this.syncKey);
|
logger.log("Key retrieved:", this.syncKey);
|
||||||
this.app.storage.writeFileAsync(analyticsLocalFile, res.key);
|
this.app.storage.writeFileAsync(analyticsLocalFile, res.key);
|
||||||
if (eventConnector) {
|
|
||||||
eventConnector.setUserID(eventConnector);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Bad response from analytics server: " + res);
|
throw new Error("Bad response from analytics server: " + res);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,9 +73,9 @@ export class PreloadState extends GameState {
|
||||||
"https://analytics.shapez.io/campaign/" +
|
"https://analytics.shapez.io/campaign/" +
|
||||||
queryParamOptions.campaign +
|
queryParamOptions.campaign +
|
||||||
"?lpurl=nocontent&fbclid=" +
|
"?lpurl=nocontent&fbclid=" +
|
||||||
queryParamOptions.fbclid +
|
(queryParamOptions.fbclid || "") +
|
||||||
"&gclid=" +
|
"&gclid=" +
|
||||||
queryParamOptions.gclid
|
(queryParamOptions.gclid || "")
|
||||||
).catch(err => {
|
).catch(err => {
|
||||||
console.warn("Failed to send beacon:", err);
|
console.warn("Failed to send beacon:", err);
|
||||||
});
|
});
|
||||||
|
@ -97,8 +97,17 @@ export class PreloadState extends GameState {
|
||||||
|
|
||||||
startLoading() {
|
startLoading() {
|
||||||
this.setStatus("Booting")
|
this.setStatus("Booting")
|
||||||
|
.then(() => {
|
||||||
|
try {
|
||||||
|
window.localStorage.setItem("local_storage_feature_detection", "1");
|
||||||
|
} catch (ex) {
|
||||||
|
throw new Error(
|
||||||
|
"Could not access local storage. Make sure you are not playing in incognito mode and allow thirdparty cookies!"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})
|
||||||
.then(() => this.setStatus("Creating platform wrapper", 3))
|
.then(() => this.setStatus("Creating platform wrapper", 3))
|
||||||
|
|
||||||
.then(() => this.sendBeacon())
|
.then(() => this.sendBeacon())
|
||||||
.then(() => authorizeViaSSOToken(this.app, this.dialogs))
|
.then(() => authorizeViaSSOToken(this.app, this.dialogs))
|
||||||
|
|
||||||
|
@ -345,12 +354,6 @@ export class PreloadState extends GameState {
|
||||||
${this.currentStatus} failed:<br/>
|
${this.currentStatus} failed:<br/>
|
||||||
${text}
|
${text}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="supportHelp">
|
|
||||||
Please send me an email with steps to reproduce and what you did before this happened:
|
|
||||||
<br /><a class="email" href="mailto:${email}?subject=App%20does%20not%20launch">${email}</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="lower">
|
<div class="lower">
|
||||||
<button class="resetApp styledButton">Reset App</button>
|
<button class="resetApp styledButton">Reset App</button>
|
||||||
<i>Build ${G_BUILD_VERSION} @ ${G_BUILD_COMMIT_HASH}</i>
|
<i>Build ${G_BUILD_VERSION} @ ${G_BUILD_COMMIT_HASH}</i>
|
||||||
|
|
24
yarn.lock
24
yarn.lock
|
@ -1102,18 +1102,6 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" ">= 8"
|
"@types/node" ">= 8"
|
||||||
|
|
||||||
"@openreplay/tracker-fetch@^3.5.3":
|
|
||||||
version "3.5.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@openreplay/tracker-fetch/-/tracker-fetch-3.5.3.tgz#f4a8308cfffc83918e8d34716bae771cb442b41b"
|
|
||||||
integrity sha512-09vcR1H8178uDpaA2U4u1GvzAQD94ASmvrWM8dVXY0SmZdQHTTmNdkb4xijhkUY99gtJdB8qFgnIr+dP3FsSbg==
|
|
||||||
|
|
||||||
"@openreplay/tracker@^3.5.12":
|
|
||||||
version "3.5.12"
|
|
||||||
resolved "https://registry.yarnpkg.com/@openreplay/tracker/-/tracker-3.5.12.tgz#141205bfefa42c767eaad1938cd206e3d551e171"
|
|
||||||
integrity sha512-R8s87HevJRzC/yujzswll+UyF0kybEax9UJr2eu7Y2nf1QhioD589HwDPlsXb1SxkMDd2yDQYfhbF0FXpCEfQA==
|
|
||||||
dependencies:
|
|
||||||
error-stack-parser "^2.0.6"
|
|
||||||
|
|
||||||
"@sindresorhus/is@^0.7.0":
|
"@sindresorhus/is@^0.7.0":
|
||||||
version "0.7.0"
|
version "0.7.0"
|
||||||
resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz"
|
resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz"
|
||||||
|
@ -3348,13 +3336,6 @@ error-ex@^1.2.0, error-ex@^1.3.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
is-arrayish "^0.2.1"
|
is-arrayish "^0.2.1"
|
||||||
|
|
||||||
error-stack-parser@^2.0.6:
|
|
||||||
version "2.1.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.1.4.tgz#229cb01cdbfa84440bfa91876285b94680188286"
|
|
||||||
integrity sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==
|
|
||||||
dependencies:
|
|
||||||
stackframe "^1.3.4"
|
|
||||||
|
|
||||||
es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.5:
|
es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.5:
|
||||||
version "1.17.5"
|
version "1.17.5"
|
||||||
resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz"
|
resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz"
|
||||||
|
@ -7819,11 +7800,6 @@ stable@^0.1.8:
|
||||||
resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz"
|
resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz"
|
||||||
integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==
|
integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==
|
||||||
|
|
||||||
stackframe@^1.3.4:
|
|
||||||
version "1.3.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.3.4.tgz#b881a004c8c149a5e8efef37d51b16e412943310"
|
|
||||||
integrity sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==
|
|
||||||
|
|
||||||
static-extend@^0.1.1:
|
static-extend@^0.1.1:
|
||||||
version "0.1.2"
|
version "0.1.2"
|
||||||
resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz"
|
resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz"
|
||||||
|
|
Loading…
Reference in New Issue