diff --git a/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp index 92dd1a9cfc..e577050597 100644 --- a/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/NetPlayConfigLoader.cpp @@ -40,6 +40,7 @@ public: layer->Set(Config::MAIN_OVERCLOCK, m_settings.m_OCFactor); for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS) layer->Set(Config::GetInfoForEXIDevice(slot), m_settings.m_EXIDevice[slot]); + layer->Set(Config::MAIN_MEMORY_CARD_SIZE, m_settings.m_MemcardSizeOverride); layer->Set(Config::SESSION_SAVE_DATA_WRITABLE, m_settings.m_WriteToMemcard); layer->Set(Config::MAIN_RAM_OVERRIDE_ENABLE, m_settings.m_RAMOverrideEnable); layer->Set(Config::MAIN_MEM1_SIZE, m_settings.m_Mem1Size); diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 945bd85742..54aeb83e83 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -822,6 +822,8 @@ void NetPlayClient::OnStartGame(sf::Packet& packet) for (auto slot : ExpansionInterface::SLOTS) packet >> m_net_settings.m_EXIDevice[slot]; + packet >> m_net_settings.m_MemcardSizeOverride; + for (u32& value : m_net_settings.m_SYSCONFSettings) packet >> value; diff --git a/Source/Core/Core/NetPlayProto.h b/Source/Core/Core/NetPlayProto.h index ccb147b256..9c82ed70a3 100644 --- a/Source/Core/Core/NetPlayProto.h +++ b/Source/Core/Core/NetPlayProto.h @@ -47,6 +47,7 @@ struct NetSettings bool m_OCEnable = false; float m_OCFactor = 0; Common::EnumMap m_EXIDevice{}; + int m_MemcardSizeOverride = -1; std::array m_SYSCONFSettings{}; diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 755a2774f0..d2335149db 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -1324,6 +1324,8 @@ bool NetPlayServer::SetupNetSettings() settings.m_EXIDevice[slot] = device; } + settings.m_MemcardSizeOverride = Config::Get(Config::MAIN_MEMORY_CARD_SIZE); + for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i) { std::visit( @@ -1510,6 +1512,8 @@ bool NetPlayServer::StartGame() for (auto slot : ExpansionInterface::SLOTS) spac << static_cast(m_settings.m_EXIDevice[slot]); + spac << m_settings.m_MemcardSizeOverride; + for (u32 value : m_settings.m_SYSCONFSettings) spac << value; @@ -1674,10 +1678,7 @@ bool NetPlayServer::SyncSaveData() MemoryCard::CheckPath(path, region, slot); - int size_override; - IniFile gameIni = SConfig::LoadGameIni(game->GetGameID(), game->GetRevision()); - gameIni.GetOrCreateSection("Core")->Get("MemoryCardSize", &size_override, -1); - + const int size_override = m_settings.m_MemcardSizeOverride; if (size_override >= 0 && size_override <= 4) { path.insert(path.find_last_of('.'),