From 2a8775944300434f23376311297ab88384b15929 Mon Sep 17 00:00:00 2001 From: stevenh Date: Sat, 12 Mar 2011 17:57:22 +0000 Subject: Added server methods required to support RemoteBukkit: * getPort() * getIP() * getServerName() * dispatchCommand(...) --- src/main/java/org/bukkit/Server.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src') diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 8e11635e..baa642fc 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.logging.Logger; import org.bukkit.command.PluginCommand; +import org.bukkit.command.CommandSender; import org.bukkit.plugin.PluginManager; import org.bukkit.scheduler.BukkitScheduler; @@ -41,6 +42,27 @@ public interface Server { */ public int getMaxPlayers(); + /** + * Get the game port that the server runs on + * + * @return The port number of this servers + */ + public int getPort(); + + /** + * Get the IP that this server is bound to or empty string if not specified + * + * @return The IP string that this server is bound to, otherwise empty string + */ + public String getIp(); + + /** + * Get the name of this server + * + * @return The name of this server + */ + public String getServerName(); + /** * Broadcast a message to all players. * @@ -135,4 +157,13 @@ public interface Server { * Writes loaded players to disk */ public void savePlayers(); + + /** + * Dispatches a command on the server, and executes it if found. + * + * @param cmdLine command + arguments. Example: "test abc 123" + * @return targetFound returns false if no target is found. + * @throws CommandException Thrown when the executor for the given command fails with an unhandled exception + */ + public boolean dispatchCommand(CommandSender sender, String commandLine); } -- cgit v1.2.3