mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 12:05:11 +00:00
Made clients send keep-alive packets again
This commit is contained in:
parent
6c687a5a73
commit
3625ad8883
1 changed files with 1 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue