fix: login failure on u25 & u26
All checks were successful
Build / build (push) Successful in 1m35s
Build / build (pull_request) Successful in 1m19s

also updated the setGuildMotd response for the old UI before LongMOTD
This commit is contained in:
Sainan 2025-05-03 00:54:08 +02:00
parent 468efed71c
commit eea9dc0b09
5 changed files with 24 additions and 13 deletions

View File

@ -18,6 +18,7 @@ export const getAllianceController: RequestHandler = async (req, res) => {
res.end(); res.end();
}; };
// POST request since U27
/*interface IGetAllianceRequest { /*interface IGetAllianceRequest {
memberCount: number; memberCount: number;
clanLeaderName: string; clanLeaderName: string;

View File

@ -107,11 +107,13 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b
ConsentNeeded: account.ConsentNeeded, ConsentNeeded: account.ConsentNeeded,
TrackedSettings: account.TrackedSettings, TrackedSettings: account.TrackedSettings,
Nonce: account.Nonce, Nonce: account.Nonce,
Groups: [],
IRC: config.myIrcAddresses ?? [myAddress], IRC: config.myIrcAddresses ?? [myAddress],
NRS: config.NRS, NRS: config.NRS,
BuildLabel: buildLabel BuildLabel: buildLabel
}; };
if (version_compare(buildLabel, "2019.10.31.22.42") >= 0) {
// U26 and up
resp.Groups = [];
if (version_compare(buildLabel, "2021.04.13.19.58") >= 0) { if (version_compare(buildLabel, "2021.04.13.19.58") >= 0) {
resp.DTLS = 99; resp.DTLS = 99;
if (version_compare(buildLabel, "2022.04.29.12.53") >= 0) { if (version_compare(buildLabel, "2022.04.29.12.53") >= 0) {
@ -126,5 +128,6 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b
} }
} }
} }
}
return resp; return resp;
}; };

View File

@ -2,6 +2,7 @@ import { Alliance, Guild, GuildMember } from "@/src/models/guildModel";
import { hasGuildPermissionEx } from "@/src/services/guildService"; import { hasGuildPermissionEx } from "@/src/services/guildService";
import { getInventory } from "@/src/services/inventoryService"; import { getInventory } from "@/src/services/inventoryService";
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService"; import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
import { version_compare } from "@/src/services/worldStateService";
import { GuildPermission, ILongMOTD } from "@/src/types/guildTypes"; import { GuildPermission, ILongMOTD } from "@/src/types/guildTypes";
import { RequestHandler } from "express"; import { RequestHandler } from "express";
@ -55,5 +56,9 @@ export const setGuildMotdController: RequestHandler = async (req, res) => {
await guild.save(); await guild.save();
} }
if (!account.BuildLabel || version_compare(account.BuildLabel, "2020.03.24.20.24") > 0) {
res.json({ IsLongMOTD, MOTD }); res.json({ IsLongMOTD, MOTD });
} else {
res.send(MOTD).end();
}
}; };

View File

@ -170,6 +170,7 @@ apiRouter.get("/deleteSession.php", deleteSessionController);
apiRouter.get("/divvyAllianceVault.php", divvyAllianceVaultController); apiRouter.get("/divvyAllianceVault.php", divvyAllianceVaultController);
apiRouter.get("/dojo", dojoController); apiRouter.get("/dojo", dojoController);
apiRouter.get("/drones.php", dronesController); apiRouter.get("/drones.php", dronesController);
apiRouter.get("/getAlliance.php", getAllianceController);
apiRouter.get("/getDailyDealStockLevels.php", getDailyDealStockLevelsController); apiRouter.get("/getDailyDealStockLevels.php", getDailyDealStockLevelsController);
apiRouter.get("/getFriends.php", getFriendsController); apiRouter.get("/getFriends.php", getFriendsController);
apiRouter.get("/getGuild.php", getGuildController); apiRouter.get("/getGuild.php", getGuildController);
@ -308,6 +309,7 @@ apiRouter.post("/trainingResult.php", trainingResultController);
apiRouter.post("/unlockShipFeature.php", unlockShipFeatureController); apiRouter.post("/unlockShipFeature.php", unlockShipFeatureController);
apiRouter.post("/updateAlignment.php", updateAlignmentController); apiRouter.post("/updateAlignment.php", updateAlignmentController);
apiRouter.post("/updateChallengeProgress.php", updateChallengeProgressController); apiRouter.post("/updateChallengeProgress.php", updateChallengeProgressController);
apiRouter.post("/updateInventory.php", missionInventoryUpdateController); // U26 and below
apiRouter.post("/updateNodeIntros.php", genericUpdateController); apiRouter.post("/updateNodeIntros.php", genericUpdateController);
apiRouter.post("/updateQuest.php", updateQuestController); apiRouter.post("/updateQuest.php", updateQuestController);
apiRouter.post("/updateSession.php", updateSessionPostController); apiRouter.post("/updateSession.php", updateSessionPostController);

View File

@ -45,7 +45,7 @@ export interface ILoginRequest {
export interface ILoginResponse extends IAccountAndLoginResponseCommons { export interface ILoginResponse extends IAccountAndLoginResponseCommons {
id: string; id: string;
Groups: IGroup[]; Groups?: IGroup[];
BuildLabel: string; BuildLabel: string;
MatchmakingBuildId?: string; MatchmakingBuildId?: string;
platformCDNs?: string[]; platformCDNs?: string[];