forked from OpenWF/SpaceNinjaServer
		
	feat: ircExecutable config (#2945)
Reviewed-on: OpenWF/SpaceNinjaServer#2945 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:
		
							parent
							
								
									bb1d6a98c5
								
							
						
					
					
						commit
						e3048ea188
					
				@ -14,7 +14,8 @@ 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`.
 | 
			
		||||
- `ircAddress`, `hubAddress`, and `nrsAddress` are not present by default but can be provided if these secondary servers are on a different machine.
 | 
			
		||||
- `ircExecutable` can be provided with a relative path to an EXE which will be ran as a child process of SpaceNinjaServer.
 | 
			
		||||
- `ircAddress`, `hubAddress`, and `nrsAddress` 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.
 | 
			
		||||
 | 
			
		||||
@ -8,6 +8,10 @@
 | 
			
		||||
  "bindAddress": "0.0.0.0",
 | 
			
		||||
  "httpPort": 80,
 | 
			
		||||
  "httpsPort": 443,
 | 
			
		||||
  "ircExecutable": null,
 | 
			
		||||
  "ircAddress": null,
 | 
			
		||||
  "hubAddress": null,
 | 
			
		||||
  "nrsAddress": null,
 | 
			
		||||
  "administratorNames": [],
 | 
			
		||||
  "autoCreateAccount": true,
 | 
			
		||||
  "skipTutorial": false,
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								src/index.ts
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/index.ts
									
									
									
									
									
								
							@ -19,6 +19,7 @@ logger.info("Starting up...");
 | 
			
		||||
// Proceed with normal startup: bring up config watcher service, validate config, connect to MongoDB, and finally start listening for HTTP.
 | 
			
		||||
import mongoose from "mongoose";
 | 
			
		||||
import path from "path";
 | 
			
		||||
import child_process from "child_process";
 | 
			
		||||
import { JSONStringify } from "json-with-bigint";
 | 
			
		||||
import { startWebServer } from "./services/webService.ts";
 | 
			
		||||
import { validateConfig } from "./services/configWatcherService.ts";
 | 
			
		||||
@ -43,6 +44,17 @@ mongoose
 | 
			
		||||
 | 
			
		||||
        startWebServer();
 | 
			
		||||
 | 
			
		||||
        if (config.ircExecutable) {
 | 
			
		||||
            logger.info(`Starting IRC server: ${config.ircExecutable}`);
 | 
			
		||||
            child_process.execFile(config.ircExecutable, (error, _stdout, _stderr) => {
 | 
			
		||||
                if (error) {
 | 
			
		||||
                    logger.warn(`Failed to start IRC server`, error);
 | 
			
		||||
                } else {
 | 
			
		||||
                    logger.warn(`IRC server terminated unexpectedly`);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        void updateWorldStateCollections();
 | 
			
		||||
        setInterval(() => {
 | 
			
		||||
            void updateWorldStateCollections();
 | 
			
		||||
 | 
			
		||||
@ -15,6 +15,7 @@ export interface IConfig {
 | 
			
		||||
    bindAddress?: string;
 | 
			
		||||
    httpPort?: number;
 | 
			
		||||
    httpsPort?: number;
 | 
			
		||||
    ircExecutable?: string;
 | 
			
		||||
    ircAddress?: string;
 | 
			
		||||
    hubAddress?: string;
 | 
			
		||||
    nrsAddress?: string;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user