delete canjoin function
This commit is contained in:
parent
f002170ed5
commit
fd1904c246
|
@ -13,7 +13,6 @@ export class MapController extends BaseController{
|
|||
super();
|
||||
this.App = App;
|
||||
this.getMapUrl();
|
||||
this.canConnectToMap();
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,23 +68,4 @@ export class MapController extends BaseController{
|
|||
|
||||
});
|
||||
}
|
||||
|
||||
canConnectToMap() {
|
||||
this.App.options("/canjoin", (res: HttpResponse, req: HttpRequest) => {
|
||||
this.addCorsHeaders(res);
|
||||
|
||||
res.end();
|
||||
});
|
||||
|
||||
this.App.get("/canjoin", (res: HttpResponse, req: HttpRequest) => {
|
||||
const query = parse(req.getQuery());
|
||||
const roomId = query.roomId as string;
|
||||
const world = socketManager.getWorlds().get(roomId);
|
||||
if (!world) {
|
||||
res.writeStatus('404').end('No room found');
|
||||
return;
|
||||
}
|
||||
res.writeStatus("200").end(world.isFull ? '1':'0');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue