Commit 362f3924 authored by nanahira's avatar nanahira

missing async

parent 914ccce5
...@@ -3741,8 +3741,9 @@ if settings.modules.http ...@@ -3741,8 +3741,9 @@ if settings.modules.http
response.writeHead(200) response.writeHead(200)
response.end(addCallback(u.query.callback, "['密码错误', 0]")) response.end(addCallback(u.query.callback, "['密码错误', 0]"))
return return
for room in ROOM_all when room and room.established _async.each ROOM_all, (room)->
ygopro.stoc_send_chat_to_room(room, u.query.shout, ygopro.constants.COLORS.YELLOW) if room and room.established
ygopro.stoc_send_chat_to_room(room, u.query.shout, ygopro.constants.COLORS.YELLOW)
response.writeHead(200) response.writeHead(200)
response.end(addCallback(u.query.callback, "['shout ok', '" + u.query.shout + "']")) response.end(addCallback(u.query.callback, "['shout ok', '" + u.query.shout + "']"))
......
...@@ -4769,7 +4769,7 @@ ...@@ -4769,7 +4769,7 @@
return callback + "( " + text + " );"; return callback + "( " + text + " );";
}; };
requestListener = async function(request, response) { requestListener = async function(request, response) {
var archive_args, archive_name, archive_process, check, death_room_found, duellog, err, error, filename, getpath, len2, len3, m, n, parseQueryString, pass_validated, ref2, replay, room, roomsjson, u; var archive_args, archive_name, archive_process, check, death_room_found, duellog, err, error, filename, getpath, len2, m, parseQueryString, pass_validated, ref2, replay, 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
...@@ -4949,12 +4949,11 @@ ...@@ -4949,12 +4949,11 @@
response.end(addCallback(u.query.callback, "['密码错误', 0]")); response.end(addCallback(u.query.callback, "['密码错误', 0]"));
return; return;
} }
for (n = 0, len3 = ROOM_all.length; n < len3; n++) { _async.each(ROOM_all, function(room) {
room = ROOM_all[n];
if (room && room.established) { if (room && room.established) {
ygopro.stoc_send_chat_to_room(room, u.query.shout, ygopro.constants.COLORS.YELLOW); return ygopro.stoc_send_chat_to_room(room, u.query.shout, ygopro.constants.COLORS.YELLOW);
} }
} });
response.writeHead(200); response.writeHead(200);
response.end(addCallback(u.query.callback, "['shout ok', '" + u.query.shout + "']")); response.end(addCallback(u.query.callback, "['shout ok', '" + u.query.shout + "']"));
} else if (u.query.stop) { } else if (u.query.stop) {
......
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