From 3625ad8883f3bf36c7c2be8fc27f3561dec12942 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 26 Jun 2021 20:25:38 -0700 Subject: [PATCH] Made clients send keep-alive packets again --- src/pc/network/network_player.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/pc/network/network_player.c b/src/pc/network/network_player.c index db596edd..e87e7055 100644 --- a/src/pc/network/network_player.c +++ b/src/pc/network/network_player.c @@ -98,17 +98,11 @@ void network_player_update(void) { } } } else if (gNetworkType == NT_CLIENT) { - bool connectionAlive = false; struct NetworkPlayer* np = gNetworkPlayerServer; if (!np->connected) { return; } float elapsed = (clock() - np->lastReceived) / (float)CLOCKS_PER_SEC; - if (elapsed <= NETWORK_PLAYER_TIMEOUT * 1.5f) { - connectionAlive = true; - return; - } - - if (!connectionAlive) { + if (elapsed > NETWORK_PLAYER_TIMEOUT * 1.5f) { LOG_INFO("dropping due to no server connectivity"); network_shutdown(); }