Commit 6d2b3034 authored by mercury233's avatar mercury233

wtf fix

parent eed00ad6
......@@ -455,7 +455,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
ygopro.ctos_follow 'HS_KICK', true, (buffer, info, client, server)->
return unless client.room
for player in client.room.players
if player.pos==info.pos and player != client
if player and player.pos==info.pos and player != client
ygopro.stoc_send_chat_to_room client.room, "#{player.name} 被请出了房间", 11
return false
......@@ -609,7 +609,7 @@ ygopro.stoc_follow 'SELECT_TP', false, (buffer, info, client, server)->
return
setInterval ()->
for room in Room.all when room and room.started and room.random_type and room.last_active_time
for room in Room.all when room and room.started and room.random_type and room.last_active_time and room.waiting_for_player
time_passed=Math.floor((moment()-room.last_active_time) / 1000)
#log.info time_passed
if time_passed >= settings.modules.hang_timeout
......
......@@ -500,7 +500,7 @@
ref = client.room.players;
for (k = 0, len = ref.length; k < len; k++) {
player = ref[k];
if (player.pos === info.pos && player !== client) {
if (player && player.pos === info.pos && player !== client) {
ygopro.stoc_send_chat_to_room(client.room, player.name + " 被请出了房间", 11);
}
}
......@@ -739,7 +739,7 @@
ref = Room.all;
for (k = 0, len = ref.length; k < len; k++) {
room = ref[k];
if (!(room && room.started && room.random_type && room.last_active_time)) {
if (!(room && room.started && room.random_type && room.last_active_time && room.waiting_for_player)) {
continue;
}
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