|
|||||||
| 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
net.barkerjr.gameserver.UdpServer
net.barkerjr.gameserver.gamespy.GameSpyServer
public abstract class GameSpyServer
Provides generic parsing and querying for GameSpy protocol servers
TODO Due to lack of reply format information in replies:
GameServer.load(int, Request...) method may return before the data is
completely loaded
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.barkerjr.gameserver.GameServer |
|---|
GameServer.Dedicated, GameServer.Request, GameServer.RequestTimeoutException |
| Field Summary | |
|---|---|
protected String |
location
The location of the server |
| Fields inherited from class net.barkerjr.gameserver.UdpServer |
|---|
servers |
| Fields inherited from class net.barkerjr.gameserver.GameServer |
|---|
address, botCount, dedicated, gameDirectory, IPTOS_RELIABILITY, map, maximumPlayers, name, namespace, numberOfPlayers, passwordRequired, players, plugins, rules, updated, version |
| Fields inherited from class net.barkerjr.gameserver.Base |
|---|
listeners |
| Constructor Summary | |
|---|---|
GameSpyServer(InetSocketAddress address)
Sets up the basic server information and DOM |
|
| Method Summary | |
|---|---|
String |
getLocation()
The location of the server |
protected String |
getLocation(String code)
Determines the region that matches the given number |
protected Player |
getPlayer(String key)
Fetches or creates the given player element |
void |
load(GameServer.Request... requests)
Supports: Request.BASIC Request.INFORMATION Request.PLAYERS Request.RULES Loads the given requests asynchronously |
protected void |
parseData(byte[] packet)
Parses the given data |
protected GameServer.Request |
storePair(String key,
String value)
Processes and persists the given key/value pair in the DOM |
JSONObject |
toJsonObject()
Deprecated. since 2010-03-23, use JSON.toJSON(GameServer) |
| Methods inherited from class net.barkerjr.gameserver.UdpServer |
|---|
close, sendData, sendData |
| Methods inherited from class net.barkerjr.gameserver.GameServer |
|---|
addPlugin, equals, fireChangeEvent, fireLoadEvent, getBotCount, getDedicated, getGameDirectory, getIP, getMap, getMaximumPlayers, getName, getNumberOfPlayers, getPlayers, getPlugins, getPort, getRules, getUpdated, getVersion, handleError, hashCode, isPasswordRequired, load, replaceChild, toString, toXmlDocument |
| 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 String location
| Constructor Detail |
|---|
public GameSpyServer(InetSocketAddress address)
address - the address of the server| Method Detail |
|---|
protected void parseData(byte[] packet)
UdpServer
parseData in class UdpServerpacket - the bytes in the packet
protected GameServer.Request storePair(String key,
String value)
key - the key for the rule, etcvalue - the value of the given key
protected Player getPlayer(String key)
key - the player number
public void load(GameServer.Request... requests)
throws IOException
load in class GameServerrequests - the requests to load
IOException - if there was an error sending or receiving the dataprotected String getLocation(String code)
code - the region number
@Deprecated
public JSONObject toJsonObject()
throws JSONException
JSON.toJSON(GameServer)
GameServer
toJsonObject in class GameServerJSONException - if an error occurspublic String getLocation()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||