返回提交历史
Modified
src/controllers/api/loginController.ts
+3
-7
Modified
src/index.ts
+7
-0
XFEstudio/SpaceNinjaServer
chore: add startup message to dev mode (#4129)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4129 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
847d070c
代码差异
2 个文件
+10
-7
@@ -61,13 +61,9 @@ export const loginController: RequestHandler = async (request, response) => {
61
61
62
62
const buildLabel = getBuildLabelForUnauthenticatedRequest(request);
63
63
64
if (version_compare(buildLabel, gameToBuildVersion["42.0.0"]) >= 0) {
65
if (args.dev) {
66
logger.debug(`We are eagerly awaiting your pull requests!`);
67
} else {
68
response.status(400).json({ error: "I'm making a list and checking it twice" });
69
return;
70
}
64
if (version_compare(buildLabel, gameToBuildVersion["42.0.0"]) >= 0 && !args.dev) {
65
response.status(400).json({ error: "I'm making a list and checking it twice" });
66
return;
71
67
}
72
68
73
69
if (!account && config.autoCreateAccount) {
@@ -26,6 +26,7 @@ import { syncConfigWithDatabase, validateConfig } from "./services/configWatcher
26
26
import { updateWorldStateCollections } from "./services/worldStateService.ts";
27
27
import { repoDir } from "./helpers/pathHelper.ts";
28
28
import { MongoMemoryServer } from "mongodb-memory-server-core";
29
import { args } from "./helpers/commandLineArguments.ts";
29
30
30
31
JSON.stringify = JSONStringify; // Patch JSON.stringify to work flawlessly with Bigints.
31
32
@@ -92,6 +93,12 @@ mongoose
92
93
}
93
94
}
94
95
96
if (args.dev) {
97
logger.debug(
98
"Developer mode is enabled. Note that this project is where it is now due to code contributions; please pay it forward with pull requests."
99
);
100
}
101
95
102
void updateWorldStateCollections();
96
103
setInterval(() => {
97
104
void updateWorldStateCollections();