Commit 1c0d7067 authored by nanahira's avatar nanahira

fix

parent 04888860
...@@ -468,6 +468,8 @@ init = () -> ...@@ -468,6 +468,8 @@ init = () ->
if settings.modules.tips.get if settings.modules.tips.get
load_tips() load_tips()
if settings.modules.tips.enabled
setInterval ()-> setInterval ()->
for room in ROOM_all when room and room.established for room in ROOM_all when room and room.established
ygopro.stoc_send_random_tip_to_room(room) if room.duel_stage == ygopro.constants.DUEL_STAGE.SIDING or room.duel_stage == ygopro.constants.DUEL_STAGE.BEGIN ygopro.stoc_send_random_tip_to_room(room) if room.duel_stage == ygopro.constants.DUEL_STAGE.SIDING or room.duel_stage == ygopro.constants.DUEL_STAGE.BEGIN
...@@ -3853,7 +3855,7 @@ if true ...@@ -3853,7 +3855,7 @@ if true
response.writeHead(200) response.writeHead(200)
response.end(addCallback(u.query.callback, "['密码错误', 0]")) response.end(addCallback(u.query.callback, "['密码错误', 0]"))
return return
success = await load_tips() success = await load_dialogues()
response.writeHead(200) response.writeHead(200)
if success if success
response.end(addCallback(u.query.callback, "['dialogue ok', '" + settings.modules.tips.get + "']")) response.end(addCallback(u.query.callback, "['dialogue ok', '" + settings.modules.tips.get + "']"))
......
...@@ -593,6 +593,8 @@ ...@@ -593,6 +593,8 @@
} }
if (settings.modules.tips.get) { if (settings.modules.tips.get) {
load_tips(); load_tips();
}
if (settings.modules.tips.enabled) {
setInterval(function() { setInterval(function() {
var l, len1, room; var l, len1, room;
for (l = 0, len1 = ROOM_all.length; l < len1; l++) { for (l = 0, len1 = ROOM_all.length; l < len1; l++) {
...@@ -5142,7 +5144,7 @@ ...@@ -5142,7 +5144,7 @@
response.end(addCallback(u.query.callback, "['密码错误', 0]")); response.end(addCallback(u.query.callback, "['密码错误', 0]"));
return; return;
} }
success = (await load_tips()); success = (await load_dialogues());
response.writeHead(200); response.writeHead(200);
if (success) { if (success) {
response.end(addCallback(u.query.callback, "['dialogue ok', '" + settings.modules.tips.get + "']")); response.end(addCallback(u.query.callback, "['dialogue ok', '" + settings.modules.tips.get + "']"));
......
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