check if you get stuck while spectating. if this is the case try to disconnect.

This commit is contained in:
Jamie Meyer 2023-07-08 13:56:09 +02:00
parent ad39c921c8
commit ee28e7d8d0
No known key found for this signature in database
GPG Key ID: BF30D71B2F1305C7
1 changed files with 2 additions and 1 deletions

View File

@ -1971,12 +1971,13 @@ void Netplay::RunFrame()
if (GGPO_SUCCEEDED(result))
{
result = SyncInput(inputs, &disconnect_flags);
// check if you get stuck while spectating. if this is the case try to disconnect.
if (s_local_spectating && result != GGPO_OK)
{
s_spectating_failed_count++;
// after 5 seconds and still not spectating close since you are stuck.
if (s_spectating_failed_count >= 300)
CloseSessionWithError("Failed to sync spectator. Please try again.");
CloseSessionWithError("Failed to sync spectator with host. Please try again.");
}
if (GGPO_SUCCEEDED(result))