constructor(App: Application) {
this.App = App;
- this.getMaps();
+ this.getStartMap();
this.assetMaps();
}
}
// 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"
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;
}
//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) => {
});
}
- loadMaps(){
- return this.ConnexionInstance.loadMaps().then((data) => {
+ loadStartMap(){
+ return this.ConnexionInstance.loadStartMap().then((data) => {
return data;
}).catch((err) => {
throw err;
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;
}