Commit ddf53a58 authored by nanahira's avatar nanahira

clear duellong

parent 340b7149
......@@ -1905,6 +1905,17 @@ if settings.modules.http
duellog = JSON.stringify settings.modules.tournament_mode.duel_log, null, 2
response.end(addCallback(u.query.callback, duellog))
else if u.pathname == '/api/clearlog' and settings.modules.tournament_mode.enabled
if !(u.query.pass == settings.modules.tournament_mode.password)
response.writeHead(200)
response.end(addCallback(u.query.callback, "[{name:'密码错误'}]"))
return
else
response.writeHead(200)
settings.modules.tournament_mode.duel_log = []
nconf.myset(settings, "modules:tournament_mode:duel_log", settings.modules.tournament_mode.duel_log)
response.end(addCallback(u.query.callback, "[{name:'Success'}]"))
else if _.startsWith(u.pathname, '/api/replay') and settings.modules.tournament_mode.enabled
if !(u.query.pass == settings.modules.tournament_mode.password)
response.writeHead(403)
......
......@@ -2408,6 +2408,17 @@
duellog = JSON.stringify(settings.modules.tournament_mode.duel_log, null, 2);
response.end(addCallback(u.query.callback, duellog));
}
} else if (u.pathname === '/api/clearlog' && settings.modules.tournament_mode.enabled) {
if (!(u.query.pass === settings.modules.tournament_mode.password)) {
response.writeHead(200);
response.end(addCallback(u.query.callback, "[{name:'密码错误'}]"));
return;
} else {
response.writeHead(200);
settings.modules.tournament_mode.duel_log = [];
nconf.myset(settings, "modules:tournament_mode:duel_log", settings.modules.tournament_mode.duel_log);
response.end(addCallback(u.query.callback, "[{name:'Success'}]"));
}
} else if (_.startsWith(u.pathname, '/api/replay') && settings.modules.tournament_mode.enabled) {
if (!(u.query.pass === settings.modules.tournament_mode.password)) {
response.writeHead(403);
......
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