mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 07:33:12 +09:00
Replace Hotpatch with save patching
Remove Hotpatch and implement a save patcher in its place. The save patcher takes a normal Factorio save and adds modules to it that's loaded by a generated control.lua file. This greatly reduces the difficulty of adding an existing game to Clusterio and using scenario code in plugins. The mechanism for selecting what code to patch into the saves from plugins is temorary and expected to change with #220.
This commit is contained in:
1 parent
079e31cf05
commit
1a035e849e
61 files changed
+575
-2709
No files matched your search
@@ -3,11 +3,9 @@ const fs = require("fs-extra");
|
||||
|
||||
const objectOps = require("lib/objectOps.js");
|
||||
const fileOps = require("lib/fileOps");
|
||||
const checkHotpatchInstallation = require("lib/clusterTools/checkHotpatchInstallation");
|
||||
const getLua = require("lib/clusterTools/getLua");
|
||||
|
||||
const pluginConfig = require("./config");
|
||||
const COMPRESS_LUA = false;
|
||||
|
||||
|
||||
function ensureFileSync(path) {
|
||||
if (!fs.existsSync(path)) {
|
||||
@@ -39,16 +37,8 @@ module.exports = class remoteCommands {
|
||||
ensureFileSync(instancedirectory + "/script-output/output.txt");
|
||||
ensureFileSync(instancedirectory + "/script-output/orders.txt");
|
||||
ensureFileSync(instancedirectory + "/script-output/txbuffer.txt");
|
||||
|
||||
(async ()=>{
|
||||
let hotpatchInstallStatus = await checkHotpatchInstallation(this.messageInterface);
|
||||
this.messageInterface("Hotpach installation status: "+hotpatchInstallStatus);
|
||||
if(hotpatchInstallStatus){
|
||||
// let mainCode = await getLua("sharedPlugins/playerManager/lua/playerTracking.lua");
|
||||
// if(mainCode) var returnValue = await messageInterface("/silent-command remote.call('hotpatch', 'update', '"+pluginConfig.name+"', '"+pluginConfig.version+"', '"+mainCode+"')");
|
||||
}
|
||||
})().catch(e => console.log(e));
|
||||
|
||||
|
||||
|
||||
// flow/production statistics ------------------------------------------------------------
|
||||
var oldFlowStats = false;
|
||||
var oldTimestamp;
|
||||
|
||||
Reference in new issue
Block a user