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: use embedded mongod by default (#4083)

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

2fcd300e
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

4 个文件 +9 -3
Modified .gitignore +4 -0
@@ -19,3 +19,7 @@ yarn.lock
19 19
20 20 # Default Docker directory
21 21 /docker-data
22
23 # MongoDB data
24 /database
25 /db-data
Modified README.md +1 -1
@@ -13,7 +13,7 @@ To get an idea of what functionality you can expect to be missing [have a look t
13 13 SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [config-vanilla.json](config-vanilla.json), which has most cheats disabled.
14 14
15 15 - `skipTutorial` affects only newly created accounts, so you may wish to change it before logging in for the first time.
16 - `mongodbUrl` can be a `mongodb://`, `mongodb+srv://` or `file://` URI.
16 - `mongodbUrl` defaults to a `file://` URI which starts up an embedded mongod, but can be `mongodb://127.0.0.1:27017/openWF` if you have a system-wide mongod installation.
17 17 - `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
18 18 - `bindAddress`, `httpPort`, `httpsPort` are related to how SpaceNinjaServer is reached on the network. Under Docker, these options are unchangable; modify your `docker-compose.yml`, instead.
19 19 - `ircExecutable` and `hubExecutable` can be provided with relative paths to executables which will be ran as child processes of SpaceNinjaServer.
Modified config-vanilla.json +1 -1
@@ -1,5 +1,5 @@
1 1 {
2 "mongodbUrl": "mongodb://127.0.0.1:27017/openWF",
2 "mongodbUrl": "file://./database",
3 3 "logger": {
4 4 "files": true,
5 5 "level": "trace",
Modified src/index.ts +3 -1
@@ -46,7 +46,9 @@ if (mongodUri.startsWith("file://")) {
46 46 fs.mkdirSync(dataDir, { recursive: true });
47 47 const mongod = await MongoMemoryServer.create({
48 48 instance: {
49 dbPath: dataDir
49 dbPath: dataDir,
50 port: 27017, // Prefer 27017
51 portGeneration: true // If 27017 is not available, use another port
50 52 }
51 53 });
52 54 mongodUri = mongod.getUri();