improve: add buildConfig

This commit is contained in:
Sainan 2024-05-12 17:17:42 +02:00
parent 61dbdba7fd
commit 74a7a6715f
7 changed files with 14 additions and 11 deletions

View File

@ -1,9 +1,6 @@
{ {
"myAddress": "localhost", "myAddress": "localhost",
"autoCreateAccount": true, "autoCreateAccount": true,
"buildLabel": "2024.05.03.11.35/g98E42og3EdWxS0UueO+PQ",
"matchmakingBuildId": "6945333874579955227",
"version": "35.5.11",
"skipStoryModeChoice": true, "skipStoryModeChoice": true,
"skipTutorial": true, "skipTutorial": true,
"unlockAllScans": true, "unlockAllScans": true,

View File

@ -2,6 +2,7 @@
import { RequestHandler } from "express"; import { RequestHandler } from "express";
import config from "@/config.json"; import config from "@/config.json";
import buildConfig from "@/static/data/buildConfig.json";
import { toLoginRequest } from "@/src/helpers/loginHelpers"; import { toLoginRequest } from "@/src/helpers/loginHelpers";
import { Account } from "@/src/models/loginModel"; import { Account } from "@/src/models/loginModel";
@ -43,8 +44,8 @@ const loginController: RequestHandler = async (request, response) => {
DTLS: DTLS, DTLS: DTLS,
IRC: [config.myAddress], IRC: [config.myAddress],
HUB: HUB, HUB: HUB,
BuildLabel: config.buildLabel, BuildLabel: buildConfig.buildLabel,
MatchmakingBuildId: config.matchmakingBuildId MatchmakingBuildId: buildConfig.matchmakingBuildId
}; };
response.json(newLoginResponse); response.json(newLoginResponse);
@ -72,8 +73,8 @@ const loginController: RequestHandler = async (request, response) => {
DTLS: DTLS, DTLS: DTLS,
IRC: [config.myAddress], IRC: [config.myAddress],
HUB: HUB, HUB: HUB,
BuildLabel: config.buildLabel, BuildLabel: buildConfig.buildLabel,
MatchmakingBuildId: config.matchmakingBuildId MatchmakingBuildId: buildConfig.matchmakingBuildId
}; };
response.json(newLoginResponse); response.json(newLoginResponse);

View File

@ -1,11 +1,11 @@
import { RequestHandler } from "express"; import { RequestHandler } from "express";
import worldState from "@/static/fixed_responses/worldState.json"; import worldState from "@/static/fixed_responses/worldState.json";
import config from "@/config.json"; import buildConfig from "@/static/data/buildConfig.json";
const worldStateController: RequestHandler = (_req, res) => { const worldStateController: RequestHandler = (_req, res) => {
res.json({ res.json({
...worldState, ...worldState,
BuildLabel: config.buildLabel, BuildLabel: buildConfig.buildLabel,
Time: Math.round(Date.now() / 1000) Time: Math.round(Date.now() / 1000)
}); });
}; };

View File

@ -1,5 +1,5 @@
import express from "express"; import express from "express";
import config from "@/config.json"; import buildConfig from "@/static/data/buildConfig.json";
const cacheRouter = express.Router(); const cacheRouter = express.Router();
@ -12,7 +12,7 @@ cacheRouter.get("/B.Cache.Windows_en.bin*", (_req, res) => {
}); });
cacheRouter.get(/^\/origin\/[a-zA-Z0-9]+\/[0-9]+\/H\.Cache\.bin.*$/, (_req, res) => { cacheRouter.get(/^\/origin\/[a-zA-Z0-9]+\/[0-9]+\/H\.Cache\.bin.*$/, (_req, res) => {
res.sendFile(`static/data/H.Cache_${config.version}.bin`, { root: "./" }); res.sendFile(`static/data/H.Cache_${buildConfig.version}.bin`, { root: "./" });
}); });
export { cacheRouter }; export { cacheRouter };

View File

View File

@ -0,0 +1,5 @@
{
"version": "35.5.11",
"buildLabel": "2024.05.03.11.35/g98E42og3EdWxS0UueO+PQ",
"matchmakingBuildId": "6945333874579955227"
}

View File