public abstract class BaseProtocol extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
DEBUG
If true, print gathered information to console
|
protected String |
infoStr
Holds the common server status information.
|
protected String |
ip
The IP of the server whose status we're querying.
|
protected int |
port
The IP of the server whose status we're querying.
|
Constructor and Description |
---|
BaseProtocol() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
getInfo()
Send a status query and return the response.
|
protected PlayerList |
getPlayers()
Processes an info/status string and reads out player data.
|
abstract int |
getSupportedOptions()
Information this plugin is able to gather.
|
ServerStatus |
prepareServerStatus(String ip,
int port)
Prepares a ServerStatus object for the given server and returns it.
|
protected abstract void |
processInfo(ServerStatus st)
Process the gathered information and set up the ServerStatus.
|
protected final boolean DEBUG
protected String ip
protected int port
protected String infoStr
protected abstract String getInfo()
protected abstract void processInfo(ServerStatus st)
st
- The ServerStatus that has to be filled.public abstract int getSupportedOptions()
The return value states wether this plugin supports an option or not.
You just have to return the options for this plugin.
You can combine them with the binary or -> |
return PluginOptions.GET_MAPS | PluginOptions.RECOGNIZE_BOTS;
protected PlayerList getPlayers()
public final ServerStatus prepareServerStatus(String ip, int port)
ip
- Server IP/DNSport
- Server port