From a487978e3d915d26f084aa13684eceef2b63c14c Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 4 Jun 2022 00:52:38 -0700 Subject: [PATCH] Prevent client from sending sync valid packets improperly --- src/pc/network/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pc/network/network.c b/src/pc/network/network.c index b3da7fa2..431fdd2f 100644 --- a/src/pc/network/network.c +++ b/src/pc/network/network.c @@ -432,14 +432,14 @@ void network_update(void) { struct NetworkPlayer* np = gNetworkPlayerLocal; if (np != NULL && !np->currLevelSyncValid) { gNetworkRequestLocationTimer++; - if (gNetworkRequestLocationTimer > 90) { + if (gNetworkRequestLocationTimer > 30 * 10) { // find a NetworkPlayer around that location struct NetworkPlayer *npLevelAreaMatch = get_network_player_from_area(np->currCourseNum, np->currActNum, np->currLevelNum, np->currAreaIndex); struct NetworkPlayer *npLevelMatch = get_network_player_from_level(np->currCourseNum, np->currActNum, np->currLevelNum); struct NetworkPlayer *npAny = (npLevelAreaMatch == NULL) ? npLevelMatch : npLevelAreaMatch; bool inCredits = (np->currActNum == 99); - if (npAny == NULL || inCredits) { + if (gNetworkType == NT_SERVER && (npAny == NULL || inCredits)) { // no NetworkPlayer in the level network_send_sync_valid(np, np->currCourseNum, np->currActNum, np->currLevelNum, np->currAreaIndex); return;