Add option to disable save patching

Add factorio.enable_save_patching config entry to allow disabling the
save patching done on startup.  This is for running vannila games or
scenarios that are not compatible with Clusterio.
This commit is contained in:
Hornwitser committed 2020-07-04 16:45:42 +02:00
1 parent 0969e07d79
commit 9458155a1b
6 files changed
+43 -2

No files matched your search

+4
View File
@@ -13,6 +13,10 @@ function unexpectedError(err) {
class InstancePlugin extends plugin.BaseInstancePlugin {
async init() {
if (!this.instance.config.get("factorio.enable_save_patching")) {
throw new Error("research_sync plugin requires save patching.");
}
this.instance.server.on("ipc-research_sync:contribution", (tech) => {
this.researchContribution(tech).catch(unexpectedError);
});