RemoteISOScreen: Don't check "allowed" every frame.

This commit is contained in:
Henrik Rydgård
2025-08-26 10:12:05 +02:00
parent 18ccef1bd4
commit 3680bb17d3
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -291,13 +291,16 @@ void RemoteISOScreen::CreateTabs() {
void RemoteISOScreen::update() {
TabbedUIDialogScreenWithGameBackground::update();
if (!WebServerStopped(WebServerFlags::DISCS)) {
frameCount_++;
if (!WebServerStopped(WebServerFlags::DISCS) && frameCount_ > 60) {
auto result = IsServerAllowed(g_Config.iRemoteISOPort);
if (result == ServerAllowStatus::NO) {
firewallWarning_->SetVisibility(V_VISIBLE);
} else if (result == ServerAllowStatus::YES) {
firewallWarning_->SetVisibility(V_GONE);
}
frameCount_ = 0;
}
bool nowRunning = !WebServerStopped(WebServerFlags::DISCS);
@@ -422,6 +425,7 @@ UI::EventReturn RemoteISOScreen::OnChangeRemoteISOSubdir(UI::EventParams &e) {
}
UI::EventReturn RemoteISOScreen::HandleStartServer(UI::EventParams &e) {
frameCount_ = 0;
if (!StartWebServer(WebServerFlags::DISCS)) {
return EVENT_SKIPPED;
}
+2
View File
@@ -49,6 +49,8 @@ protected:
UI::TextView *firewallWarning_ = nullptr;
bool serverRunning_ = false;
bool serverStopping_ = false;
int frameCount_ = 0;
};
enum class ScanStatus {