Set PSN to disconnected when net status is disconnected

This commit is contained in:
RipleyTom 2025-03-25 15:28:04 +01:00
parent c52920755a
commit cb65d8f4b1
No known key found for this signature in database
GPG key ID: FC2B5DEF76BF4CC8
3 changed files with 17 additions and 1 deletions

View file

@ -858,7 +858,7 @@ namespace np
presence_self.pr_data = {};
presence_self.advertised = false;
if (g_cfg.net.psn_status == np_psn_status::psn_rpcn)
if (is_connected && is_psn_active && rpcn)
{
rpcn_log.notice("Setting RPCN state to disconnected!");
rpcn->reset_state();

View file

@ -303,6 +303,12 @@ static void fixup_settings(const psf::registry* _psf)
g_cfg.video.resolution.set(new_resolution);
}
}
if (g_cfg.net.net_active == np_internet_status::disabled && g_cfg.net.psn_status != np_psn_status::disabled)
{
sys_log.warning("Net status was set to disconnected so psn status was disabled");
g_cfg.net.psn_status.set(np_psn_status::disabled);
}
}
extern void dump_executable(std::span<const u8> data, const ppu_module<lv2_obj>* _module, std::string_view title_id)

View file

@ -1481,6 +1481,16 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
const auto [text, value] = get_data(ui->netStatusBox, index);
ui->gb_edit_dns->setEnabled(static_cast<np_internet_status>(value) != np_internet_status::disabled);
ui->enable_upnp->setEnabled(static_cast<np_internet_status>(value) != np_internet_status::disabled);
if (static_cast<np_internet_status>(value) == np_internet_status::disabled)
{
ui->psnStatusBox->setCurrentIndex(find_item(ui->psnStatusBox, static_cast<int>(g_cfg.net.psn_status.def)));
ui->psnStatusBox->setEnabled(false);
}
else
{
ui->psnStatusBox->setEnabled(true);
}
});
m_emu_settings->EnhanceComboBox(ui->netStatusBox, emu_settings_type::InternetStatus);
SubscribeTooltip(ui->gb_netStatusBox, tooltips.settings.net_status);