mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-04-21 17:15:43 +02:00
Disable sync chunk writes to avoid lag during backups
This commit is contained in:
parent
21c90cb7c2
commit
3b313bf0a8
Agent
Phantom.Agent.Minecraft/Properties
Phantom.Agent.Services/Backups
@ -18,4 +18,5 @@ static class MinecraftServerProperties {
|
||||
public static readonly MinecraftServerProperty<ushort> ServerPort = new UnsignedShort("server-port");
|
||||
public static readonly MinecraftServerProperty<ushort> RconPort = new UnsignedShort("rcon.port");
|
||||
public static readonly MinecraftServerProperty<bool> EnableRcon = new Boolean("enable-rcon");
|
||||
public static readonly MinecraftServerProperty<bool> SyncChunkWrites = new Boolean("sync-chunk-writes");
|
||||
}
|
||||
|
@ -5,11 +5,13 @@ namespace Phantom.Agent.Minecraft.Properties;
|
||||
public sealed record ServerProperties(
|
||||
ushort ServerPort,
|
||||
ushort RconPort,
|
||||
bool EnableRcon = true
|
||||
bool EnableRcon = true,
|
||||
bool SyncChunkWrites = false
|
||||
) {
|
||||
internal void SetTo(JavaPropertiesFileEditor properties) {
|
||||
MinecraftServerProperties.ServerPort.Set(properties, ServerPort);
|
||||
MinecraftServerProperties.RconPort.Set(properties, RconPort);
|
||||
MinecraftServerProperties.EnableRcon.Set(properties, EnableRcon);
|
||||
MinecraftServerProperties.SyncChunkWrites.Set(properties, SyncChunkWrites);
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,6 @@ sealed partial class BackupServerCommandDispatcher : IDisposable {
|
||||
}
|
||||
|
||||
public async Task SaveAllChunks() {
|
||||
// TODO Try if not flushing and waiting a few seconds before flushing reduces lag.
|
||||
await process.SendCommand(MinecraftCommand.SaveAll(flush: true), cancellationToken);
|
||||
await savedTheGame.Task.WaitAsync(TimeSpan.FromMinutes(1), cancellationToken);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user