-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings_migrator.js
More file actions
22 lines (21 loc) · 839 Bytes
/
settings_migrator.js
File metadata and controls
22 lines (21 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const DefaultSettings = {
"logabnormal": false,
"logmessage": false,
"questballoon": false,
"writelog": false,
"logboss": false,
"blacklist": [],
"whitelist": [1000,1001,1002,1003,1004,1005,2000,3000,46601,46602,46701,46703,46704,76901,76902,76903,77704,77707,77730],
}
module.exports = function MigrateSettings(from_ver, to_ver, settings) {
if (from_ver === undefined) {
// Migrate legacy config file
return Object.assign(Object.assign({}, DefaultSettings), settings);
} else if (from_ver === null) {
// No config file exists, use default settings
return DefaultSettings;
} else {
// Migrate from older version (using the new system) to latest one
throw new Error('So far there is only one settings version and this should never be reached!');
}
}