XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: update typings for bootstrapper for 0.11.13 (#2900)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2900 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

4b3e2dfc
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

3 个文件 +14 -12
Modified src/controllers/custom/tunablesController.ts +2 -11
@@ -1,16 +1,9 @@
1 1 import type { RequestHandler } from "express";
2 import type { ITunables } from "../../types/bootstrapperTypes.ts";
2 3
3 4 // This endpoint is specific to the OpenWF Bootstrapper: https://openwf.io/bootstrapper-manual
4 5
5 interface ITunables {
6 prohibit_skip_mission_start_timer?: boolean;
7 prohibit_fov_override?: boolean;
8 prohibit_freecam?: boolean;
9 prohibit_teleport?: boolean;
10 prohibit_scripts?: boolean;
11 }
12
13 const tunablesController: RequestHandler = (_req, res) => {
6 export const tunablesController: RequestHandler = (_req, res) => {
14 7 const tunables: ITunables = {};
15 8 //tunables.prohibit_skip_mission_start_timer = true;
16 9 //tunables.prohibit_fov_override = true;
@@ -19,5 +12,3 @@ const tunablesController: RequestHandler = (_req, res) => {
19 12 //tunables.prohibit_scripts = true;
20 13 res.json(tunables);
21 14 };
22
23 export { tunablesController };
Modified src/services/wsService.ts +3 -1
@@ -8,6 +8,7 @@ import type { IDatabaseAccountJson } from "../types/loginTypes.ts";
8 8 import type { HydratedDocument } from "mongoose";
9 9 import { logError, logger } from "../utils/logger.ts";
10 10 import type { Request } from "express";
11 import type { ITunables } from "../types/bootstrapperTypes.ts";
11 12
12 13 let wsServer: WebSocketServer | undefined;
13 14 let wssServer: WebSocketServer | undefined;
@@ -89,8 +90,9 @@ interface IWsMsgToClient {
89 90 logged_out?: boolean;
90 91 have_game_ws?: boolean;
91 92
92 // to game
93 // to game/bootstrapper (https://openwf.io/bootstrapper-manual)
93 94 sync_inventory?: boolean;
95 tunables?: ITunables;
94 96 }
95 97
96 98 const wsOnConnect = (ws: WebSocket, req: http.IncomingMessage): void => {
Added src/types/bootstrapperTypes.ts +9 -0
@@ -0,0 +1,9 @@
1 // This is specific to the OpenWF Bootstrapper: https://openwf.io/bootstrapper-manual
2 export interface ITunables {
3 token?: string;
4 prohibit_skip_mission_start_timer?: boolean;
5 prohibit_fov_override?: boolean;
6 prohibit_freecam?: boolean;
7 prohibit_teleport?: boolean;
8 prohibit_scripts?: boolean;
9 }