Commit d751d18f authored by nanahira's avatar nanahira

save a copy when clearing the log

parent 5608081c
......@@ -92,6 +92,7 @@
"replay_archive_tool": "7z",
"show_ip": false,
"show_info": true,
"log_save_path": "./config/",
"password": "123456",
"port": 7933
},
......
......@@ -2070,6 +2070,11 @@ if settings.modules.http
return
else
response.writeHead(200)
if settings.modules.tournament_mode.log_save_path
fs.writeFile(settings.modules.tournament_mode.log_save_path + 'duel_log.' + moment().format('YYYY-MM-DD HH-mm-ss') + '.json', JSON.stringify(duel_log, null, 2), (err) ->
if err
log.warn 'DUEL LOG SAVE ERROR', err
)
duel_log.duel_log = []
setting_save(duel_log)
response.end(addCallback(u.query.callback, "[{name:'Success'}]"))
......
......@@ -2630,6 +2630,13 @@
return;
} else {
response.writeHead(200);
if (settings.modules.tournament_mode.log_save_path) {
fs.writeFile(settings.modules.tournament_mode.log_save_path + 'duel_log.' + moment().format('YYYY-MM-DD HH-mm-ss') + '.json', JSON.stringify(duel_log, null, 2), function(err) {
if (err) {
return log.warn('DUEL LOG SAVE ERROR', err);
}
});
}
duel_log.duel_log = [];
setting_save(duel_log);
response.end(addCallback(u.query.callback, "[{name:'Success'}]"));
......
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