Commit 70fa03e9 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 872778dd 7d83b582
...@@ -65,8 +65,12 @@ ...@@ -65,8 +65,12 @@
"get_zh": false "get_zh": false
}, },
"dialogues": { "dialogues": {
<<<<<<< HEAD
"enabled": false, "enabled": false,
"get_custom": "http://purerosefallen.github.io/ygopro-tips/dialogues-222.json", "get_custom": "http://purerosefallen.github.io/ygopro-tips/dialogues-222.json",
=======
"enabled": true,
>>>>>>> mc
"get": "http://mercury233.me/ygosrv233/dialogues.json" "get": "http://mercury233.me/ygosrv233/dialogues.json"
}, },
"words": { "words": {
......
...@@ -248,10 +248,15 @@ concat_name = global.concat_name = (name, num) -> ...@@ -248,10 +248,15 @@ concat_name = global.concat_name = (name, num) ->
# 读取配置 # 读取配置
default_config = loadJSON('./data/default_config.json') default_config = loadJSON('./data/default_config.json')
try if fs.existsSync('./config/config.json')
config = loadJSON('./config/config.json') try
catch config = loadJSON('./config/config.json')
catch e
console.error("Failed reading config: ", e.toString())
process.exit(1)
else
config = {} config = {}
settings = global.settings = merge(default_config, config, { arrayMerge: (destination, source) -> source }) settings = global.settings = merge(default_config, config, { arrayMerge: (destination, source) -> source })
auth = global.auth = require './ygopro-auth.js' auth = global.auth = require './ygopro-auth.js'
......
...@@ -301,9 +301,15 @@ ...@@ -301,9 +301,15 @@
// 读取配置 // 读取配置
default_config = loadJSON('./data/default_config.json'); default_config = loadJSON('./data/default_config.json');
try { if (fs.existsSync('./config/config.json')) {
config = loadJSON('./config/config.json'); try {
} catch (error1) { config = loadJSON('./config/config.json');
} catch (error1) {
e = error1;
console.error("Failed reading config: ", e.toString());
process.exit(1);
}
} else {
config = {}; config = {};
} }
...@@ -3541,6 +3547,7 @@ ...@@ -3541,6 +3547,7 @@
}); });
}; };
<<<<<<< HEAD
load_dialogues_custom = global.load_dialogues_custom = function(callback) { load_dialogues_custom = global.load_dialogues_custom = function(callback) {
request({ request({
url: settings.modules.dialogues.get_custom, url: settings.modules.dialogues.get_custom,
...@@ -3561,6 +3568,9 @@ ...@@ -3561,6 +3568,9 @@
}; };
if (settings.modules.dialogues.enabled && settings.modules.dialogues.get) { if (settings.modules.dialogues.enabled && settings.modules.dialogues.get) {
=======
if (settings.modules.dialogues.get) {
>>>>>>> mc
load_dialogues(); load_dialogues();
} }
...@@ -4293,6 +4303,7 @@ ...@@ -4293,6 +4303,7 @@
}); });
}; };
<<<<<<< HEAD
load_tips_zh = global.load_tips_zh = function(callback) { load_tips_zh = global.load_tips_zh = function(callback) {
request({ request({
url: settings.modules.tips.get_zh, url: settings.modules.tips.get_zh,
...@@ -4313,6 +4324,9 @@ ...@@ -4313,6 +4324,9 @@
}; };
if (settings.modules.tips.enabled && settings.modules.tips.get) { if (settings.modules.tips.enabled && settings.modules.tips.get) {
=======
if (settings.modules.tips.get) {
>>>>>>> mc
load_tips(); load_tips();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment