fix: creating/deleting sessions in pre-Specters of the Rail builds (#2978)
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (push) Has been cancelled

This is only verified to work as far back as U15, I have not tried to test any builds older than that yet until they are added to the support list.

Reviewed-on: #2978
Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com>
Co-authored-by: VoltPrime <subsonicjackal@gmail.com>
Co-committed-by: VoltPrime <subsonicjackal@gmail.com>
This commit is contained in:
VoltPrime 2025-11-02 23:28:10 -08:00 committed by Sainan
parent 38326fc452
commit 4d93dc80dc
3 changed files with 14 additions and 4 deletions

View File

@ -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 };

View File

@ -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 });

View File

@ -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);