From cd586a9e0c1af4eeb431f6136240e3638ae8a6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Sun, 24 May 2020 22:53:10 +0200 Subject: [PATCH] Renaming /maps to /start-map Closes #90 --- back/src/Controller/MapController.ts | 6 +++--- front/src/Connexion.ts | 6 +++--- front/src/Phaser/Game/GameManager.ts | 4 ++-- front/src/Phaser/Login/LogincScene.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/back/src/Controller/MapController.ts b/back/src/Controller/MapController.ts index f7e78a03..68243df5 100644 --- a/back/src/Controller/MapController.ts +++ b/back/src/Controller/MapController.ts @@ -8,7 +8,7 @@ export class MapController { constructor(App: Application) { this.App = App; - this.getMaps(); + this.getStartMap(); this.assetMaps(); } @@ -17,8 +17,8 @@ export class MapController { } // Returns a map mapping map name to file name of the map - getMaps() { - this.App.get("/maps", (req: Request, res: Response) => { + getStartMap() { + this.App.get("/start-map", (req: Request, res: Response) => { return res.status(OK).send({ mapUrlStart: req.headers.host + "/map/files" + URL_ROOM_STARTED, startInstance: "global" diff --git a/front/src/Connexion.ts b/front/src/Connexion.ts index 0d4429f5..9aa5135e 100644 --- a/front/src/Connexion.ts +++ b/front/src/Connexion.ts @@ -128,7 +128,7 @@ export interface ConnexionInterface { createConnexion(name: string, characterSelected: string): Promise; - loadMaps(): Promise; + loadStartMap(): Promise; joinARoom(roomId: string, startX: number, startY: number, direction: string, moving: boolean): void; @@ -230,8 +230,8 @@ export class Connexion implements ConnexionInterface { } //TODO add middleware with access token to secure api - loadMaps() : Promise { - return Axios.get(`${API_URL}/maps`) + loadStartMap() : Promise { + return Axios.get(`${API_URL}/start-map`) .then((res) => { return res.data; }).catch((err) => { diff --git a/front/src/Phaser/Game/GameManager.ts b/front/src/Phaser/Game/GameManager.ts index c0f8150d..797688b5 100644 --- a/front/src/Phaser/Game/GameManager.ts +++ b/front/src/Phaser/Game/GameManager.ts @@ -54,8 +54,8 @@ export class GameManager { }); } - loadMaps(){ - return this.ConnexionInstance.loadMaps().then((data) => { + loadStartMap(){ + return this.ConnexionInstance.loadStartMap().then((data) => { return data; }).catch((err) => { throw err; diff --git a/front/src/Phaser/Login/LogincScene.ts b/front/src/Phaser/Login/LogincScene.ts index b7199e31..9886f42b 100644 --- a/front/src/Phaser/Login/LogincScene.ts +++ b/front/src/Phaser/Login/LogincScene.ts @@ -101,7 +101,7 @@ export class LogincScene extends Phaser.Scene { return mapUrl; } else { // If we do not have a map address in the URL, let's ask the server for a start map. - return gameManager.loadMaps().then((scene : any) => { + return gameManager.loadStartMap().then((scene : any) => { if (!scene) { return; }