diff --git a/src/controllers/api/deleteSessionController.ts b/src/controllers/api/deleteSessionController.ts index 52967522..566d0531 100644 --- a/src/controllers/api/deleteSessionController.ts +++ b/src/controllers/api/deleteSessionController.ts @@ -1,9 +1,17 @@ import type { RequestHandler } from "express"; import { deleteSession } from "../../managers/sessionManager.ts"; +import { getAccountForRequest } from "../../services/loginService.ts"; +import { version_compare } from "../../helpers/inventoryHelpers.ts"; -const deleteSessionController: RequestHandler = (_req, res) => { +const deleteSessionController: RequestHandler = async (_req, res) => { + const account = await getAccountForRequest(_req); deleteSession(_req.query.sessionId as string); - res.sendStatus(200); + if (account.BuildLabel && version_compare(account.BuildLabel, "2016.07.08.16.56") < 0) { + // Pre-Specters of the Rail + res.send(_req.query.sessionId as string); // Unsure if this is correct, but the client is chill with it + } else { + res.sendStatus(200); + } }; export { deleteSessionController }; diff --git a/src/controllers/api/hostSessionController.ts b/src/controllers/api/hostSessionController.ts index c31fa447..6c30fc9d 100644 --- a/src/controllers/api/hostSessionController.ts +++ b/src/controllers/api/hostSessionController.ts @@ -13,8 +13,8 @@ const hostSessionController: RequestHandler = async (req, res) => { const session = createNewSession(hostSessionRequest, account._id); logger.debug(`New Session Created`, { session }); - if (account.BuildLabel && version_compare(account.BuildLabel, "2015.03.21.08.17") < 0) { - // U15 or below + if (account.BuildLabel && version_compare(account.BuildLabel, "2016.07.08.16.56") < 0) { + // Pre-Specters of the Rail res.send(session.sessionId.toString()); } else { res.json({ sessionId: toOid2(session.sessionId, account.BuildLabel), rewardSeed: 99999999 }); diff --git a/src/routes/api.ts b/src/routes/api.ts index bdf1e69c..6184c8f0 100644 --- a/src/routes/api.ts +++ b/src/routes/api.ts @@ -10,6 +10,7 @@ import { addPendingFriendController } from "../controllers/api/addPendingFriendC import { addToAllianceController } from "../controllers/api/addToAllianceController.ts"; import { addToGuildController } from "../controllers/api/addToGuildController.ts"; import { adoptPetController } from "../controllers/api/adoptPetController.ts"; +import { aggregateSessionsController } from "../controllers/dynamic/aggregateSessionsController.ts"; import { apartmentController } from "../controllers/api/apartmentController.ts"; import { arcaneCommonController } from "../controllers/api/arcaneCommonController.ts"; import { archonFusionController } from "../controllers/api/archonFusionController.ts"; @@ -248,6 +249,7 @@ apiRouter.post("/addPendingFriend.php", addPendingFriendController); apiRouter.post("/addToAlliance.php", addToAllianceController); apiRouter.post("/addToGuild.php", addToGuildController); apiRouter.post("/adoptPet.php", adoptPetController); +apiRouter.post("/aggregateSessions.php", aggregateSessionsController); // Pre-Specters of the Rail builds apiRouter.post("/arcaneCommon.php", arcaneCommonController); apiRouter.post("/archonFusion.php", archonFusionController); apiRouter.post("/artifacts.php", artifactsController);