chore: add consistent options for IRC, HUB, & NRS addresses (#2746)

Reviewed-on: OpenWF/SpaceNinjaServer#2746
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-09-03 22:45:22 -07:00 committed by Sainan
parent 18556cb2f5
commit f4f7ed00d1
4 changed files with 9 additions and 7 deletions

View File

@ -14,7 +14,7 @@ SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [confi
- `skipTutorial` affects only newly created accounts, so you may wish to change it before logging in for the first time.
- `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
- `myIrcAddresses` can be used to point to an IRC server. If not provided, defaults to `[ myAddress ]`.
- `ircAddress`, `hubAddress`, and `nrsAddress` are not present by default but can be provided if these secondary servers are on a different machine.
- `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.
- `worldState.vallisOverride` can be set to `warm` or `cold` to lock the temperature on Orb Vallis.
- `worldState.duviriOverride` can be set to `joy`, `anger`, `envy`, `sorrow`, or `fear` to lock the Duviri spiral.

View File

@ -1,7 +1,6 @@
import type { RequestHandler } from "express";
import { getReflexiveAddress } from "../../services/configService.ts";
import { config, getReflexiveAddress } from "../../services/configService.ts";
export const hubController: RequestHandler = (req, res) => {
const { myAddress } = getReflexiveAddress(req);
res.json(`hub ${myAddress}:6952`);
res.json(`hub ${config.hubAddress ?? getReflexiveAddress(req).myAddress}:6952`);
};

View File

@ -95,11 +95,11 @@ const createLoginResponse = (
BuildLabel: buildLabel
};
if (version_compare(buildLabel, "2015.02.13.10.41") >= 0) {
resp.NRS = [myAddress];
resp.NRS = [config.nrsAddress ?? myAddress];
}
if (version_compare(buildLabel, "2015.05.14.16.29") >= 0) {
// U17 and up
resp.IRC = config.myIrcAddresses ?? [myAddress];
resp.IRC = [config.ircAddress ?? myAddress];
}
if (version_compare(buildLabel, "2018.11.08.14.45") >= 0) {
// U24 and up

View File

@ -14,7 +14,9 @@ export interface IConfig {
myAddress: string;
httpPort?: number;
httpsPort?: number;
myIrcAddresses?: string[];
ircAddress?: string;
hubAddress?: string;
nrsAddress?: string;
administratorNames?: string[];
autoCreateAccount?: boolean;
skipTutorial?: boolean;
@ -84,6 +86,7 @@ export interface IConfig {
export const configRemovedOptionsKeys = [
"NRS",
"myIrcAddresses",
"skipAllDialogue",
"infiniteCredits",
"infinitePlatinum",