Made clients send keep-alive packets again

This commit is contained in:
MysterD 2021-06-26 20:25:38 -07:00
parent 6c687a5a73
commit 3625ad8883
1 changed files with 1 additions and 7 deletions

View File

@ -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();
}