Commit 32e00712 authored by nanahira's avatar nanahira

fix

parent d09de158
...@@ -1939,8 +1939,14 @@ if settings.modules.http ...@@ -1939,8 +1939,14 @@ if settings.modules.http
try try
archive_name = moment().format('YYYY-MM-DD HH:mm:ss') + ".zip" archive_name = moment().format('YYYY-MM-DD HH:mm:ss') + ".zip"
archive_args = ["a", "-mx0", "-y", archive_name] archive_args = ["a", "-mx0", "-y", archive_name]
check = false
for replay in settings.modules.tournament_mode.duel_log for replay in settings.modules.tournament_mode.duel_log
check = true
archive_args.push(replay.replay_filename) archive_args.push(replay.replay_filename)
if !check
response.writeHead(403)
response.end("Duel logs not found.")
return
archive_process = spawn settings.modules.tournament_mode.replay_archive_tool, archive_args, {cwd: settings.modules.tournament_mode.replay_path} archive_process = spawn settings.modules.tournament_mode.replay_archive_tool, archive_args, {cwd: settings.modules.tournament_mode.replay_path}
archive_process.on 'error', (err)=> archive_process.on 'error', (err)=>
response.writeHead(403) response.writeHead(403)
......
...@@ -2377,7 +2377,7 @@ ...@@ -2377,7 +2377,7 @@
return callback + "( " + text + " );"; return callback + "( " + text + " );";
}; };
requestListener = function(request, response) { requestListener = function(request, response) {
var archive_args, archive_name, archive_process, death_room_found, duellog, error, filename, getpath, j, k, l, len, len1, len2, len3, m, parseQueryString, pass_validated, player, ref, replay, room, roomsjson, u; var archive_args, archive_name, archive_process, check, death_room_found, duellog, error, filename, getpath, j, k, l, len, len1, len2, len3, m, parseQueryString, pass_validated, player, ref, replay, room, roomsjson, u;
parseQueryString = true; parseQueryString = true;
u = url.parse(request.url, parseQueryString); u = url.parse(request.url, parseQueryString);
pass_validated = u.query.pass === settings.modules.http.password; pass_validated = u.query.pass === settings.modules.http.password;
...@@ -2447,11 +2447,18 @@ ...@@ -2447,11 +2447,18 @@
try { try {
archive_name = moment().format('YYYY-MM-DD HH:mm:ss') + ".zip"; archive_name = moment().format('YYYY-MM-DD HH:mm:ss') + ".zip";
archive_args = ["a", "-mx0", "-y", archive_name]; archive_args = ["a", "-mx0", "-y", archive_name];
check = false;
ref = settings.modules.tournament_mode.duel_log; ref = settings.modules.tournament_mode.duel_log;
for (j = 0, len = ref.length; j < len; j++) { for (j = 0, len = ref.length; j < len; j++) {
replay = ref[j]; replay = ref[j];
check = true;
archive_args.push(replay.replay_filename); archive_args.push(replay.replay_filename);
} }
if (!check) {
response.writeHead(403);
response.end("Duel logs not found.");
return;
}
archive_process = spawn(settings.modules.tournament_mode.replay_archive_tool, archive_args, { archive_process = spawn(settings.modules.tournament_mode.replay_archive_tool, archive_args, {
cwd: settings.modules.tournament_mode.replay_path cwd: settings.modules.tournament_mode.replay_path
}); });
......
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