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: add consistent options for IRC, HUB, & NRS addresses (#2746)

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

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

代码差异

4 个文件 +9 -7
Modified README.md +1 -1
@@ -14,7 +14,7 @@ SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [confi
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 16 - `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
17 - `myIrcAddresses` can be used to point to an IRC server. If not provided, defaults to `[ myAddress ]`.
17 - `ircAddress`, `hubAddress`, and `nrsAddress` are not present by default but can be provided if these secondary servers are on a different machine.
18 18 - `worldState.eidolonOverride` can be set to `day` or `night` to lock the time to day/fass and night/vome on Plains of Eidolon/Cambion Drift.
19 19 - `worldState.vallisOverride` can be set to `warm` or `cold` to lock the temperature on Orb Vallis.
20 20 - `worldState.duviriOverride` can be set to `joy`, `anger`, `envy`, `sorrow`, or `fear` to lock the Duviri spiral.
Modified src/controllers/api/hubController.ts +2 -3
@@ -1,7 +1,6 @@
1 1 import type { RequestHandler } from "express";
2 import { getReflexiveAddress } from "../../services/configService.ts";
2 import { config, getReflexiveAddress } from "../../services/configService.ts";
3 3
4 4 export const hubController: RequestHandler = (req, res) => {
5 const { myAddress } = getReflexiveAddress(req);
6 res.json(`hub ${myAddress}:6952`);
5 res.json(`hub ${config.hubAddress ?? getReflexiveAddress(req).myAddress}:6952`);
7 6 };
Modified src/controllers/api/loginController.ts +2 -2
@@ -95,11 +95,11 @@ const createLoginResponse = (
95 95 BuildLabel: buildLabel
96 96 };
97 97 if (version_compare(buildLabel, "2015.02.13.10.41") >= 0) {
98 resp.NRS = [myAddress];
98 resp.NRS = [config.nrsAddress ?? myAddress];
99 99 }
100 100 if (version_compare(buildLabel, "2015.05.14.16.29") >= 0) {
101 101 // U17 and up
102 resp.IRC = config.myIrcAddresses ?? [myAddress];
102 resp.IRC = [config.ircAddress ?? myAddress];
103 103 }
104 104 if (version_compare(buildLabel, "2018.11.08.14.45") >= 0) {
105 105 // U24 and up
Modified src/services/configService.ts +4 -1
@@ -14,7 +14,9 @@ export interface IConfig {
14 14 myAddress: string;
15 15 httpPort?: number;
16 16 httpsPort?: number;
17 myIrcAddresses?: string[];
17 ircAddress?: string;
18 hubAddress?: string;
19 nrsAddress?: string;
18 20 administratorNames?: string[];
19 21 autoCreateAccount?: boolean;
20 22 skipTutorial?: boolean;
@@ -84,6 +86,7 @@ export interface IConfig {
84 86
85 87 export const configRemovedOptionsKeys = [
86 88 "NRS",
89 "myIrcAddresses",
87 90 "skipAllDialogue",
88 91 "infiniteCredits",
89 92 "infinitePlatinum",