diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index 9338b3c7..40d5d5d1 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -20,6 +20,11 @@ const loginController: RequestHandler = async (request, response) => { const account = await Account.findOne({ email: loginRequest.email }); //{ _id: 0, __v: 0 } const nonce = Math.round(Math.random() * Number.MAX_SAFE_INTEGER); + const buildLabel: string = + typeof request.query.buildLabel == "string" + ? request.query.buildLabel.split(" ").join("+") + : buildConfig.buildLabel; + if (!account && config.autoCreateAccount && loginRequest.ClientType != "webui") { try { const newAccount = await createAccount({ @@ -45,7 +50,7 @@ const loginController: RequestHandler = async (request, response) => { DTLS: DTLS, IRC: config.myIrcAddresses ?? [config.myAddress], HUB: HUB, - BuildLabel: buildConfig.buildLabel, + BuildLabel: buildLabel, MatchmakingBuildId: buildConfig.matchmakingBuildId }; @@ -81,7 +86,7 @@ const loginController: RequestHandler = async (request, response) => { DTLS: DTLS, IRC: config.myIrcAddresses ?? [config.myAddress], HUB: HUB, - BuildLabel: buildConfig.buildLabel, + BuildLabel: buildLabel, MatchmakingBuildId: buildConfig.matchmakingBuildId }; diff --git a/src/controllers/dynamic/worldStateController.ts b/src/controllers/dynamic/worldStateController.ts index 32cfdfa0..92351233 100644 --- a/src/controllers/dynamic/worldStateController.ts +++ b/src/controllers/dynamic/worldStateController.ts @@ -2,10 +2,13 @@ import { RequestHandler } from "express"; import worldState from "@/static/fixed_responses/worldState.json"; import buildConfig from "@/static/data/buildConfig.json"; -const worldStateController: RequestHandler = (_req, res) => { +const worldStateController: RequestHandler = (req, res) => { + const buildLabel: string = + typeof req.query.buildLabel == "string" ? req.query.buildLabel.split(" ").join("+") : buildConfig.buildLabel; + res.json({ ...worldState, - BuildLabel: buildConfig.buildLabel, + BuildLabel: buildLabel, Time: Math.round(Date.now() / 1000) }); };