Added server methods required to support RemoteBukkit:

* getPort()
* getIP()
* getServerName()
* dispatchCommand(...)

By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
Bukkit/Spigot 2011-03-12 17:57:22 +00:00
parent 9bb9985c21
commit dfc8620a1b

View File

@ -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);
}