Commit 25c3f035 authored by nanahira's avatar nanahira

fix

parent e0323201
......@@ -660,7 +660,7 @@ CLIENT_heartbeat_register = (client, send, extend_time) ->
client.heartbeat_responsed = false
if send
ygopro.stoc_send(client, "TIME_LIMIT", {
player: (if client.is_first or client.is_reconnect_recovering then 0 else 1),
player: (if client.is_first and !client.is_reconnect_recovering then 0 else 1),
left_time: 0
})
client.heartbeat_timeout = setTimeout(() ->
......@@ -2703,8 +2703,8 @@ if settings.modules.mycard.enabled
if settings.modules.heartbeat_detection.enabled
setInterval ()->
for room in ROOM_all when room and room.started and (room.hostinfo.time_limit == 0 or !room.turn or room.turn <= 0) and room.duel_count and room.duel_count > 0
for player in room.players when (!player.is_local or !room.windbot) and (!room.changing_side or player.selected_preduel)
for room in ROOM_all when room and room.started and (room.hostinfo.time_limit == 0 or !room.turn or room.turn <= 0)
for player in room.players when (!player.is_local or !room.windbot) and (((!room.changing_side or player.selected_preduel) and room.duel_count and room.duel_count > 0) or player.is_reconnect_recovering)
CLIENT_heartbeat_register(player, true)
return
, settings.modules.heartbeat_detection.interval
......
......@@ -845,7 +845,7 @@
client.heartbeat_responsed = false;
if (send) {
ygopro.stoc_send(client, "TIME_LIMIT", {
player: (client.is_first || client.is_reconnect_recovering ? 0 : 1),
player: (client.is_first && !client.is_reconnect_recovering ? 0 : 1),
left_time: 0
});
}
......@@ -3423,11 +3423,11 @@
var len2, len3, m, n, player, ref2, room;
for (m = 0, len2 = ROOM_all.length; m < len2; m++) {
room = ROOM_all[m];
if (room && room.started && (room.hostinfo.time_limit === 0 || !room.turn || room.turn <= 0) && room.duel_count && room.duel_count > 0) {
if (room && room.started && (room.hostinfo.time_limit === 0 || !room.turn || room.turn <= 0)) {
ref2 = room.players;
for (n = 0, len3 = ref2.length; n < len3; n++) {
player = ref2[n];
if ((!player.is_local || !room.windbot) && (!room.changing_side || player.selected_preduel)) {
if ((!player.is_local || !room.windbot) && (((!room.changing_side || player.selected_preduel) && room.duel_count && room.duel_count > 0) || player.is_reconnect_recovering)) {
CLIENT_heartbeat_register(player, true);
}
}
......
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