From 331c9f1a446608cc0069eb2e00e7957e634b4c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolas=20G=C3=B6rlitz?= Date: Mon, 20 May 2024 23:44:38 +0200 Subject: [PATCH] use user's cid for statistics --- backend/src/controllers/user/UserStatisticsController.ts | 5 ----- backend/src/libraries/vatsim/ConnectLibrary.ts | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/src/controllers/user/UserStatisticsController.ts b/backend/src/controllers/user/UserStatisticsController.ts index 301fbb8..5a14b13 100644 --- a/backend/src/controllers/user/UserStatisticsController.ts +++ b/backend/src/controllers/user/UserStatisticsController.ts @@ -1,7 +1,6 @@ import { NextFunction, Request, Response } from "express"; import axios from "axios"; import { User } from "../../models/User"; -import { Config } from "../../core/Config"; import { localCache } from "../../core/Cache"; // TODO: The entire statistics controller should ideally cache the data for at least a day (the hours really don't change that much). @@ -12,10 +11,6 @@ async function getUserRatingTimes(request: Request, response: Response, next: Ne const user: User = response.locals.user; let userID = user.id; - if (Config.APP_DEBUG) { - userID = 1373921; - } - if (localCache.has(userID)) { response.send(localCache.get(userID)); return; diff --git a/backend/src/libraries/vatsim/ConnectLibrary.ts b/backend/src/libraries/vatsim/ConnectLibrary.ts index 8696bc3..e36747d 100644 --- a/backend/src/libraries/vatsim/ConnectLibrary.ts +++ b/backend/src/libraries/vatsim/ConnectLibrary.ts @@ -293,7 +293,7 @@ export class VatsimConnectLibrary { */ private async _checkIsUserAllowed() { if (this.m_userData == undefined) return null; - const allowed_cids = [1373921, 1450775, 1331358, 1357290, 1439797, 1583954, 1438611, 1432304, 1439600, 1463320, 1238939, 10000010, 10000001, 1117638,1132984,1238939,1272780,1316527,1336219,1357290,1407054,1432304,1439600,1439797,1443079,1447366,1451860,1454201,1463320,1467762,1467870,1487136,1506680,1507672,1520064,1524005,1569331,1583954,1593864,1626019,1627359,1649341,1667561,1692470,944693,1083033,1196986,1238939,1272780,1316527,1336219,1345921,1378351,1404385,1433041,1434698,1438611,1439600,1439797,1447366,1454201,1457329,1467740,1467870,1468997,1477025,1477582,1482057,1482456,1488616,1495699,1527122,1528134,1542149,1543292,1583954,1591329,1610484,1625839,1627359,1657818,1044887,1077986,1279468,1342244,1357290,1381951,1395737,1413802,1451860,1456550,1459636,1463320,1465242,1466083,1468202,1476945,1487136,1491867,1501396,1504305,1512446,1520064,1524005,1556813,1558853,1611428,1612478,874505,1378091,1432304,1441619,1470223,1519114,1519639,1586741,1593864,1626019]; + const allowed_cids = [1373921,1119615, 1450775, 1331358, 1357290, 1439797, 1583954, 1438611, 1432304, 1439600, 1463320, 1238939, 10000010, 10000001, 1117638,1132984,1238939,1272780,1316527,1336219,1357290,1407054,1432304,1439600,1439797,1443079,1447366,1451860,1454201,1463320,1467762,1467870,1487136,1506680,1507672,1520064,1524005,1569331,1583954,1593864,1626019,1627359,1649341,1667561,1692470,944693,1083033,1196986,1238939,1272780,1316527,1336219,1345921,1378351,1404385,1433041,1434698,1438611,1439600,1439797,1447366,1454201,1457329,1467740,1467870,1468997,1477025,1477582,1482057,1482456,1488616,1495699,1527122,1528134,1542149,1543292,1583954,1591329,1610484,1625839,1627359,1657818,1044887,1077986,1279468,1342244,1357290,1381951,1395737,1413802,1451860,1456550,1459636,1463320,1465242,1466083,1468202,1476945,1487136,1491867,1501396,1504305,1512446,1520064,1524005,1556813,1558853,1611428,1612478,874505,1378091,1432304,1441619,1470223,1519114,1519639,1586741,1593864,1626019]; if (!allowed_cids.includes(Number(this.m_userData.data.cid))) { throw new VatsimConnectException(ConnectLibraryErrors.ERR_SUSPENDED);