Cleaning commented code

This commit is contained in:
David Négrier 2022-02-24 12:06:43 +01:00
parent 8e11c4445b
commit 1b286002ff
7 changed files with 12 additions and 25 deletions

View File

@ -1,5 +1,4 @@
import * as tg from "generic-type-guard"; import * as tg from "generic-type-guard";
//import { isCharacterTexture } from "./CharacterTexture";
/* /*
* WARNING! The original file is in /messages/JsonMessages. * WARNING! The original file is in /messages/JsonMessages.
@ -12,7 +11,6 @@ export const isAdminApiData = new tg.IsInterface()
email: tg.isNullable(tg.isString), email: tg.isNullable(tg.isString),
roomUrl: tg.isString, roomUrl: tg.isString,
mapUrlStart: tg.isString, mapUrlStart: tg.isString,
// textures: tg.isArray(isCharacterTexture),
}) })
.withOptionalProperties({ .withOptionalProperties({
messages: tg.isArray(tg.isUnknown), messages: tg.isArray(tg.isUnknown),

View File

@ -1,5 +1,4 @@
import * as tg from "generic-type-guard"; import * as tg from "generic-type-guard";
//import { isCharacterTexture } from "./CharacterTexture";
import { isNumber } from "generic-type-guard"; import { isNumber } from "generic-type-guard";
/* /*
@ -12,7 +11,6 @@ export const isMapDetailsData = new tg.IsInterface()
mapUrl: tg.isString, mapUrl: tg.isString,
policy_type: isNumber, //isNumericEnum(GameRoomPolicyTypes), policy_type: isNumber, //isNumericEnum(GameRoomPolicyTypes),
tags: tg.isArray(tg.isString), tags: tg.isArray(tg.isString),
// textures: tg.isArray(isCharacterTexture),
authenticationMandatory: tg.isUnion(tg.isNullable(tg.isBoolean), tg.isUndefined), authenticationMandatory: tg.isUnion(tg.isNullable(tg.isBoolean), tg.isUndefined),
roomSlug: tg.isNullable(tg.isString), // deprecated roomSlug: tg.isNullable(tg.isString), // deprecated
contactPage: tg.isNullable(tg.isString), contactPage: tg.isNullable(tg.isString),

View File

@ -249,10 +249,6 @@ export class AuthenticateController extends BaseHttpController {
* type: string * type: string
* description: TODO- unclear. I cannot find any use of this * description: TODO- unclear. I cannot find any use of this
* example: ??? * example: ???
* textures:
* type: string
* description: TODO - document this is still needed
* example: ???
* messages: * messages:
* type: array * type: array
* description: The list of messages to be displayed when the user logs? * description: The list of messages to be displayed when the user logs?
@ -397,7 +393,7 @@ export class AuthenticateController extends BaseHttpController {
userRoomToken: undefined, userRoomToken: undefined,
}; };
try { try {
data = await adminApi.fetchMemberDataByUuid(email, playUri, IPAddress, characterLayers); data = await adminApi.fetchMemberDataByUuid(email, playUri, IPAddress, []);
} catch (err) { } catch (err) {
console.error("openIDCallback => fetchMemberDataByUuid", err); console.error("openIDCallback => fetchMemberDataByUuid", err);
} }

View File

@ -297,7 +297,12 @@ export class IoSocketController {
if (ADMIN_API_URL) { if (ADMIN_API_URL) {
try { try {
try { try {
userData = await adminApi.fetchMemberDataByUuid(userIdentifier, roomId, IPAddress, characterLayers); userData = await adminApi.fetchMemberDataByUuid(
userIdentifier,
roomId,
IPAddress,
characterLayers
);
} catch (err) { } catch (err) {
if (Axios.isAxiosError(err)) { if (Axios.isAxiosError(err)) {
if (err?.response?.status == 404) { if (err?.response?.status == 404) {

View File

@ -59,14 +59,6 @@ export class MapController extends BaseHttpController {
* items: * items:
* type: string * type: string
* example: speaker * example: speaker
* textures:
* type: array
* description: The list of public textures for this map (TODO remove this)
* items:
* type: object
* properties:
* todo:
* type: string
* authenticationMandatory: * authenticationMandatory:
* type: boolean|null * type: boolean|null
* description: Whether the authentication is mandatory or not for this map. * description: Whether the authentication is mandatory or not for this map.
@ -126,7 +118,6 @@ export class MapController extends BaseHttpController {
roomSlug: null, // Deprecated roomSlug: null, // Deprecated
group: null, group: null,
tags: [], tags: [],
textures: [],
contactPage: null, contactPage: null,
authenticationMandatory: DISABLE_ANONYMOUS, authenticationMandatory: DISABLE_ANONYMOUS,
} as MapDetailsData); } as MapDetailsData);

View File

@ -8,10 +8,8 @@ import {
ServerToClientMessage, ServerToClientMessage,
SubMessage, SubMessage,
} from "../../Messages/generated/messages_pb"; } from "../../Messages/generated/messages_pb";
import { WebSocket } from "uWebSockets.js";
import { ClientDuplexStream } from "grpc"; import { ClientDuplexStream } from "grpc";
import { Zone } from "_Model/Zone"; import { Zone } from "_Model/Zone";
import { CharacterTexture } from "../../Messages/JsonMessages/CharacterTexture";
import { compressors } from "hyper-express"; import { compressors } from "hyper-express";
import { WokaDetail } from "_Enum/PlayerTextures"; import { WokaDetail } from "_Enum/PlayerTextures";

View File

@ -57,16 +57,17 @@ class AdminApi {
userIdentifier: string | null, userIdentifier: string | null,
roomId: string, roomId: string,
ipAddress: string, ipAddress: string,
characterLayers: string[]): Promise<FetchMemberDataByUuidResponse> { characterLayers: string[]
): Promise<FetchMemberDataByUuidResponse> {
if (!ADMIN_API_URL) { if (!ADMIN_API_URL) {
return Promise.reject(new Error("No admin backoffice set!")); return Promise.reject(new Error("No admin backoffice set!"));
} }
const res = await Axios.get<unknown, AxiosResponse<unknown>>(ADMIN_API_URL + "/api/room/access", { const res = await Axios.get<unknown, AxiosResponse<unknown>>(ADMIN_API_URL + "/api/room/access", {
params: { userIdentifier, roomId, ipAddress, characterLayers }, params: { userIdentifier, roomId, ipAddress, characterLayers },
headers: { Authorization: `${ADMIN_API_TOKEN}` }, headers: { Authorization: `${ADMIN_API_TOKEN}` },
paramsSerializer: p => { paramsSerializer: (p) => {
return qs.stringify(p, {arrayFormat: 'brackets'}) return qs.stringify(p, { arrayFormat: "brackets" });
} },
}); });
if (!isFetchMemberDataByUuidResponse(res.data)) { if (!isFetchMemberDataByUuidResponse(res.data)) {
throw new Error( throw new Error(