better we.bslty & deveop integration

This commit is contained in:
_Bastler
2021-09-16 18:24:03 +02:00
parent f69fe463de
commit b47201687a
10 changed files with 80 additions and 27 deletions
+16 -3
View File
@@ -8,9 +8,12 @@ import { localUserStore } from "../../Connexion/LocalUserStore";
import { get } from "svelte/store";
import { requestedCameraState, requestedMicrophoneState } from "../../Stores/MediaStore";
import { helpCameraSettingsVisibleStore } from "../../Stores/HelpCameraSettingsStore";
import Axios from "axios";
import { menuIconVisiblilityStore } from "../../Stores/MenuStore";
import { emoteMenuVisiblilityStore } from "../../Stores/EmoteStore";
import { DEBUG_IGNORE_SSL } from "../../Enum/EnvironmentVariable";
import Axios from "axios";
import { AxiosRequestConfig } from "axios";
import https from "https";
/**
* This class should be responsible for any scene starting/stopping
@@ -38,8 +41,18 @@ export class GameManager {
this.loadMap(this.startRoom);
if (!this.playerName) {
const res = await Axios.get("/");
this.playerName = res.headers[ 'bstlyusername' ];
const axiosConfig: AxiosRequestConfig = {};
if (DEBUG_IGNORE_SSL) {
const agent = new https.Agent({
rejectUnauthorized: false,
});
axiosConfig.httpsAgent = agent;
}
const response = await Axios.get("/", axiosConfig);
this.playerName = response.headers[ 'bstlyusername' ];
}
//If player name was not set show login scene with player name
+5 -5
View File
@@ -1922,8 +1922,8 @@ export class GameScene extends DirtyScene {
this.userInputManager.disableControls();
this.scene.start(ErrorSceneName, {
title: "Banned",
subTitle: "You were banned from WorkAdventure",
message: "If you want more information, you may contact us at: hello@workadventu.re",
subTitle: "You were banned from Partey",
message: "If you want more information, you may contact us at: partey@bstly.de",
});
}
@@ -1938,14 +1938,14 @@ export class GameScene extends DirtyScene {
this.scene.start(ErrorSceneName, {
title: "Connection rejected",
subTitle: "The world you are trying to join is full. Try again later.",
message: "If you want more information, you may contact us at: hello@workadventu.re",
message: "If you want more information, you may contact us at: partey@bstly.de",
});
} else {
this.scene.start(ErrorSceneName, {
title: "Connection rejected",
subTitle: "You cannot join the World. Try again later. \n\r \n\r Error: " + message + ".",
subTitle: message + ".",
message:
"If you want more information, you may contact administrator or contact us at: hello@workadventu.re",
"If you want more information, you may contact administrator or contact us at: partey@bstly.de",
});
}
}