merge dev, apply partey changes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user