mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Server makes sure the client can receive the packet before sending/tunnelling
This commit is contained in:
parent
59d08a90b9
commit
518a1fda4b
1 changed files with 11 additions and 0 deletions
|
|
@ -118,6 +118,17 @@ void network_send_to(u8 localIndex, struct Packet* p) {
|
|||
assert(localIndex != gNetworkPlayerLocal->localIndex);
|
||||
}
|
||||
|
||||
if (gNetworkType == NT_SERVER) {
|
||||
struct NetworkPlayer* np = &gNetworkPlayers[localIndex];
|
||||
// don't send a packet to a player that can't receive it
|
||||
if (p->levelAreaMustMatch) {
|
||||
if (p->courseNum != np->currCourseNum) { return; }
|
||||
if (p->actNum != np->currActNum) { return; }
|
||||
if (p->levelNum != np->currLevelNum) { return; }
|
||||
if (p->areaIndex != np->currAreaIndex) { return; }
|
||||
}
|
||||
}
|
||||
|
||||
// set the flags again
|
||||
packet_set_flags(p);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue