From de544a437ddd3246fd0701e5f1abaa44abf5193b Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 14 Oct 2025 11:55:47 +0200 Subject: [PATCH] Update typings for bootstrapper for 0.11.13 --- src/controllers/custom/tunablesController.ts | 13 ++----------- src/services/wsService.ts | 4 +++- src/types/bootstrapperTypes.ts | 9 +++++++++ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 src/types/bootstrapperTypes.ts diff --git a/src/controllers/custom/tunablesController.ts b/src/controllers/custom/tunablesController.ts index 87419fcc..7405075a 100644 --- a/src/controllers/custom/tunablesController.ts +++ b/src/controllers/custom/tunablesController.ts @@ -1,16 +1,9 @@ import type { RequestHandler } from "express"; +import type { ITunables } from "../../types/bootstrapperTypes.ts"; // This endpoint is specific to the OpenWF Bootstrapper: https://openwf.io/bootstrapper-manual -interface ITunables { - prohibit_skip_mission_start_timer?: boolean; - prohibit_fov_override?: boolean; - prohibit_freecam?: boolean; - prohibit_teleport?: boolean; - prohibit_scripts?: boolean; -} - -const tunablesController: RequestHandler = (_req, res) => { +export const tunablesController: RequestHandler = (_req, res) => { const tunables: ITunables = {}; //tunables.prohibit_skip_mission_start_timer = true; //tunables.prohibit_fov_override = true; @@ -19,5 +12,3 @@ const tunablesController: RequestHandler = (_req, res) => { //tunables.prohibit_scripts = true; res.json(tunables); }; - -export { tunablesController }; diff --git a/src/services/wsService.ts b/src/services/wsService.ts index 0e35d0c2..6850e1a2 100644 --- a/src/services/wsService.ts +++ b/src/services/wsService.ts @@ -8,6 +8,7 @@ import type { IDatabaseAccountJson } from "../types/loginTypes.ts"; import type { HydratedDocument } from "mongoose"; import { logError, logger } from "../utils/logger.ts"; import type { Request } from "express"; +import type { ITunables } from "../types/bootstrapperTypes.ts"; let wsServer: WebSocketServer | undefined; let wssServer: WebSocketServer | undefined; @@ -89,8 +90,9 @@ interface IWsMsgToClient { logged_out?: boolean; have_game_ws?: boolean; - // to game + // to game/bootstrapper (https://openwf.io/bootstrapper-manual) sync_inventory?: boolean; + tunables?: ITunables; } const wsOnConnect = (ws: WebSocket, req: http.IncomingMessage): void => { diff --git a/src/types/bootstrapperTypes.ts b/src/types/bootstrapperTypes.ts new file mode 100644 index 00000000..f011b85a --- /dev/null +++ b/src/types/bootstrapperTypes.ts @@ -0,0 +1,9 @@ +// This is specific to the OpenWF Bootstrapper: https://openwf.io/bootstrapper-manual +export interface ITunables { + token?: string; + prohibit_skip_mission_start_timer?: boolean; + prohibit_fov_override?: boolean; + prohibit_freecam?: boolean; + prohibit_teleport?: boolean; + prohibit_scripts?: boolean; +} -- 2.47.2