Commit 39855b0e authored by nanahira's avatar nanahira

js

parent a1471184
......@@ -1113,11 +1113,15 @@
SOCKET_flush_data = function(sk, datas) {
var buffer, len2, m;
if (!sk || sk.closed) {
return false;
}
for (m = 0, len2 = datas.length; m < len2; m++) {
buffer = datas[m];
sk.write(buffer);
}
datas.splice(0, datas.length);
return true;
};
Room = (function() {
......@@ -3040,19 +3044,26 @@
});
ygopro.stoc_follow('DUEL_END', false, function(buffer, info, client, server, datas) {
var len2, m, player, ref2, results, room;
var len2, len3, m, n, player, ref2, ref3, results, room;
room = ROOM_all[client.rid];
if (!(room && settings.modules.replay_delay && room.hostinfo.mode === 1)) {
return;
}
SOCKET_flush_data(client, datas);
CLIENT_send_replays(client, room);
if (!room.replays_sent_to_watchers) {
if (!room.replays_sent_to_watchers && (client.pos === 0 || !room.dueling_players[0] || room.dueling_players[0].closed)) {
room.replays_sent_to_watchers = true;
ref2 = room.watchers;
results = [];
ref2 = room.players;
for (m = 0, len2 = ref2.length; m < len2; m++) {
player = ref2[m];
if (player && player.pos > 3) {
CLIENT_send_replays(player, room);
}
}
ref3 = room.watchers;
results = [];
for (n = 0, len3 = ref3.length; n < len3; n++) {
player = ref3[n];
if (player) {
results.push(CLIENT_send_replays(player, room));
}
......
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