2023-05-19 15:22:48 -03:00
|
|
|
import { RequestHandler } from "express";
|
|
|
|
import worldState from "@/static/fixed_responses/worldState.json";
|
2024-05-15 21:55:59 +02:00
|
|
|
import buildConfig from "@/static/data/buildConfig.json";
|
2023-05-19 15:22:48 -03:00
|
|
|
|
2024-12-20 03:11:09 +01:00
|
|
|
const worldStateController: RequestHandler = (req, res) => {
|
|
|
|
const buildLabel: string =
|
|
|
|
typeof req.query.buildLabel == "string" ? req.query.buildLabel.split(" ").join("+") : buildConfig.buildLabel;
|
|
|
|
|
2024-05-10 13:31:39 +02:00
|
|
|
res.json({
|
|
|
|
...worldState,
|
2024-12-20 03:11:09 +01:00
|
|
|
BuildLabel: buildLabel,
|
2024-05-10 13:31:39 +02:00
|
|
|
Time: Math.round(Date.now() / 1000)
|
|
|
|
});
|
2023-05-19 15:22:48 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
export { worldStateController };
|