packages/slave/slave.js
/**
	 * Prepare instance for starting
	 *
	 * Writes server settings, admin/ban/white-lists and links mods.
	 */
Prepare instance for starting
Writes server settings, admin/ban/white-lists and links mods.
Prepare instance for starting Writes server settings admin / ban / white - lists and links mods .
async prepare() {
		this.logger.verbose("Writing server-settings.json");
		await this.writeServerSettings();
		if (this.config.get("factorio.sync_adminlist")) {
			this.logger.verbose("Writing server-adminlist.json");
			fs.outputFile(
				this.server.writePath("server-adminlist.json"),
				JSON.stringify([...this._slave.adminlist], null, 4)
			);
		}
		if (this.config.get("factorio.sync_banlist")) {
			this.logger.verbose("Writing server-banlist.json");
			fs.outputFile(
				this.server.writePath("server-banlist.json"),
				JSON.stringify([...this._slave.banlist].map(
					([username, reason]) => ({ username, reason })
				), null, 4),
			);
		}
		if (this.config.get("factorio.sync_whitelist")) {
			this.logger.verbose("Writing server-whitelist.json");
			fs.outputFile(
				this.server.writePath("server-whitelist.json"),
				JSON.stringify([...this._slave.whitelist], null, 4)
			);
		}
		await symlinkMods(this, "sharedMods");
	}
async prepare ( ) { this . logger . verbose ( "Writing server-settings.json" ) ; await this . writeServerSettings ( ) ; if ( this . config . get ( "factorio.sync_adminlist" ) ) { this . logger . verbose ( "Writing server-adminlist.json" ) ; fs . outputFile ( this . server . writePath ( "server-adminlist.json" ) , JSON . stringify ( [ ... this . _slave . adminlist ] , null , 4 ) ) ; } if ( this . config . get ( "factorio.sync_banlist" ) ) { this . logger . verbose ( "Writing server-banlist.json" ) ; fs . outputFile ( this . server . writePath ( "server-banlist.json" ) , JSON . stringify ( [ ... this . _slave . banlist ] . map ( ( [ username , reason ] ) => ( { username , reason } ) ) , null , 4 ) , ) ; } if ( this . config . get ( "factorio.sync_whitelist" ) ) { this . logger . verbose ( "Writing server-whitelist.json" ) ; fs . outputFile ( this . server . writePath ( "server-whitelist.json" ) , JSON . stringify ( [ ... this . _slave . whitelist ] , null , 4 ) ) ; } await symlinkMods ( this , "sharedMods" ) ; }
Prepare instance for starting
 Writes server settings, admin/ban/white-lists and links mods.
Prepare instance for starting Writes server settings admin / ban / white - lists and links mods .
// eslint-disable-next-line no-use-before-define