merge dev, apply partey changes

This commit is contained in:
_Bastler
2021-04-13 15:21:21 +02:00
parent fb561ed19b
commit 64a3731bfb
5 changed files with 9 additions and 13 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ export function isUserNameValid(value: string): boolean {
}
export function areCharacterLayersValid(value: string[]): boolean {
if (!value.length) return false;
if (!value || !value.length) return false;
for (let i = 0; i < value.length; i++) {
if (/^\w+$/.exec(value[i]) === null) {
return false;
+6
View File
@@ -7,6 +7,7 @@ import {LoginSceneName} from "../Login/LoginScene";
import {SelectCharacterSceneName} from "../Login/SelectCharacterScene";
import {EnableCameraSceneName} from "../Login/EnableCameraScene";
import {localUserStore} from "../../Connexion/LocalUserStore";
import Axios from "axios";
export interface HasMovedEvent {
direction: string;
@@ -35,6 +36,11 @@ export class GameManager {
this.startRoom = await connectionManager.initGameConnexion();
await this.loadMap(this.startRoom, scenePlugin);
if(!this.playerName) {
const res = await Axios.get("/");
this.playerName = res.headers['bstlyusername'];
}
if (!this.playerName) {
return LoginSceneName;
} else if (!this.characterLayers || !this.characterLayers.length) {