-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow customizing some of the server options #16
Conversation
07627be
to
769be9f
Compare
config.yml
Outdated
@@ -1,6 +1,15 @@ | |||
mods: | |||
- screepsmod-auth | |||
- screepsmod-admin-utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be removed.
config.yml
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a whitelist anyway, it should be following the same naming convention as the rest of the config. So runnerThreads
and processorCount
.
screeps-start.js
Outdated
|
||
const keys = ['runner_threads', 'processors_cnt', 'log_console']; | ||
for (const key of keys) { | ||
if (options[key]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line only overrides if the option is truthy. We should just check if it exists.
if (options[key]) { | |
if (key in options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, just realised that this should not be checking options
but config.serverConfig
:)
This passes in a few whitelisted keys from config.yml to override defaults from the default `.screepsrc` file.
769be9f
to
061a3f9
Compare
screeps-start.js
Outdated
|
||
const keys = ['runner_threads', 'processors_cnt', 'log_console']; | ||
for (const key of keys) { | ||
if (options[key]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, just realised that this should not be checking options
but config.serverConfig
:)
This passes in a few whitelisted keys from config.yml to override defaults from the default
.screepsrc
file.