From fa2e583d485b0fee1a5cb7ab47d8fad1261c5811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Thu, 16 Dec 2021 10:04:41 +0100 Subject: [PATCH] Reimporting correctly types moved to /messages --- front/src/Connexion/ConnectionManager.ts | 4 +++- front/src/Connexion/Room.ts | 7 +++---- pusher/src/Controller/IoSocketController.ts | 2 +- pusher/src/Services/AdminApi.ts | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/front/src/Connexion/ConnectionManager.ts b/front/src/Connexion/ConnectionManager.ts index 39bb079c..6c40631c 100644 --- a/front/src/Connexion/ConnectionManager.ts +++ b/front/src/Connexion/ConnectionManager.ts @@ -197,7 +197,9 @@ class ConnectionManager { // try to connect with function loadOpenIDScreen if ( this._currentRoom.authenticationMandatory || - (axios.isAxiosError(err) && err.response?.data && err.response.data !== "User cannot to be connected on openid provider") + (axios.isAxiosError(err) && + err.response?.data && + err.response.data !== "User cannot to be connected on openid provider") ) { this.loadOpenIDScreen(); return Promise.reject(new Error("You will be redirect on login page")); diff --git a/front/src/Connexion/Room.ts b/front/src/Connexion/Room.ts index 15ac9502..6bd53c8b 100644 --- a/front/src/Connexion/Room.ts +++ b/front/src/Connexion/Room.ts @@ -5,8 +5,8 @@ import type { CharacterTexture } from "./LocalUser"; import { localUserStore } from "./LocalUserStore"; import axios from "axios"; import { axiosWithRetry } from "./AxiosUtils"; -import {isMapDetailsData} from "../../../pusher/src/Messages/JsonMessages/MapDetailsData"; -import {isRoomRedirect} from "../Messages/JsonMessages/RoomRedirect"; +import { isMapDetailsData } from "../Messages/JsonMessages/MapDetailsData"; +import { isRoomRedirect } from "../Messages/JsonMessages/RoomRedirect"; export class MapDetail { constructor(public readonly mapUrl: string, public readonly textures: CharacterTexture[] | undefined) {} @@ -119,9 +119,8 @@ export class Room { this._contactPage = data.contactPage || CONTACT_URL; return new MapDetail(data.mapUrl, data.textures); } else { - throw new Error('Data received by the /map endpoint of the Pusher is not in a valid format.'); + throw new Error("Data received by the /map endpoint of the Pusher is not in a valid format."); } - } catch (e) { if (axios.isAxiosError(e) && e.response?.status == 401 && e.response?.data === "Token decrypted error") { console.warn("JWT token sent could not be decrypted. Maybe it expired?"); diff --git a/pusher/src/Controller/IoSocketController.ts b/pusher/src/Controller/IoSocketController.ts index 4c09638a..4d62f7fa 100644 --- a/pusher/src/Controller/IoSocketController.ts +++ b/pusher/src/Controller/IoSocketController.ts @@ -29,7 +29,7 @@ import { emitInBatch } from "../Services/IoSocketHelpers"; import { ADMIN_API_URL, DISABLE_ANONYMOUS, SOCKET_IDLE_TIMER } from "../Enum/EnvironmentVariable"; import { Zone } from "_Model/Zone"; import { ExAdminSocketInterface } from "_Model/Websocket/ExAdminSocketInterface"; -import { CharacterTexture } from "../Services/AdminApi/CharacterTexture"; +import { CharacterTexture} from "../Messages/JsonMessages/CharacterTexture"; import { isAdminMessageInterface } from "../Model/Websocket/Admin/AdminMessages"; import Axios from "axios"; import { InvalidTokenError } from "../Controller/InvalidTokenError"; diff --git a/pusher/src/Services/AdminApi.ts b/pusher/src/Services/AdminApi.ts index 416b9cb6..87c0d920 100644 --- a/pusher/src/Services/AdminApi.ts +++ b/pusher/src/Services/AdminApi.ts @@ -1,9 +1,9 @@ import { ADMIN_API_TOKEN, ADMIN_API_URL, ADMIN_URL, OPID_PROFILE_SCREEN_PROVIDER } from "../Enum/EnvironmentVariable"; import Axios from "axios"; import { GameRoomPolicyTypes } from "_Model/PusherRoom"; -import { CharacterTexture } from "./AdminApi/CharacterTexture"; -import { MapDetailsData } from "./AdminApi/MapDetailsData"; -import { RoomRedirect } from "./AdminApi/RoomRedirect"; +import { CharacterTexture} from "../Messages/JsonMessages/CharacterTexture"; +import { MapDetailsData} from "../Messages/JsonMessages/MapDetailsData"; +import { RoomRedirect} from "../Messages/JsonMessages/RoomRedirect"; export interface AdminApiData { roomUrl: string;