Commit e6cbcf4a authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 64809f0c 05b138a5
......@@ -1931,16 +1931,18 @@ if settings.modules.http
response.writeHead(403)
response.end("Invalid password.")
return
else if !settings.modules.tournament_mode.duel_log.size
response.writeHead(403)
response.end("Duel logs not found.")
return
else
try
archive_name = moment().format('YYYY-MM-DD HH:mm:ss') + ".zip"
archive_args = ["a", "-mx0", "-y", archive_name]
check = false
for replay in settings.modules.tournament_mode.duel_log
check = true
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.on 'error', (err)=>
response.writeHead(403)
......
......@@ -2511,7 +2511,7 @@
return callback + "( " + text + " );";
};
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;
u = url.parse(request.url, parseQueryString);
pass_validated = u.query.pass === settings.modules.http.password;
......@@ -2573,19 +2573,22 @@
response.writeHead(403);
response.end("Invalid password.");
return;
} else if (!settings.modules.tournament_mode.duel_log.size) {
response.writeHead(403);
response.end("Duel logs not found.");
return;
} else {
try {
archive_name = moment().format('YYYY-MM-DD HH:mm:ss') + ".zip";
archive_args = ["a", "-mx0", "-y", archive_name];
check = false;
ref = settings.modules.tournament_mode.duel_log;
for (j = 0, len = ref.length; j < len; j++) {
replay = ref[j];
check = true;
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
});
......
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