mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-21 19:45:10 +00:00
Increase max resend attempts for the initial packet
This commit is contained in:
parent
7ee00a12a8
commit
242740fbf5
1 changed files with 4 additions and 1 deletions
|
@ -157,6 +157,7 @@ void network_update_reliable(void) {
|
|||
f32 elapsed = (clock_elapsed() - node->lastSend);
|
||||
f32 maxElapsed = get_max_elapsed_time(node->sendAttempts);
|
||||
maxElapsed = adjust_max_elapsed(node->p.packetType, maxElapsed);
|
||||
if (maxElapsed > 3) { maxElapsed = 3; }
|
||||
|
||||
// adjust resend time based on ping
|
||||
struct NetworkPlayer* np = &gNetworkPlayers[node->p.localIndex];
|
||||
|
@ -175,7 +176,9 @@ void network_update_reliable(void) {
|
|||
|
||||
node->lastSend = clock_elapsed();
|
||||
node->sendAttempts++;
|
||||
if (node->sendAttempts >= MAX_RESEND_ATTEMPTS) {
|
||||
|
||||
int maxResendAttempts = node->p.packetType == PACKET_MOD_LIST_REQUEST ? 60 : MAX_RESEND_ATTEMPTS;
|
||||
if (node->sendAttempts >= maxResendAttempts) {
|
||||
struct PacketLinkedList* next = node->next;
|
||||
remove_node_from_list(node);
|
||||
node = next;
|
||||
|
|
Loading…
Reference in a new issue