mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-23 08:02:07 -05:00
Drop all reliable packets that are going to someone that disconnected
This commit is contained in:
parent
58914e993f
commit
61ed5a774c
3 changed files with 14 additions and 0 deletions
|
@ -313,6 +313,7 @@ u8 network_player_disconnected(u8 globalIndex) {
|
|||
np->currLevelSyncValid = false;
|
||||
np->currAreaSyncValid = false;
|
||||
gNetworkSystem->clear_id(i);
|
||||
network_forget_all_reliable_from(i);
|
||||
for (int j = 0; j < MAX_SYNC_OBJECTS; j++) { gSyncObjects[j].rxEventId[i] = 0; }
|
||||
LOG_INFO("player disconnected, local %d, global %d", i, globalIndex);
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ void packet_set_ordered_data(struct Packet* packet);
|
|||
|
||||
// packet_reliable.c
|
||||
void network_forget_all_reliable(void);
|
||||
void network_forget_all_reliable_from(u8 localIndex);
|
||||
void network_send_ack(struct Packet* p);
|
||||
void network_receive_ack(struct Packet* p);
|
||||
void network_remember_reliable(struct Packet* p);
|
||||
|
|
|
@ -38,6 +38,18 @@ void network_forget_all_reliable(void) {
|
|||
while (head != NULL) { remove_node_from_list(head); }
|
||||
}
|
||||
|
||||
void network_forget_all_reliable_from(u8 localIndex) {
|
||||
if (localIndex == 0) { return; }
|
||||
struct PacketLinkedList* node = head;
|
||||
while (node != NULL) {
|
||||
struct PacketLinkedList* next = node->next;
|
||||
if (node->p.localIndex == localIndex) {
|
||||
remove_node_from_list(node);
|
||||
}
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
||||
void network_send_ack(struct Packet* p) {
|
||||
// grab seq num
|
||||
u16 seqId = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue