From c4b2248df5e77c52c2b6a027fc492020df90fe18 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 30 Apr 2025 23:50:02 -0700 Subject: [PATCH] fix: login failure on U31.5 angels of the zariman (#1933) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1933 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/loginController.ts | 14 ++++++++------ src/types/loginTypes.ts | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index 09fca8c7..cf5f759f 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -100,7 +100,6 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b DisplayName: account.DisplayName, CountryCode: account.CountryCode, ClientType: account.ClientType, - CrossPlatformAllowed: account.CrossPlatformAllowed, ForceLogoutVersion: account.ForceLogoutVersion, AmazonAuthToken: account.AmazonAuthToken, AmazonRefreshToken: account.AmazonRefreshToken, @@ -109,14 +108,17 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b Nonce: account.Nonce, Groups: [], IRC: config.myIrcAddresses ?? [myAddress], - HUB: `https://${myAddress}/api/`, NRS: config.NRS, DTLS: 99, - BuildLabel: buildLabel, - MatchmakingBuildId: buildConfig.matchmakingBuildId + BuildLabel: buildLabel }; - if (version_compare(buildLabel, "2023.04.25.23.40") >= 0) { - resp.platformCDNs = [`https://${myAddress}/`]; + if (version_compare(buildLabel, "2022.09.06.19.24") >= 0) { + resp.CrossPlatformAllowed = account.CrossPlatformAllowed; + resp.HUB = `https://${myAddress}/api/`; + resp.MatchmakingBuildId = buildConfig.matchmakingBuildId; + if (version_compare(buildLabel, "2023.04.25.23.40") >= 0) { + resp.platformCDNs = [`https://${myAddress}/`]; + } } return resp; }; diff --git a/src/types/loginTypes.ts b/src/types/loginTypes.ts index 17128e2a..654bc4dc 100644 --- a/src/types/loginTypes.ts +++ b/src/types/loginTypes.ts @@ -4,7 +4,7 @@ export interface IAccountAndLoginResponseCommons { DisplayName: string; CountryCode: string; ClientType: string; - CrossPlatformAllowed: boolean; + CrossPlatformAllowed?: boolean; ForceLogoutVersion: number; AmazonAuthToken?: string; AmazonRefreshToken?: string; @@ -46,7 +46,7 @@ export interface ILoginResponse extends IAccountAndLoginResponseCommons { id: string; Groups: IGroup[]; BuildLabel: string; - MatchmakingBuildId: string; + MatchmakingBuildId?: string; platformCDNs?: string[]; NRS?: string[]; DTLS: number;