Add a custom shutdown message set in bukkit.yml. Addresses BUKKIT-3031

Dieser Commit ist enthalten in:
feildmaster 2012-12-03 19:32:44 -06:00
Ursprung 320712aba7
Commit fb6d9e1808
4 geänderte Dateien mit 12 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -142,7 +142,10 @@ public class NetServerHandler extends NetHandler {
String leaveMessage = "\u00A7e" + this.player.name + " left the game."; String leaveMessage = "\u00A7e" + this.player.name + " left the game.";
PlayerKickEvent event = new PlayerKickEvent(this.server.getPlayer(this.player), s, leaveMessage); PlayerKickEvent event = new PlayerKickEvent(this.server.getPlayer(this.player), s, leaveMessage);
if (this.server.getServer().isRunning()) {
this.server.getPluginManager().callEvent(event); this.server.getPluginManager().callEvent(event);
}
if (event.isCancelled()) { if (event.isCancelled()) {
// Do not kick the player // Do not kick the player

Datei anzeigen

@ -824,7 +824,7 @@ public abstract class ServerConfigurationManagerAbstract {
public void r() { public void r() {
while (!this.players.isEmpty()) { while (!this.players.isEmpty()) {
((EntityPlayer) this.players.get(0)).netServerHandler.disconnect("Server closed"); ((EntityPlayer) this.players.get(0)).netServerHandler.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
} }
} }
} }

Datei anzeigen

@ -930,6 +930,10 @@ public final class CraftServer implements Server {
return configuration.getInt("settings.spawn-radius", -1); return configuration.getInt("settings.spawn-radius", -1);
} }
public String getShutdownMessage() {
return configuration.getString("settings.shutdown-message");
}
public int getSpawnRadius() { public int getSpawnRadius() {
return ((DedicatedServer) console).propertyManager.getInt("spawn-protection", 16); return ((DedicatedServer) console).propertyManager.getInt("spawn-protection", 16);
} }

Datei anzeigen

@ -24,6 +24,7 @@ settings:
connection-throttle: 4000 connection-throttle: 4000
query-plugins: true query-plugins: true
deprecated-verbose: default deprecated-verbose: default
shutdown-message: Server closed
spawn-limits: spawn-limits:
monsters: 70 monsters: 70
animals: 15 animals: 15