Commit 940a74f2 authored by nanahira's avatar nanahira

no ban when disconnect quit

no ban when disconnect quit
parent 7e5b710c
......@@ -480,7 +480,7 @@ CLIENT_reconnect_register = (client, room_id, error) ->
room = ROOM_all[room_id]
if client.had_new_reconnection
return false
if !settings.modules.reconnect.enabled or !room or client.system_kicked or client.flee_free or disconnect_list[CLIENT_get_authorize_key(client)] or client.is_post_watcher or !CLIENT_is_player(client, room) or !room.started or room.windbot or (settings.modules.reconnect.auto_surrender_after_disconnect and room.hostinfo.mode != 1) or (room.random_type and room.max_player and room.get_disconnected_count() >= room.max_player - 1)
if !settings.modules.reconnect.enabled or !room or client.system_kicked or client.flee_free or disconnect_list[CLIENT_get_authorize_key(client)] or client.is_post_watcher or !CLIENT_is_player(client, room) or !room.started or room.windbot or (settings.modules.reconnect.auto_surrender_after_disconnect and room.hostinfo.mode != 1) or (room.random_type and room.get_disconnected_count() > 0)
return false
# for player in room.players
# if player != client and CLIENT_get_authorize_key(player) == CLIENT_get_authorize_key(client)
......@@ -1058,7 +1058,7 @@ class Room
if @started and @disconnector != 'server' and client.pos < 4
@finished = true
@scores[client.name] = -9
if @random_type and not client.flee_free
if @random_type and not client.flee_free and (!settings.modules.reconnect.enabled or @get_disconnected_count() == 0)
ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}")
if @players.length and !(@windbot and client.is_host) and !(@arena and !@started and client.pos <= 3)
ygopro.stoc_send_chat_to_room this, "#{client.name} ${left_game}" + if error then ": #{error}" else ''
......
......@@ -622,7 +622,7 @@
if (client.had_new_reconnection) {
return false;
}
if (!settings.modules.reconnect.enabled || !room || client.system_kicked || client.flee_free || disconnect_list[CLIENT_get_authorize_key(client)] || client.is_post_watcher || !CLIENT_is_player(client, room) || !room.started || room.windbot || (settings.modules.reconnect.auto_surrender_after_disconnect && room.hostinfo.mode !== 1) || (room.random_type && room.max_player && room.get_disconnected_count() >= room.max_player - 1)) {
if (!settings.modules.reconnect.enabled || !room || client.system_kicked || client.flee_free || disconnect_list[CLIENT_get_authorize_key(client)] || client.is_post_watcher || !CLIENT_is_player(client, room) || !room.started || room.windbot || (settings.modules.reconnect.auto_surrender_after_disconnect && room.hostinfo.mode !== 1) || (room.random_type && room.get_disconnected_count() > 0)) {
return false;
}
dinfo = {
......@@ -1380,7 +1380,7 @@
if (this.started && this.disconnector !== 'server' && client.pos < 4) {
this.finished = true;
this.scores[client.name] = -9;
if (this.random_type && !client.flee_free) {
if (this.random_type && !client.flee_free && (!settings.modules.reconnect.enabled || this.get_disconnected_count() === 0)) {
ROOM_ban_player(client.name, client.ip, "${random_ban_reason_flee}");
}
}
......
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