no mods in MP, minor patches

This commit is contained in:
Alex Vanderveen
2026-07-29 02:40:50 -04:00
parent 070fc805c4
commit 92efb5c4fd
20 changed files with 1037 additions and 286 deletions
+36
View File
@@ -763,6 +763,17 @@ int provider_commit(void*, const char* image_path) {
return 1;
}
int provider_commit_netplay(void*, const char* image_path) {
(void)image_path;
std::string error;
if (!mod_runtime_clear_for_netplay(&error)) {
set_error(error);
return 0;
}
state().error.clear();
return 1;
}
const char* provider_error(void*) {
return state().error.c_str();
}
@@ -790,6 +801,9 @@ RecompLauncherCModProvider provider = {
provider_feature_set_option,
provider_diagnostic_count,
provider_diagnostic_get,
nullptr, /* archive_extension — PSX defaults */
nullptr, /* archive_description */
provider_commit_netplay,
};
#endif
@@ -836,6 +850,28 @@ bool mod_runtime_initialize(const std::filesystem::path& root,
return true;
}
bool mod_runtime_clear_for_netplay(std::string* error) {
RuntimeMods& s = state();
if (!s.initialized) {
if (error) error->clear();
return true;
}
s.plan = {};
s.validation = {};
s.raw_disc_index.clear();
s.user_disc_index.clear();
s.raw_overlay_index.clear();
s.user_overlay_index.clear();
s.effective_disc_path.clear();
s.main_applied = false;
s.disc_enabled = false;
s.disc_guard_failed = false;
s.error.clear();
if (error) error->clear();
std::fprintf(stdout, "psxrecomp: mods cleared for netplay (vanilla session)\n");
return true;
}
bool mod_runtime_commit(const std::filesystem::path& disc_path, std::string* error) {
RuntimeMods& s = state();
if (!s.initialized) return true;