From 35d5c01203b3e2f3bd873e55c065bdfcfbb1e3a6 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Fri, 2 May 2025 04:03:42 -0700 Subject: [PATCH] fix: login failure on u29 heart of deimos and below (#1959) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1959 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 | 20 +++++++++++--------- src/types/loginTypes.ts | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index 366e87c3..f872f3a2 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -110,17 +110,19 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b Groups: [], IRC: config.myIrcAddresses ?? [myAddress], NRS: config.NRS, - DTLS: 99, BuildLabel: buildLabel }; - if (version_compare(buildLabel, "2022.04.29.12.53") >= 0) { - resp.ClientType = account.ClientType; - 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}/`]; + if (version_compare(buildLabel, "2021.04.13.19.58") >= 0) { + resp.DTLS = 99; + if (version_compare(buildLabel, "2022.04.29.12.53") >= 0) { + resp.ClientType = account.ClientType; + 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}/`]; + } } } } diff --git a/src/types/loginTypes.ts b/src/types/loginTypes.ts index dfdebe0e..3f412d1e 100644 --- a/src/types/loginTypes.ts +++ b/src/types/loginTypes.ts @@ -50,7 +50,7 @@ export interface ILoginResponse extends IAccountAndLoginResponseCommons { MatchmakingBuildId?: string; platformCDNs?: string[]; NRS?: string[]; - DTLS: number; + DTLS?: number; IRC: string[]; HUB?: string; }