1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Improve timeout calculation

gf
This commit is contained in:
sapier 2014-07-12 15:58:08 +02:00
parent 944ffe9e53
commit 247a1ebf23
3 changed files with 31 additions and 19 deletions

View file

@ -162,16 +162,19 @@ inline bool seqnum_in_window(u16 seqnum, u16 next,u16 window_size)
struct BufferedPacket
{
BufferedPacket(u8 *a_data, u32 a_size):
data(a_data, a_size), time(0.0), totaltime(0.0), absolute_send_time(-1)
data(a_data, a_size), time(0.0), totaltime(0.0), absolute_send_time(-1),
resend_count(0)
{}
BufferedPacket(u32 a_size):
data(a_size), time(0.0), totaltime(0.0), absolute_send_time(-1)
data(a_size), time(0.0), totaltime(0.0), absolute_send_time(-1),
resend_count(0)
{}
SharedBuffer<u8> data; // Data of the packet, including headers
float time; // Seconds from buffering the packet or re-sending
float totaltime; // Seconds from buffering the packet
unsigned int absolute_send_time;
Address address; // Sender or destination
unsigned int resend_count;
};
// This adds the base headers to the data and makes a packet out of it