|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectnet.barkerjr.gameserver.Base
net.barkerjr.gameserver.GameServer
public abstract class GameServer
Provides generic parsing and querying servers
| Nested Class Summary | |
|---|---|
static class |
GameServer.Dedicated
The server type |
static class |
GameServer.Request
The type of request to place |
class |
GameServer.RequestTimeoutException
Provides a container for the requests which failed to load |
| Field Summary | |
|---|---|
InetSocketAddress |
address
The address of this server |
int |
botCount
The number of bots on the server |
protected GameServer.Dedicated |
dedicated
The dedicated status of the server |
String |
gameDirectory
The directory of the game |
protected static int |
IPTOS_RELIABILITY
The type-of-service to send queries under |
String |
map
The map the server is playing |
int |
maximumPlayers
The maximum players allowed |
String |
name
The name of the server |
static Namespace |
namespace
Deprecated. 2009-05-02, use JDOM.toJDOM(GameServer).getRootElement().getNamespace() |
int |
numberOfPlayers
The number of players in the server |
boolean |
passwordRequired
If a password is required to connect |
protected Players |
players
The players in the server |
protected Set<Plugin> |
plugins
Any listeners which should be triggered when a load is in progress |
protected HashMap<String,String> |
rules
The rules on the server |
Calendar |
updated
The time the server was last updated |
protected String |
version
The version of the server |
| Fields inherited from class net.barkerjr.gameserver.Base |
|---|
listeners |
| Constructor Summary | |
|---|---|
GameServer(InetSocketAddress address)
Stores the address for later use |
|
| Method Summary | |
|---|---|
void |
addPlugin(Plugin... plugins)
Adds the given plugins to the server |
boolean |
equals(Object obj)
Determines if this server's address is the same as the other server's address |
protected void |
fireChangeEvent(GameServer.Request request)
Fires the change event in all listeners for this server |
protected void |
fireLoadEvent(GameServer.Request request)
Fires the load event in all listeners for this server |
int |
getBotCount()
The number of bots on the server |
GameServer.Dedicated |
getDedicated()
The type of server this is |
String |
getGameDirectory()
The directory the game is running |
String |
getIP()
The address of this server |
String |
getMap()
The map the server is running |
int |
getMaximumPlayers()
The maximum players allowed by the server |
String |
getName()
The name of the server |
int |
getNumberOfPlayers()
The number of players in the server |
Players |
getPlayers()
The players in the server |
Collection<Plugin> |
getPlugins()
The plugins in this server |
int |
getPort()
The port of this server |
Map<String,String> |
getRules()
The server rules |
String |
getUpdated()
The time the server was last updated |
String |
getVersion()
The version the server is running |
protected void |
handleError(Throwable error)
Sends error to the listeners, if there are any |
int |
hashCode()
Fetches the hashcode of the address of this server |
boolean |
isPasswordRequired()
If a password is required to connect |
void |
load(GameServer.Request... requests)
Loads the given requests asynchronously |
void |
load(int msToWait,
GameServer.Request... requests)
Loads the given requests synchronously and returns once they are all loaded |
protected void |
replaceChild(Element element,
Element child)
Deprecated. since 2010-03-23 |
JSONObject |
toJsonObject()
Deprecated. since 2010-03-23, use JSON.toJSON(GameServer) |
String |
toString()
|
Document |
toXmlDocument()
Deprecated. since 2010-03-23, use JDOM.toJDOM(GameServer) |
| Methods inherited from class net.barkerjr.gameserver.Base |
|---|
addListener, removeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int IPTOS_RELIABILITY
DatagramSocket.setTrafficClass(int),
Constant Field Valuespublic final InetSocketAddress address
protected Set<Plugin> plugins
@Deprecated public static final Namespace namespace
public Calendar updated
public String name
public String map
public boolean passwordRequired
public int numberOfPlayers
public int maximumPlayers
public int botCount
protected Players players
public String gameDirectory
protected HashMap<String,String> rules
protected String version
protected GameServer.Dedicated dedicated
| Constructor Detail |
|---|
public GameServer(InetSocketAddress address)
address - the address of the server| Method Detail |
|---|
public String toString()
toString in class Object
@Deprecated
public Document toXmlDocument()
throws InvocationTargetException
JDOM.toJDOM(GameServer)
InvocationTargetException - if JDOM.toJDOM(GameServer) throws it
@Deprecated
public JSONObject toJsonObject()
throws JSONException
JSON.toJSON(GameServer)
JSONException - if an error occursprotected void fireLoadEvent(GameServer.Request request)
request - the type of request to fireprotected void fireChangeEvent(GameServer.Request request)
request - the type of request to fire
@Deprecated
protected void replaceChild(Element element,
Element child)
element - the parent elementchild - the child elementprotected void handleError(Throwable error)
handleError in class Baseerror - the error to send
public void load(int msToWait,
GameServer.Request... requests)
throws IOException,
InterruptedException,
GameServer.RequestTimeoutException
msToWait - the number of milliseconds to block while waiting for
a reply from the serverrequests - the requests to load
IOException - if there was an error sending or receiving the data
GameServer.RequestTimeoutException - if the server did not respond in the
specified time
InterruptedException - if the thread was interrupted before the
data was loaded
public void load(GameServer.Request... requests)
throws IOException
requests - the requests to load
IOException - if there was an error sending or receiving the datapublic void addPlugin(Plugin... plugins)
plugins - the plugins to installpublic boolean equals(Object obj)
equals in class ObjectInetSocketAddress.equals(Object)public int hashCode()
hashCode in class ObjectInetSocketAddress.hashCode()public String getIP()
public int getPort()
public String getUpdated()
public String getName()
public boolean isPasswordRequired()
public int getNumberOfPlayers()
public int getMaximumPlayers()
public int getBotCount()
public Players getPlayers()
public String getMap()
public String getGameDirectory()
public Map<String,String> getRules()
public String getVersion()
public GameServer.Dedicated getDedicated()
public Collection<Plugin> getPlugins()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||