mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Authorize via steam
This commit is contained in:
@@ -32,6 +32,12 @@ export class AchievementProxy {
|
||||
}
|
||||
|
||||
onLoad() {
|
||||
if (!this.root.gameMode.hasAchievements()) {
|
||||
logger.log("Disabling achievements because game mode does not have achievements");
|
||||
this.disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
this.provider
|
||||
.onLoad(this.root)
|
||||
.then(() => {
|
||||
|
||||
@@ -112,6 +112,11 @@ export class GameMode extends BasicSerializableObject {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @returns {boolean} */
|
||||
hasAchievements() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @returns {number} */
|
||||
getMinimumZoom() {
|
||||
return 0.1;
|
||||
|
||||
@@ -615,4 +615,9 @@ export class RegularGameMode extends GameMode {
|
||||
getIsFreeplayAvailable() {
|
||||
return this.root.app.restrictionMgr.getHasExtendedLevelsAndFreeplay();
|
||||
}
|
||||
|
||||
/** @returns {boolean} */
|
||||
hasAchievements() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { getIPCRenderer } from "../core/utils";
|
||||
import { T } from "../translations";
|
||||
|
||||
const logger = createLogger("puzzle-api");
|
||||
const rusha = require("rusha");
|
||||
|
||||
export class ClientAPI {
|
||||
/**
|
||||
@@ -22,15 +21,6 @@ export class ClientAPI {
|
||||
* @type {string|null}
|
||||
*/
|
||||
this.token = null;
|
||||
|
||||
this.syncToken = window.localStorage.getItem("tmp.syncToken");
|
||||
if (!this.syncToken) {
|
||||
this.syncToken = rusha
|
||||
.createHash()
|
||||
.update(new Date().getTime() + "=" + Math.random())
|
||||
.digest("hex");
|
||||
window.localStorage.setItem("tmp.syncToken", this.syncToken);
|
||||
}
|
||||
}
|
||||
|
||||
getEndpoint() {
|
||||
|
||||
Reference in New Issue
Block a user