mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-07 12:10:46 +00:00
Make default settings default (fix #223)
This commit is contained in:
parent
b6eca14b82
commit
7bd164aa39
1 changed files with 10 additions and 1 deletions
11
app.js
11
app.js
|
|
@ -2,12 +2,21 @@
|
||||||
|
|
||||||
const mcServer = require('./')
|
const mcServer = require('./')
|
||||||
|
|
||||||
|
const defaultSettings = require('./config/default-settings')
|
||||||
|
|
||||||
let settings
|
let settings
|
||||||
|
|
||||||
try {
|
try {
|
||||||
settings = require('./config/settings')
|
settings = require('./config/settings')
|
||||||
|
|
||||||
|
Object.keys(defaultSettings).forEach(settingKey => {
|
||||||
|
if(settings[settingKey] === undefined) {
|
||||||
|
settings[settingKey] = defaultSettings[settingKey];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
settings = require('./config/default-settings')
|
settings = defaultSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = mcServer.createMCServer(settings)
|
module.exports = mcServer.createMCServer(settings)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue