XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

chore: derive MatchmakingBuildId from buildLabel (#3041)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3041 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

e07f3bb5
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

3 个文件 +12 -5
Modified src/controllers/api/loginController.ts +10 -1
@@ -161,7 +161,16 @@ const createLoginResponse = (
161 161 if (version_compare(buildLabel, "2022.09.06.19.24") >= 0) {
162 162 resp.CrossPlatformAllowed = account.CrossPlatformAllowed;
163 163 resp.HUB = `${myUrlBase}/api/`;
164 resp.MatchmakingBuildId = buildConfig.matchmakingBuildId;
164
165 // The MatchmakingBuildId is a 64-bit integer represented as a decimal string. On live, the value is seemingly random per build, but really any value that is different across builds should work.
166 const [year, month, day, hour, minute] = buildLabel.split(".").map(x => parseInt(x));
167 resp.MatchmakingBuildId = (
168 year * 1_00_00_00_00 +
169 month * 1_00_00_00 +
170 day * 1_00_00 +
171 hour * 1_00 +
172 minute
173 ).toString();
165 174 }
166 175 if (version_compare(buildLabel, "2023.04.25.23.40") >= 0) {
167 176 if (version_compare(buildLabel, "2025.08.26.09.49") >= 0) {
Modified src/services/buildConfigService.ts +1 -3
@@ -5,13 +5,11 @@ import { repoDir } from "../helpers/pathHelper.ts";
5 5 interface IBuildConfig {
6 6 version: string;
7 7 buildLabel: string;
8 matchmakingBuildId: string;
9 8 }
10 9
11 10 export const buildConfig: IBuildConfig = {
12 11 version: "",
13 buildLabel: "",
14 matchmakingBuildId: ""
12 buildLabel: ""
15 13 };
16 14
17 15 const buildConfigPath = path.join(repoDir, "static/data/buildConfig.json");
Modified src/types/session.ts +1 -1
@@ -31,7 +31,7 @@ export interface ISession {
31 31 export interface IFindSessionRequest {
32 32 id?: string;
33 33 originalSessionId?: string;
34 buildId?: number;
34 buildId?: number | bigint;
35 35 gameModeId?: number;
36 36 regionId?: number;
37 37 maxEloDifference?: number;