Skip to content

Commit

Permalink
Force NetPlay Clients to Host Hardcore Status
Browse files Browse the repository at this point in the history
If the host is in hardcore mode, all joining players will be set to hardcore mode; if not, all joining players will be set to softcore.
  • Loading branch information
LillyJadeKatrin committed Oct 27, 2024
1 parent d4e32ec commit df1e72f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "Common/Config/Config.h"
#include "Common/FileUtil.h"

#include "Core/AchievementManager.h"
#include "Core/Config/AchievementSettings.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/SYSCONFSettings.h"
Expand Down Expand Up @@ -146,6 +148,9 @@ class NetPlayConfigLayerLoader final : public Config::ConfigLayerLoader
}
#endif

Config::SetBaseOrCurrent(Config::RA_HARDCORE_ENABLED, m_settings.enable_hardcore);
AchievementManager::GetInstance().SetHardcoreMode();

// Check To Override Client's Cheat Codes
if (m_settings.sync_codes && !m_settings.is_hosting)
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/NetPlayClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ void NetPlayClient::OnStartGame(sf::Packet& packet)
packet >> m_net_settings.cpu_thread;
packet >> m_net_settings.cpu_core;
packet >> m_net_settings.enable_cheats;
packet >> m_net_settings.enable_hardcore;
packet >> m_net_settings.selected_language;
packet >> m_net_settings.override_region_settings;
packet >> m_net_settings.dsp_enable_jit;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/NetPlayProto.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct NetSettings
bool cpu_thread = false;
PowerPC::CPUCore cpu_core{};
bool enable_cheats = false;
bool enable_hardcore = false;
int selected_language = 0;
bool override_region_settings = false;
bool dsp_hle = false;
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/Core/NetPlayServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include "Core/ActionReplay.h"
#include "Core/Boot/Boot.h"
#include "Core/Config/AchievementSettings.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/NetplaySettings.h"
Expand Down Expand Up @@ -1358,6 +1359,7 @@ bool NetPlayServer::SetupNetSettings()
settings.cpu_thread = Config::Get(Config::MAIN_CPU_THREAD);
settings.cpu_core = Config::Get(Config::MAIN_CPU_CORE);
settings.enable_cheats = Config::AreCheatsEnabled();
settings.enable_hardcore = Config::Get(Config::RA_HARDCORE_ENABLED);
settings.selected_language = Config::Get(Config::MAIN_GC_LANGUAGE);
settings.override_region_settings = Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS);
settings.dsp_hle = Config::Get(Config::MAIN_DSP_HLE);
Expand Down Expand Up @@ -1586,6 +1588,7 @@ bool NetPlayServer::StartGame()
spac << m_settings.cpu_thread;
spac << m_settings.cpu_core;
spac << m_settings.enable_cheats;
spac << m_settings.enable_hardcore;
spac << m_settings.selected_language;
spac << m_settings.override_region_settings;
spac << m_settings.dsp_enable_jit;
Expand Down

0 comments on commit df1e72f

Please sign in to comment.