返回提交历史
Modified
src/controllers/dynamic/worldStateController.ts
+8
-1
XFEstudio/XFESpaceNinjaServer
chore: filter worldState for U5 clients (#3748)
Closes #3743 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3748 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
c031ce9b
代码差异
1 个文件
+8
-1
@@ -5,9 +5,16 @@ import {
5
5
populateFeaturedGuilds,
6
6
populateFissures
7
7
} from "../../services/worldStateService.ts";
8
import { buildConfig } from "../../services/buildConfigService.ts";
8
9
9
10
export const worldStateController: RequestHandler = async (req, res) => {
10
const buildLabel = req.query.buildLabel as string | undefined;
11
let buildLabel = req.query.buildLabel as string | undefined;
12
// For /cdn/worldState.php, keep buildLabel=undefined to mean latest,
13
// but for /dynamic/worldState.php, we might be dealing with a U5 client, so grab buildLabel from buildConfig, instead.
14
if (!buildLabel && req.originalUrl == "/dynamic/worldState.php") {
15
buildLabel = buildConfig.buildLabel;
16
}
17
11
18
const worldState = getWorldState(buildLabel);
12
19
13
20
await Promise.all([