Commit b65f471f authored by nanahira's avatar nanahira

improve

parent 94601b6a
......@@ -372,6 +372,7 @@ ban_user = (name) ->
ROOM_bad_ip[bad_ip]=99
settings.ban.banned_ip.push(player.ip)
ygopro.stoc_send_chat_to_room(room, "#{player.name} ${kicked_by_system}", ygopro.constants.COLORS.RED)
CLIENT_send_replays(player, room)
CLIENT_kick(player)
continue
return
......@@ -1026,6 +1027,7 @@ class Room
@has_ygopro_error = true
@ygopro_error_length = if @ygopro_error_length then @ygopro_error_length + data.length else data.length
if @ygopro_error_length > 10000
@send_replays()
@process.kill()
return
catch
......@@ -1194,6 +1196,14 @@ class Room
challonge_duel_log.scoresCsv = "0-0"
return challonge_duel_log
send_replays: () ->
return false unless settings.modules.replay_delay and @replays.length and @hostinfo.mode == 1
for player in @players
CLIENT_send_replays(player, this)
for player in @watchers
CLIENT_send_replays(player, this)
return true
add_windbot: (botdata)->
@windbot = botdata
request
......@@ -1260,6 +1270,7 @@ class Room
roomlist.update(this) if !@windbot and !@started and settings.modules.http.websocket_roomlist
#client.room = null
else
@send_replays()
@process.kill()
#client.room = null
this.delete()
......@@ -3314,6 +3325,7 @@ if settings.modules.http
room.scores[room.dueling_players[0].name_vpass] = 0
room.scores[room.dueling_players[1].name_vpass] = 0
room.kicked = true
@send_replays()
room.process.kill()
room.delete()
response.writeHead(200)
......
......@@ -430,6 +430,7 @@
ROOM_bad_ip[bad_ip] = 99;
settings.ban.banned_ip.push(player.ip);
ygopro.stoc_send_chat_to_room(room, player.name + " ${kicked_by_system}", ygopro.constants.COLORS.RED);
CLIENT_send_replays(player, room);
CLIENT_kick(player);
continue;
}
......@@ -1309,6 +1310,7 @@
_this.has_ygopro_error = true;
_this.ygopro_error_length = _this.ygopro_error_length ? _this.ygopro_error_length + data.length : data.length;
if (_this.ygopro_error_length > 10000) {
_this.send_replays();
_this.process.kill();
}
};
......@@ -1544,6 +1546,24 @@
return challonge_duel_log;
};
Room.prototype.send_replays = function() {
var len2, len3, m, n, player, ref2, ref3;
if (!(settings.modules.replay_delay && this.replays.length && this.hostinfo.mode === 1)) {
return false;
}
ref2 = this.players;
for (m = 0, len2 = ref2.length; m < len2; m++) {
player = ref2[m];
CLIENT_send_replays(player, this);
}
ref3 = this.watchers;
for (n = 0, len3 = ref3.length; n < len3; n++) {
player = ref3[n];
CLIENT_send_replays(player, this);
}
return true;
};
Room.prototype.add_windbot = function(botdata) {
this.windbot = botdata;
request({
......@@ -1635,6 +1655,7 @@
roomlist.update(this);
}
} else {
this.send_replays();
this.process.kill();
this["delete"]();
}
......@@ -4231,6 +4252,7 @@
room.scores[room.dueling_players[1].name_vpass] = 0;
}
room.kicked = true;
this.send_replays();
room.process.kill();
room["delete"]();
}
......
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