[Netcode] Resend Logic Adjustments (#4895)

* [Netcode] Resend Logic Adjustments

* Update daybreak_connection.h
This commit is contained in:
Chris Miles 2025-05-16 16:46:07 -05:00 committed by GitHub
parent 907029ed76
commit a1d414d64c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 21 deletions

View File

@ -1130,20 +1130,6 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
Close(); Close();
return; return;
} }
// make sure that the first_packet in the list first_sent time is within the resend_delay and now
// if it is not, then we need to resend all packets in the list
if (time_since_first_sent <= first_packet.resend_delay && !m_acked_since_last_resend) {
LogNetClient(
"Not resending packets for stream [{}] packets [{}] time_first_sent [{}] resend_delay [{}] m_acked_since_last_resend [{}]",
stream,
s->sent_packets.size(),
time_since_first_sent,
first_packet.resend_delay,
m_acked_since_last_resend
);
return;
}
} }
if (LogSys.IsLogEnabled(Logs::Detail, Logs::Netcode)) { if (LogSys.IsLogEnabled(Logs::Detail, Logs::Netcode)) {
@ -1153,11 +1139,10 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
} }
LogNetClient( LogNetClient(
"Resending packets for stream [{}] packet count [{}] total packet size [{}] m_acked_since_last_resend [{}]", "Resending packets for stream [{}] packet count [{}] total packet size [{}]",
stream, stream,
s->sent_packets.size(), s->sent_packets.size(),
total_size, total_size
m_acked_since_last_resend
); );
} }
@ -1202,8 +1187,6 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
m_owner->m_options.resend_delay_max m_owner->m_options.resend_delay_max
); );
} }
m_acked_since_last_resend = false;
} }
void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq) void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq)
@ -1224,7 +1207,6 @@ void EQ::Net::DaybreakConnection::Ack(int stream, uint16_t seq)
m_rolling_ping = (m_rolling_ping * 2 + round_time) / 3; m_rolling_ping = (m_rolling_ping * 2 + round_time) / 3;
iter = s->sent_packets.erase(iter); iter = s->sent_packets.erase(iter);
m_acked_since_last_resend = true;
} }
else { else {
++iter; ++iter;

View File

@ -185,7 +185,6 @@ namespace EQ
// resend tracking // resend tracking
size_t m_resend_packets_sent = 0; size_t m_resend_packets_sent = 0;
size_t m_resend_bytes_sent = 0; size_t m_resend_bytes_sent = 0;
bool m_acked_since_last_resend = false;
struct DaybreakSentPacket struct DaybreakSentPacket
{ {