From 64a3731bfb9bd589af209dbed543dcf04fce46a5 Mon Sep 17 00:00:00 2001
From: _Bastler <_Bastler@bstly.de>
Date: Tue, 13 Apr 2021 15:21:21 +0200
Subject: [PATCH] merge dev, apply partey changes
---
front/dist/index.tmpl.html | 4 +---
front/dist/resources/html/gameMenu.html | 8 --------
front/src/Connexion/LocalUser.ts | 2 +-
front/src/Phaser/Game/GameManager.ts | 6 ++++++
front/webpack.config.js | 2 +-
5 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/front/dist/index.tmpl.html b/front/dist/index.tmpl.html
index 062622b8..40f437c8 100644
--- a/front/dist/index.tmpl.html
+++ b/front/dist/index.tmpl.html
@@ -29,10 +29,8 @@
-
-
-
diff --git a/front/dist/resources/html/gameMenu.html b/front/dist/resources/html/gameMenu.html
index ce740ec5..b94c9949 100644
--- a/front/dist/resources/html/gameMenu.html
+++ b/front/dist/resources/html/gameMenu.html
@@ -24,9 +24,6 @@
-
@@ -39,15 +36,10 @@
-
-
-
diff --git a/front/src/Connexion/LocalUser.ts b/front/src/Connexion/LocalUser.ts
index b8e0a204..968787e1 100644
--- a/front/src/Connexion/LocalUser.ts
+++ b/front/src/Connexion/LocalUser.ts
@@ -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;
diff --git a/front/src/Phaser/Game/GameManager.ts b/front/src/Phaser/Game/GameManager.ts
index c146c06d..d7d2a4f7 100644
--- a/front/src/Phaser/Game/GameManager.ts
+++ b/front/src/Phaser/Game/GameManager.ts
@@ -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) {
diff --git a/front/webpack.config.js b/front/webpack.config.js
index f1a3df44..6890f4fd 100644
--- a/front/webpack.config.js
+++ b/front/webpack.config.js
@@ -12,7 +12,7 @@ module.exports = {
devServer: {
contentBase: './dist',
host: '0.0.0.0',
- sockPort: 80,
+ sockPort: 443,
disableHostCheck: true,
historyApiFallback: {
rewrites: [