Commit 738ca937 authored by nanahira's avatar nanahira

fix death kick ban

parent 940a74f2
......@@ -1057,9 +1057,10 @@ class Room
@players.splice(index, 1) unless index == -1
if @started and @disconnector != 'server' and client.pos < 4
@finished = true
@scores[client.name] = -9
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 !@finished_by_death
@scores[client.name] = -9
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 ''
roomlist.update(this) if !@windbot and !@started and settings.modules.http.websocket_roomlist
......@@ -1905,6 +1906,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server)->
win_pos = if room.dueling_players[0].lp > room.dueling_players[oppo_pos].lp then 0 else oppo_pos
ygopro.stoc_send_chat_to_room(room, "${death_finish_part1}" + room.dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE)
if room.hostinfo.mode == 2
room.finished_by_death = true
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END')
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos + 1], 'DUEL_END')
room.scores[room.dueling_players[oppo_pos - win_pos].name] = -1
......@@ -1929,6 +1931,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server)->
win_pos = if room.dueling_players[0].lp > room.dueling_players[oppo_pos].lp then 0 else oppo_pos
ygopro.stoc_send_chat_to_room(room, "${death_finish_part1}" + room.dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE)
if room.hostinfo.mode == 2
room.finished_by_death = true
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END')
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos + 1], 'DUEL_END')
room.scores[room.dueling_players[oppo_pos - win_pos].name] = -1
......@@ -2556,6 +2559,7 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
oppo_pos = if room.hostinfo.mode == 2 then 2 else 1
if settings.modules.http.quick_death_rule >= 2 and room.started and room.death and room.scores[room.dueling_players[0].name] != room.scores[room.dueling_players[oppo_pos].name]
win_pos = if room.scores[room.dueling_players[0].name] > room.scores[room.dueling_players[oppo_pos].name] then 0 else oppo_pos
room.finished_by_death = true
ygopro.stoc_send_chat_to_room(room, "${death2_finish_part1}" + room.dueling_players[win_pos].name + "${death2_finish_part2}", ygopro.constants.COLORS.BABYBLUE)
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END')
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos + 1], 'DUEL_END') if room.hostinfo.mode == 2
......@@ -3093,6 +3097,7 @@ if settings.modules.http
ygopro.stoc_send_chat_to_room(room, "${death_start_siding}", ygopro.constants.COLORS.BABYBLUE)
else
win_pos = if room.scores[room.dueling_players[0].name] > room.scores[room.dueling_players[oppo_pos].name] then 0 else oppo_pos
room.finished_by_death = true
ygopro.stoc_send_chat_to_room(room, "${death2_finish_part1}" + room.dueling_players[win_pos].name + "${death2_finish_part2}", ygopro.constants.COLORS.BABYBLUE)
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END')
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos + 1], 'DUEL_END') if room.hostinfo.mode == 2
......
......@@ -1379,9 +1379,11 @@
}
if (this.started && this.disconnector !== 'server' && client.pos < 4) {
this.finished = true;
this.scores[client.name] = -9;
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}");
if (!this.finished_by_death) {
this.scores[client.name] = -9;
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}");
}
}
}
if (this.players.length && !(this.windbot && client.is_host) && !(this.arena && !this.started && client.pos <= 3)) {
......@@ -2315,6 +2317,7 @@
win_pos = room.dueling_players[0].lp > room.dueling_players[oppo_pos].lp ? 0 : oppo_pos;
ygopro.stoc_send_chat_to_room(room, "${death_finish_part1}" + room.dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE);
if (room.hostinfo.mode === 2) {
room.finished_by_death = true;
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END');
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos + 1], 'DUEL_END');
room.scores[room.dueling_players[oppo_pos - win_pos].name] = -1;
......@@ -2345,6 +2348,7 @@
win_pos = room.dueling_players[0].lp > room.dueling_players[oppo_pos].lp ? 0 : oppo_pos;
ygopro.stoc_send_chat_to_room(room, "${death_finish_part1}" + room.dueling_players[win_pos].name + "${death_finish_part2}", ygopro.constants.COLORS.BABYBLUE);
if (room.hostinfo.mode === 2) {
room.finished_by_death = true;
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END');
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos + 1], 'DUEL_END');
room.scores[room.dueling_players[oppo_pos - win_pos].name] = -1;
......@@ -3206,6 +3210,7 @@
oppo_pos = room.hostinfo.mode === 2 ? 2 : 1;
if (settings.modules.http.quick_death_rule >= 2 && room.started && room.death && room.scores[room.dueling_players[0].name] !== room.scores[room.dueling_players[oppo_pos].name]) {
win_pos = room.scores[room.dueling_players[0].name] > room.scores[room.dueling_players[oppo_pos].name] ? 0 : oppo_pos;
room.finished_by_death = true;
ygopro.stoc_send_chat_to_room(room, "${death2_finish_part1}" + room.dueling_players[win_pos].name + "${death2_finish_part2}", ygopro.constants.COLORS.BABYBLUE);
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END');
if (room.hostinfo.mode === 2) {
......@@ -3942,6 +3947,7 @@
}
} else {
win_pos = room.scores[room.dueling_players[0].name] > room.scores[room.dueling_players[oppo_pos].name] ? 0 : oppo_pos;
room.finished_by_death = true;
ygopro.stoc_send_chat_to_room(room, "${death2_finish_part1}" + room.dueling_players[win_pos].name + "${death2_finish_part2}", ygopro.constants.COLORS.BABYBLUE);
ygopro.stoc_send(room.dueling_players[oppo_pos - win_pos], 'DUEL_END');
if (room.hostinfo.mode === 2) {
......
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