diff --git a/config.yml b/config.yml index 781cc94..7701006 100644 --- a/config.yml +++ b/config.yml @@ -1,6 +1,15 @@ mods: - screepsmod-auth - - screepsmod-admin-utils - screepsmod-mongo bots: simplebot: screepsbot-zeswarm + +serverConfig: + # The number of parallel runner threads in which player scripts are executed. + # Don't set this option greater than the number of your physical CPU cores. + runner_threads: 4 + # The number of room processor worker processes to launch. + # Don't set this option greater than the number of your physical CPU cores. + processors_cnt: 2 + # If set, forward console messages to terminal + log_console: false \ No newline at end of file diff --git a/screeps-start.js b/screeps-start.js index 7515011..9240d13 100755 --- a/screeps-start.js +++ b/screeps-start.js @@ -128,11 +128,20 @@ const start = async () => { writeModsConfiguration(); const screeps = require("@screeps/launcher"); + const options = { + steam_api_key: process.env.STEAM_KEY || config.steamKey, + storage_disable: false, + }; + + const keys = ['runner_threads', 'processors_cnt', 'log_console']; + for (const key of keys) { + if (options[key]) { + options[key] = config.serverConfig[key]; + } + } + await screeps.start( - { - steam_api_key: process.env.STEAM_KEY || config.steamKey, - storage_disable: false, - }, + options, process.stdout, ); };