Commit 18e3dc59 authored by mercury233's avatar mercury233

fix watch leave

parent ce5b7b96
...@@ -573,7 +573,7 @@ class Room ...@@ -573,7 +573,7 @@ class Room
index = _.indexOf(@players, client) index = _.indexOf(@players, client)
@players.splice(index, 1) unless index == -1 @players.splice(index, 1) unless index == -1
#log.info(@started,@disconnector,@random_type) #log.info(@started,@disconnector,@random_type)
if @started and @disconnector != 'server' and @random_type if @started and @disconnector != 'server' and @random_type and (client.pos < 4 or client.is_host)
ROOM_ban_player(client.name, client.ip, "强退") ROOM_ban_player(client.name, client.ip, "强退")
if @players.length and !(@windbot and client.is_host) if @players.length and !(@windbot and client.is_host)
ygopro.stoc_send_chat_to_room this, "#{client.name} 离开了游戏" + if error then ": #{error}" else '' ygopro.stoc_send_chat_to_room this, "#{client.name} 离开了游戏" + if error then ": #{error}" else ''
......
...@@ -759,7 +759,7 @@ ...@@ -759,7 +759,7 @@
if (index !== -1) { if (index !== -1) {
this.players.splice(index, 1); this.players.splice(index, 1);
} }
if (this.started && this.disconnector !== 'server' && this.random_type) { if (this.started && this.disconnector !== 'server' && this.random_type && (client.pos < 4 || client.is_host)) {
ROOM_ban_player(client.name, client.ip, "强退"); ROOM_ban_player(client.name, client.ip, "强退");
} }
if (this.players.length && !(this.windbot && client.is_host)) { if (this.players.length && !(this.windbot && client.is_host)) {
......
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