summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorstevenh <steven.hartland@multiplay.co.uk>2011-03-12 17:57:22 +0000
committerstevenh <steven.hartland@multiplay.co.uk>2011-03-12 17:57:22 +0000
commit2a8775944300434f23376311297ab88384b15929 (patch)
treea2c0dbb7c55a08ac423be853ece9b379d5b93b6f /src
parentc47efb498624292523c69f00306cac5dea5ba31d (diff)
downloadbukkit-2a8775944300434f23376311297ab88384b15929.tar
bukkit-2a8775944300434f23376311297ab88384b15929.tar.gz
bukkit-2a8775944300434f23376311297ab88384b15929.tar.lz
bukkit-2a8775944300434f23376311297ab88384b15929.tar.xz
bukkit-2a8775944300434f23376311297ab88384b15929.zip
Added server methods required to support RemoteBukkit:
* getPort() * getIP() * getServerName() * dispatchCommand(...)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/Server.java31
1 files changed, 31 insertions, 0 deletions
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;
@@ -42,6 +43,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.
*
* @param message the message
@@ -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);
}