From 5ba5aba24296933fe37abf51edddcbb31ae68405 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 17 Nov 2025 20:31:30 +0100 Subject: [PATCH] chore: derive MatchmakingBuildId from buildLabel --- src/controllers/api/loginController.ts | 11 ++++++++++- src/services/buildConfigService.ts | 4 +--- src/types/session.ts | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index f5332fff..4056c160 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -161,7 +161,16 @@ const createLoginResponse = ( if (version_compare(buildLabel, "2022.09.06.19.24") >= 0) { resp.CrossPlatformAllowed = account.CrossPlatformAllowed; resp.HUB = `${myUrlBase}/api/`; - resp.MatchmakingBuildId = buildConfig.matchmakingBuildId; + + // On live, the MatchmakingBuildId is a random 64-bit integer, but any string that is unique per build should do the trick. + const [year, month, day, hour, minute] = buildLabel.split(".").map(x => parseInt(x)); + resp.MatchmakingBuildId = ( + year * 1_00_00_00_00 + + month * 1_00_00_00 + + day * 1_00_00 + + hour * 1_00 + + minute + ).toString(); } if (version_compare(buildLabel, "2023.04.25.23.40") >= 0) { if (version_compare(buildLabel, "2025.08.26.09.49") >= 0) { diff --git a/src/services/buildConfigService.ts b/src/services/buildConfigService.ts index 81c76cc4..53abc492 100644 --- a/src/services/buildConfigService.ts +++ b/src/services/buildConfigService.ts @@ -5,13 +5,11 @@ import { repoDir } from "../helpers/pathHelper.ts"; interface IBuildConfig { version: string; buildLabel: string; - matchmakingBuildId: string; } export const buildConfig: IBuildConfig = { version: "", - buildLabel: "", - matchmakingBuildId: "" + buildLabel: "" }; const buildConfigPath = path.join(repoDir, "static/data/buildConfig.json"); diff --git a/src/types/session.ts b/src/types/session.ts index 056cc150..29dced76 100644 --- a/src/types/session.ts +++ b/src/types/session.ts @@ -31,7 +31,7 @@ export interface ISession { export interface IFindSessionRequest { id?: string; originalSessionId?: string; - buildId?: number; + buildId?: number | bigint; gameModeId?: number; regionId?: number; maxEloDifference?: number;