Commit 8d231346 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 251ce0d4 6dc2417b
...@@ -3114,7 +3114,7 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)-> ...@@ -3114,7 +3114,7 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
return unless room return unless room
msg = _.trim(info.msg) msg = _.trim(info.msg)
cancel = _.startsWith(msg, "/") cancel = _.startsWith(msg, "/")
room.last_active_time = moment() unless cancel or not (room.random_type or room.arena) room.last_active_time = moment() unless cancel or not (room.random_type or room.arena) or room.duel_stage == ygopro.constants.DUEL_STAGE.FINGER or room.duel_stage == ygopro.constants.DUEL_STAGE.FIRSTGO or room.duel_stage == ygopro.constants.DUEL_STAGE.SIDING
cmd = msg.split(' ') cmd = msg.split(' ')
switch cmd[0] switch cmd[0]
when '/投降', '/surrender' when '/投降', '/surrender'
...@@ -3682,7 +3682,7 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server, datas)-> ...@@ -3682,7 +3682,7 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server, datas)->
if settings.modules.random_duel.enabled if settings.modules.random_duel.enabled
setInterval ()-> setInterval ()->
for room in ROOM_all when room and room.duel_stage != ygopro.constants.DUEL_STAGE.BEGIN and room.random_type and room.last_active_time and room.waiting_for_player and room.get_disconnected_count() == 0 for room in ROOM_all when room and room.duel_stage != ygopro.constants.DUEL_STAGE.BEGIN and room.random_type and room.last_active_time and room.waiting_for_player and room.get_disconnected_count() == 0 and (!settings.modules.side_timeout or room.duel_stage != ygopro.constants.DUEL_STAGE.SIDING)
time_passed = Math.floor((moment() - room.last_active_time) / 1000) time_passed = Math.floor((moment() - room.last_active_time) / 1000)
#log.info time_passed #log.info time_passed
if time_passed >= settings.modules.random_duel.hang_timeout if time_passed >= settings.modules.random_duel.hang_timeout
...@@ -3701,7 +3701,7 @@ if settings.modules.random_duel.enabled ...@@ -3701,7 +3701,7 @@ if settings.modules.random_duel.enabled
if settings.modules.mycard.enabled if settings.modules.mycard.enabled
setInterval ()-> setInterval ()->
for room in ROOM_all when room and room.duel_stage != ygopro.constants.DUEL_STAGE.BEGIN and room.arena and room.last_active_time and room.waiting_for_player and room.get_disconnected_count() == 0 for room in ROOM_all when room and room.duel_stage != ygopro.constants.DUEL_STAGE.BEGIN and room.arena and room.last_active_time and room.waiting_for_player and room.get_disconnected_count() == 0 and (!settings.modules.side_timeout or room.duel_stage != ygopro.constants.DUEL_STAGE.SIDING)
time_passed = Math.floor((moment() - room.last_active_time) / 1000) time_passed = Math.floor((moment() - room.last_active_time) / 1000)
#log.info time_passed #log.info time_passed
if time_passed >= settings.modules.random_duel.hang_timeout if time_passed >= settings.modules.random_duel.hang_timeout
......
...@@ -4023,7 +4023,7 @@ ...@@ -4023,7 +4023,7 @@
} }
msg = _.trim(info.msg); msg = _.trim(info.msg);
cancel = _.startsWith(msg, "/"); cancel = _.startsWith(msg, "/");
if (!(cancel || !(room.random_type || room.arena))) { if (!(cancel || !(room.random_type || room.arena) || room.duel_stage === ygopro.constants.DUEL_STAGE.FINGER || room.duel_stage === ygopro.constants.DUEL_STAGE.FIRSTGO || room.duel_stage === ygopro.constants.DUEL_STAGE.SIDING)) {
room.last_active_time = moment(); room.last_active_time = moment();
} }
cmd = msg.split(' '); cmd = msg.split(' ');
...@@ -4804,7 +4804,7 @@ ...@@ -4804,7 +4804,7 @@
var len2, m, room, time_passed; var len2, m, room, time_passed;
for (m = 0, len2 = ROOM_all.length; m < len2; m++) { for (m = 0, len2 = ROOM_all.length; m < len2; m++) {
room = ROOM_all[m]; room = ROOM_all[m];
if (!(room && room.duel_stage !== ygopro.constants.DUEL_STAGE.BEGIN && room.random_type && room.last_active_time && room.waiting_for_player && room.get_disconnected_count() === 0)) { if (!(room && room.duel_stage !== ygopro.constants.DUEL_STAGE.BEGIN && room.random_type && room.last_active_time && room.waiting_for_player && room.get_disconnected_count() === 0 && (!settings.modules.side_timeout || room.duel_stage !== ygopro.constants.DUEL_STAGE.SIDING))) {
continue; continue;
} }
time_passed = Math.floor((moment() - room.last_active_time) / 1000); time_passed = Math.floor((moment() - room.last_active_time) / 1000);
...@@ -4828,7 +4828,7 @@ ...@@ -4828,7 +4828,7 @@
var len2, len3, m, n, player, room, time_passed, waited_time; var len2, len3, m, n, player, room, time_passed, waited_time;
for (m = 0, len2 = ROOM_all.length; m < len2; m++) { for (m = 0, len2 = ROOM_all.length; m < len2; m++) {
room = ROOM_all[m]; room = ROOM_all[m];
if (!(room && room.duel_stage !== ygopro.constants.DUEL_STAGE.BEGIN && room.arena && room.last_active_time && room.waiting_for_player && room.get_disconnected_count() === 0)) { if (!(room && room.duel_stage !== ygopro.constants.DUEL_STAGE.BEGIN && room.arena && room.last_active_time && room.waiting_for_player && room.get_disconnected_count() === 0 && (!settings.modules.side_timeout || room.duel_stage !== ygopro.constants.DUEL_STAGE.SIDING))) {
continue; continue;
} }
time_passed = Math.floor((moment() - room.last_active_time) / 1000); time_passed = Math.floor((moment() - room.last_active_time) / 1000);
......
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