Server makes sure the client can receive the packet before sending/tunnelling
This commit is contained in:
parent
59d08a90b9
commit
518a1fda4b
|
@ -118,6 +118,17 @@ void network_send_to(u8 localIndex, struct Packet* p) {
|
||||||
assert(localIndex != gNetworkPlayerLocal->localIndex);
|
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
|
// set the flags again
|
||||||
packet_set_flags(p);
|
packet_set_flags(p);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue