Commit 3f98a66e authored by nanahira's avatar nanahira

Revert "apply flush data to reconnect for improve"

This reverts commit f3955c2b.
parent 2e7f24b9
......@@ -845,7 +845,7 @@ CLIENT_heartbeat_unregister = (client) ->
return true
CLIENT_heartbeat_register = (client, send) ->
if !settings.modules.heartbeat_detection.enabled or client.closed or client.is_post_watcher or client.pre_reconnecting or client.reconnecting or client.pos > 3 or client.heartbeat_protected
if !settings.modules.heartbeat_detection.enabled or client.closed or client.is_post_watcher or client.pre_reconnecting or client.reconnecting or client.waiting_for_last or client.pos > 3 or client.heartbeat_protected
return false
if client.heartbeat_timeout
CLIENT_heartbeat_unregister(client)
......@@ -2451,15 +2451,13 @@ ygopro.stoc_follow 'HS_PLAYER_CHANGE', false, (buffer, info, client, server, dat
ygopro.ctos_follow 'REQUEST_FIELD', true, (buffer, info, client, server, datas)->
return true
ygopro.stoc_follow 'FIELD_FINISH', true, (buffer, info, client, server, datas)->
ygopro.stoc_follow 'FIELD_FINISH', true, (buffer, info, client, server)->
room=ROOM_all[client.rid]
return true unless room and settings.modules.reconnect.enabled
client.reconnecting = false
#if client.time_confirm_required # client did not send TIME_CONFIRM
# client.waiting_for_last = true
#else
if client.last_game_msg and client.last_game_msg_title != 'WAITING' # client sent TIME_CONFIRM
SOCKET_flush_data(client, datas)
if client.time_confirm_required # client did not send TIME_CONFIRM
client.waiting_for_last = true
else if client.last_game_msg and client.last_game_msg_title != 'WAITING' # client sent TIME_CONFIRM
if client.last_hint_msg
ygopro.stoc_send(client, 'GAME_MSG', client.last_hint_msg)
ygopro.stoc_send(client, 'GAME_MSG', client.last_game_msg)
......@@ -2923,12 +2921,12 @@ ygopro.ctos_follow 'TIME_CONFIRM', false, (buffer, info, client, server, datas)-
room=ROOM_all[client.rid]
return unless room
if settings.modules.reconnect.enabled
#if client.waiting_for_last
# client.waiting_for_last = false
# if client.last_game_msg and client.last_game_msg_title != 'WAITING'
# if client.last_hint_msg
# ygopro.stoc_send(client, 'GAME_MSG', client.last_hint_msg)
# ygopro.stoc_send(client, 'GAME_MSG', client.last_game_msg)
if client.waiting_for_last
client.waiting_for_last = false
if client.last_game_msg and client.last_game_msg_title != 'WAITING'
if client.last_hint_msg
ygopro.stoc_send(client, 'GAME_MSG', client.last_hint_msg)
ygopro.stoc_send(client, 'GAME_MSG', client.last_game_msg)
client.time_confirm_required = false
if settings.modules.heartbeat_detection.enabled
client.heartbeat_protected = false
......
......@@ -1090,7 +1090,7 @@
};
CLIENT_heartbeat_register = function(client, send) {
if (!settings.modules.heartbeat_detection.enabled || client.closed || client.is_post_watcher || client.pre_reconnecting || client.reconnecting || client.pos > 3 || client.heartbeat_protected) {
if (!settings.modules.heartbeat_detection.enabled || client.closed || client.is_post_watcher || client.pre_reconnecting || client.reconnecting || client.waiting_for_last || client.pos > 3 || client.heartbeat_protected) {
return false;
}
if (client.heartbeat_timeout) {
......@@ -3051,15 +3051,16 @@
return true;
});
ygopro.stoc_follow('FIELD_FINISH', true, function(buffer, info, client, server, datas) {
ygopro.stoc_follow('FIELD_FINISH', true, function(buffer, info, client, server) {
var room;
room = ROOM_all[client.rid];
if (!(room && settings.modules.reconnect.enabled)) {
return true;
}
client.reconnecting = false;
if (client.last_game_msg && client.last_game_msg_title !== 'WAITING') {
SOCKET_flush_data(client, datas);
if (client.time_confirm_required) {
client.waiting_for_last = true;
} else if (client.last_game_msg && client.last_game_msg_title !== 'WAITING') {
if (client.last_hint_msg) {
ygopro.stoc_send(client, 'GAME_MSG', client.last_hint_msg);
}
......@@ -3711,6 +3712,15 @@
return;
}
if (settings.modules.reconnect.enabled) {
if (client.waiting_for_last) {
client.waiting_for_last = false;
if (client.last_game_msg && client.last_game_msg_title !== 'WAITING') {
if (client.last_hint_msg) {
ygopro.stoc_send(client, 'GAME_MSG', client.last_hint_msg);
}
ygopro.stoc_send(client, 'GAME_MSG', client.last_game_msg);
}
}
client.time_confirm_required = false;
}
if (settings.modules.heartbeat_detection.enabled) {
......
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