parent
cd7763770e
commit
cd586a9e0c
4 changed files with 9 additions and 9 deletions
|
@ -128,7 +128,7 @@ export interface ConnexionInterface {
|
|||
|
||||
createConnexion(name: string, characterSelected: string): Promise<any>;
|
||||
|
||||
loadMaps(): Promise<any>;
|
||||
loadStartMap(): Promise<any>;
|
||||
|
||||
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<any> {
|
||||
return Axios.get(`${API_URL}/maps`)
|
||||
loadStartMap() : Promise<any> {
|
||||
return Axios.get(`${API_URL}/start-map`)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
}).catch((err) => {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue