lint fixes
This commit is contained in:
parent
94538bfaf4
commit
d98efc0433
@ -77,20 +77,18 @@ export class AuthenticateController extends BaseController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.App.post("/anonymLogin", (res: HttpResponse, req: HttpRequest) => {
|
this.App.post("/anonymLogin", (res: HttpResponse, req: HttpRequest) => {
|
||||||
(async () => {
|
this.addCorsHeaders(res);
|
||||||
this.addCorsHeaders(res);
|
|
||||||
|
|
||||||
res.onAborted(() => {
|
res.onAborted(() => {
|
||||||
console.warn('Login request was aborted');
|
console.warn('Login request was aborted');
|
||||||
})
|
})
|
||||||
|
|
||||||
const userUuid = v4();
|
const userUuid = v4();
|
||||||
const authToken = jwtTokenManager.createJWTToken(userUuid);
|
const authToken = jwtTokenManager.createJWTToken(userUuid);
|
||||||
res.writeStatus("200 OK").end(JSON.stringify({
|
res.writeStatus("200 OK").end(JSON.stringify({
|
||||||
authToken,
|
authToken,
|
||||||
userUuid,
|
userUuid,
|
||||||
}));
|
}));
|
||||||
})();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@ export class RoomIdentifier {
|
|||||||
public anonymous: boolean;
|
public anonymous: boolean;
|
||||||
public id:string
|
public id:string
|
||||||
constructor(roomID: string) {
|
constructor(roomID: string) {
|
||||||
if (roomID.indexOf('_/') === 0) {
|
if (roomID.startsWith('_/')) {
|
||||||
this.anonymous = true;
|
this.anonymous = true;
|
||||||
} else if(roomID.indexOf('@/') === 0) {
|
} else if(roomID.startsWith('@/')) {
|
||||||
this.anonymous = false;
|
this.anonymous = false;
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Incorrect room ID: '+roomID);
|
throw new Error('Incorrect room ID: '+roomID);
|
||||||
|
@ -6,7 +6,6 @@ import {PlayGlobalMessageInterface} from "../Connexion/ConnexionModels";
|
|||||||
export const CLASS_CONSOLE_MESSAGE = 'main-console';
|
export const CLASS_CONSOLE_MESSAGE = 'main-console';
|
||||||
export const INPUT_CONSOLE_MESSAGE = 'input-send-text';
|
export const INPUT_CONSOLE_MESSAGE = 'input-send-text';
|
||||||
export const UPLOAD_CONSOLE_MESSAGE = 'input-upload-music';
|
export const UPLOAD_CONSOLE_MESSAGE = 'input-upload-music';
|
||||||
export const BUTTON_CONSOLE_SEND = 'button-send';
|
|
||||||
export const INPUT_TYPE_CONSOLE = 'input-type';
|
export const INPUT_TYPE_CONSOLE = 'input-type';
|
||||||
|
|
||||||
export const AUDIO_TYPE = 'audio';
|
export const AUDIO_TYPE = 'audio';
|
||||||
@ -124,7 +123,7 @@ export class ConsoleGlobalMessageManager {
|
|||||||
// Start loading CSS
|
// Start loading CSS
|
||||||
const cssPromise = ConsoleGlobalMessageManager.loadCss();
|
const cssPromise = ConsoleGlobalMessageManager.loadCss();
|
||||||
// Import quill
|
// Import quill
|
||||||
const Quill = await import("quill") as any;
|
const Quill:any = await import("quill"); // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
// Wait for CSS to be loaded
|
// Wait for CSS to be loaded
|
||||||
await cssPromise;
|
await cssPromise;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class ConnectionManager {
|
|||||||
const connexionType = urlManager.getGameConnexionType();
|
const connexionType = urlManager.getGameConnexionType();
|
||||||
if(connexionType === GameConnexionTypes.register) {
|
if(connexionType === GameConnexionTypes.register) {
|
||||||
const organizationMemberToken = urlManager.getOrganizationToken();
|
const organizationMemberToken = urlManager.getOrganizationToken();
|
||||||
const data:any = await Axios.post(`${API_URL}/register`, {organizationMemberToken}).then(res => res.data);
|
const data = await Axios.post(`${API_URL}/register`, {organizationMemberToken}).then(res => res.data);
|
||||||
this.localUser = new LocalUser(data.userUuid, data.authToken);
|
this.localUser = new LocalUser(data.userUuid, data.authToken);
|
||||||
localUserStore.saveUser(this.localUser);
|
localUserStore.saveUser(this.localUser);
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ class ConnectionManager {
|
|||||||
if (localUser) {
|
if (localUser) {
|
||||||
this.localUser = localUser
|
this.localUser = localUser
|
||||||
} else {
|
} else {
|
||||||
const data:any = await Axios.post(`${API_URL}/anonymLogin`).then(res => res.data);
|
const data = await Axios.post(`${API_URL}/anonymLogin`).then(res => res.data);
|
||||||
this.localUser = new LocalUser(data.userUuid, data.authToken);
|
this.localUser = new LocalUser(data.userUuid, data.authToken);
|
||||||
localUserStore.saveUser(this.localUser);
|
localUserStore.saveUser(this.localUser);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ export class GameManager {
|
|||||||
return mapUrlStart.substring(startPos, endPos);
|
return mapUrlStart.substring(startPos, endPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async goToStartingMap(scenePlugin: Phaser.Scenes.ScenePlugin) {
|
public goToStartingMap(scenePlugin: Phaser.Scenes.ScenePlugin) {
|
||||||
console.log('Starting scene '+this.startRoom.url);
|
console.log('Starting scene '+this.startRoom.url);
|
||||||
scenePlugin.start(this.startRoom.url, {startLayerName: 'global'});
|
scenePlugin.start(this.startRoom.url, {startLayerName: 'global'});
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ export class EnableCameraScene extends Phaser.Scene {
|
|||||||
this.soundMeterSprite.setVolume(this.soundMeter.getVolume());
|
this.soundMeterSprite.setVolume(this.soundMeter.getVolume());
|
||||||
}
|
}
|
||||||
|
|
||||||
private async login(): Promise<void> {
|
private login(): void {
|
||||||
this.getElementByIdOrFail<HTMLDivElement>('webRtcSetup').style.display = 'none';
|
this.getElementByIdOrFail<HTMLDivElement>('webRtcSetup').style.display = 'none';
|
||||||
this.soundMeter.stop();
|
this.soundMeter.stop();
|
||||||
window.removeEventListener('resize', this.repositionCallback);
|
window.removeEventListener('resize', this.repositionCallback);
|
||||||
|
@ -12,11 +12,11 @@ class UrlManager {
|
|||||||
//todo: use that to detect if we can find a token in localstorage
|
//todo: use that to detect if we can find a token in localstorage
|
||||||
public getGameConnexionType(): GameConnexionTypes {
|
public getGameConnexionType(): GameConnexionTypes {
|
||||||
const url = window.location.pathname.toString();
|
const url = window.location.pathname.toString();
|
||||||
if (url.indexOf('_/') > -1) {
|
if (url.includes('_/')) {
|
||||||
return GameConnexionTypes.anonymous;
|
return GameConnexionTypes.anonymous;
|
||||||
} else if (url.indexOf('@/') > -1) {
|
} else if (url.includes('@/')) {
|
||||||
return GameConnexionTypes.organization;
|
return GameConnexionTypes.organization;
|
||||||
} else if(url.indexOf('register/') > -1) {
|
} else if(url.includes('register/')) {
|
||||||
return GameConnexionTypes.register
|
return GameConnexionTypes.register
|
||||||
} else {
|
} else {
|
||||||
return GameConnexionTypes.unknown
|
return GameConnexionTypes.unknown
|
||||||
|
Loading…
Reference in New Issue
Block a user