Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CFlashMenuObject::UpdateNetwork #111

Merged
merged 4 commits into from
Oct 29, 2023

Conversation

ccomrade
Copy link
Member

@ccomrade ccomrade commented Oct 29, 2023

Remove CFlashMenuObject::UpdateNetwork function, which calls setNetwork Flash function on frame. Does it actually do something other than showing no connection symbol in multiplayer lobby? @griseraner

Update: Use our own ServerBrowser::LastRequestSucceeded instead of problematic INetwork::HasNetworkConnectivity.

This fixes no connection symbol always shown in multiplayer lobby under Linux 馃惂, where INetwork::HasNetworkConnectivity always returns false when there's no recent network channel activity. In this case, it does some questionable checks of network adapters via Windows API. Definitely not something we want in main thread.

INetwork::HasNetworkConnectivity is also called on frame in CHUD::OnPostUpdate, but that one should be fine because it's called only in-game and only when gEnv->bMultiplayer is true. Therefore, network channel activity is there and it returns quickly without calling potentially blocking Windows API functions.

Thanks to Furyaner for pointing out that INetwork::HasNetworkConnectivity is the culprit here. 馃檪

@ccomrade ccomrade changed the title Remove CFlashMenuObject::UpdateNetwork Improve CFlashMenuObject::UpdateNetwork Oct 29, 2023
@ccomrade
Copy link
Member Author

Now multiplayer lobby shows no connection symbol when server browser request fails. This is more reliable than network adapter checks in INetwork::HasNetworkConnectivity because connected network adapter does not mean that we have internet connection or that master server is available.

@ccomrade ccomrade merged commit a9ef6dc into master Oct 29, 2023
3 checks passed
@ccomrade ccomrade deleted the feature/remove-menu-update-network branch October 29, 2023 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants