chore: derive MatchmakingBuildId from buildLabel #3041

Merged
Sainan merged 2 commits from mmbid into main 2025-11-18 04:14:38 -08:00
3 changed files with 12 additions and 5 deletions
Showing only changes of commit 5ba5aba242 - Show all commits

View File

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

View File

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

View File

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