init, merge, add mobile

This commit is contained in:
Lurkars
2021-03-09 18:46:45 +01:00
parent 47149729c8
commit ea359410d8
7 changed files with 167 additions and 2 deletions
+9 -2
View File
@@ -6,6 +6,8 @@ import {LoginSceneName} from "../Login/LoginScene";
import {SelectCharacterSceneName} from "../Login/SelectCharacterScene";
import {EnableCameraSceneName} from "../Login/EnableCameraScene";
import {localUserStore} from "../../Connexion/LocalUserStore";
import {API_URL} from "../../Enum/EnvironmentVariable";
import Axios from "axios";
export interface HasMovedEvent {
direction: string;
@@ -32,9 +34,14 @@ export class GameManager {
this.startRoom = await connectionManager.initGameConnexion();
await this.loadMap(this.startRoom, scenePlugin);
if (!this.playerName) {
if(!this.playerName) {
const res = await Axios.get("/");
this.playerName = res.headers['bstlyusername'];
}
if(!this.playerName) {
return LoginSceneName;
} else if (!this.characterLayers) {
} else if(!this.characterLayers) {
return SelectCharacterSceneName;
} else {
return EnableCameraSceneName;