Workaround to prevent some games from not retrying to connect on non-Windows system. This will also make a more cross-platform behavior on Windows/Linux/BSD

This commit is contained in:
ANR2ME 2021-10-05 23:07:05 +07:00
parent 00a0885509
commit c34efa3e3e

View file

@ -3615,9 +3615,13 @@ int NetAdhocPtp_Connect(int id, int timeout, int flag, bool allowForcedConnect)
return hleLogDebug(SCENET, ERROR_NET_ADHOC_WOULD_BLOCK, "would block");
}
}
// No connection could be made because the target device actively refused it.
// No connection could be made because the target device actively refused it (on Windows/Linux/Android), or no one listening on the remote address (on Linux/Android).
else if (errorcode == ECONNREFUSED) {
return hleLogError(SCENET, ERROR_NET_ADHOC_CONNECTION_REFUSED, "connection refused");
// Workaround for ERROR_NET_ADHOC_CONNECTION_REFUSED to be more cross-platform, since there is no way to simulate ERROR_NET_ADHOC_CONNECTION_REFUSED properly on Windows
if (flag)
return hleLogError(SCENET, ERROR_NET_ADHOC_WOULD_BLOCK, "connection refused workaround");
else
return hleLogError(SCENET, ERROR_NET_ADHOC_TIMEOUT, "connection refused workaround");
}
}
}