Delete CRIU checkpoint on /bau delete

/bau delete only removed the world folder. The checkpoint of the build
server stayed in place, so the next start restored the old JVM state
against a freshly copied world (superflat world, plugins inactive).
Extract ServerStarter#checkpointDir and delete the checkpoint together
with the world.
Fixes #438
This commit is contained in:
2026-10-19 10:14:10 +02:00
parent 37f017b84c
commit 27d260a8d2
2 changed files with 6 additions and 1 deletions
@@ -303,7 +303,7 @@ public class ServerStarter {
worldSetup.run();
arguments.put("logPath", worldName);
File checkpointDir = new File("/tmp/" + System.getProperty("user.name") + ".checkpoints/" + directory.getName() + "/" + worldName);
File checkpointDir = checkpointDir(directory, worldName);
if (checkpoint) {
arguments.put("checkpoint", checkpointDir.getPath());
}
@@ -326,6 +326,10 @@ public class ServerStarter {
}).schedule();
}
public static File checkpointDir(File serverDirectory, String worldName) {
return new File("/tmp/" + System.getProperty("user.name") + ".checkpoints/" + serverDirectory.getName() + "/" + worldName);
}
private void regularStart(String serverName, int port) {
postStart(constructor.construct(serverName, port, node.startServer(
version, directory, worldDir, worldName, port, arguments.entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).toArray(String[]::new)
@@ -261,6 +261,7 @@ public class BauCommand extends SWCommand {
}
SubserverSystem.deleteFolder(VelocityCore.local, world);
SubserverSystem.deleteFolder(VelocityCore.local, ServerStarter.checkpointDir(version.getServerDirectory("Bau"), String.valueOf(sender.user().getId())).getPath());
sender.system("BAU_DELETE_DELETED");
}).schedule();