[Bleeding] Add autosave interval setting in bukkit.yml. Adds BUKKIT-2507

The new setting is located at "ticks-per.autosave". By changing this
value, it affects how often a full save is automatically executed,
measured in ticks.

This value is defaulting to 0 (off) because we believe that the vast
majority of servers already have a third-party solution to automatically
saving the server at set intervals. Having the built in auto-save disabled
by default ensures that we are not saving things twice; doing so leads to
absolutely no benefits, but results in detrimental and noticeable
unnecessary performance decrease.

For servers that do not use an automated external script to perform saves,
this setting can be turned on by setting the value higher than 0, with 900
being the value used in vanilla.
Dieser Commit ist enthalten in:
Mike Primm 2012-08-18 17:36:39 -05:00 committet von EvilSeph
Ursprung e2b1514daf
Commit beee3ce2da
3 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -80,6 +80,7 @@ public abstract class MinecraftServer implements Runnable, IMojangStatistics, IC
public static int currentTick; public static int currentTick;
public final Thread primaryThread; public final Thread primaryThread;
public java.util.Queue<PlayerChatEvent> chatQueue = new java.util.concurrent.ConcurrentLinkedQueue<PlayerChatEvent>(); public java.util.Queue<PlayerChatEvent> chatQueue = new java.util.concurrent.ConcurrentLinkedQueue<PlayerChatEvent>();
public int autosavePeriod;
// CraftBukkit end // CraftBukkit end
public MinecraftServer(OptionSet options) { // CraftBukkit - signature file -> OptionSet public MinecraftServer(OptionSet options) { // CraftBukkit - signature file -> OptionSet
@ -472,7 +473,7 @@ public abstract class MinecraftServer implements Runnable, IMojangStatistics, IC
this.methodProfiler.a("root"); this.methodProfiler.a("root");
this.q(); this.q();
if (this.ticks % 900 == 0) { if ((this.autosavePeriod > 0) && ((this.ticks % this.autosavePeriod) == 0)) { // CraftBukkit
this.methodProfiler.a("save"); this.methodProfiler.a("save");
this.t.savePlayers(); this.t.savePlayers();
this.saveChunks(true); this.saveChunks(true);

Datei anzeigen

@ -186,6 +186,7 @@ public final class CraftServer implements Server {
monsterSpawn = configuration.getInt("spawn-limits.monsters"); monsterSpawn = configuration.getInt("spawn-limits.monsters");
animalSpawn = configuration.getInt("spawn-limits.animals"); animalSpawn = configuration.getInt("spawn-limits.animals");
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
console.autosavePeriod = configuration.getInt("ticks-per.autosave");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
updater = new AutoUpdater(new BukkitDLUpdaterService(configuration.getString("auto-updater.host")), getLogger(), configuration.getString("auto-updater.preferred-channel")); updater = new AutoUpdater(new BukkitDLUpdaterService(configuration.getString("auto-updater.host")), getLogger(), configuration.getString("auto-updater.preferred-channel"));
@ -522,6 +523,7 @@ public final class CraftServer implements Server {
animalSpawn = configuration.getInt("spawn-limits.animals"); animalSpawn = configuration.getInt("spawn-limits.animals");
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
console.autosavePeriod = configuration.getInt("ticks-per.autosave");
for (WorldServer world : console.worlds) { for (WorldServer world : console.worlds) {
world.difficulty = difficulty; world.difficulty = difficulty;

Datei anzeigen

@ -32,6 +32,7 @@ spawn-limits:
ticks-per: ticks-per:
animal-spawns: 400 animal-spawns: 400
monster-spawns: 1 monster-spawns: 1
autosave: 0
auto-updater: auto-updater:
enabled: true enabled: true
on-broken: [warn-console, warn-ops] on-broken: [warn-console, warn-ops]