|
|||||||
| 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.valve.ValveServer
public abstract class ValveServer
Provides generic parsing and querying for Valve servers
| Nested Class Summary | |
|---|---|
static class |
ValveServer.OperatingSystem
The operating system the server is running |
| Nested classes/interfaces inherited from class net.barkerjr.gameserver.GameServer |
|---|
GameServer.Dedicated, GameServer.Request, GameServer.RequestTimeoutException |
| Field Summary | |
|---|---|
protected String |
rconPassword
The rcon password for this 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 | |
|---|---|
protected |
ValveServer(InetSocketAddress address)
Sets up the basic server information and DOM |
| Method Summary | |
|---|---|
int |
getApplicationId()
The application ID |
String |
getGameDescription()
The description of the game that is running |
ValveServer.OperatingSystem |
getOperatingSystem()
The operating system running on the server |
TheShip |
getShip()
Statistics about The Ship servers |
protected void |
handleMessage(int code,
ReplyStream stream)
Handles A (Challenge), D (Players), E (Rules), and Information responses |
protected void |
handlePlayers(ReplyStream stream)
Handles D (Players) responses from the server |
boolean |
isVacSecure()
If the server uses VAC security |
void |
load(GameServer.Request... requests)
Supports: Request.INFORMATION Request.PLAYERS Request.RULES Loads the given requests asynchronously |
protected void |
loadChallenge()
Requests (Asynchronously) the challenge code from the server |
void |
loadInformation()
Asynchronously loads the generic server information. |
void |
loadPlayers()
Asynchronously loads the player list. |
void |
loadRules()
Asynchronously loads the rules. |
protected void |
parseData(byte[] data)
Parses the packet header and reassembles reply fragments. |
protected abstract SequenceDvo |
parsePacketNumber(ReplyStream buffer)
Determines which packet in the multi-packet response this is |
void |
sendRcon(String... commands)
Sends the given command to the server |
abstract String |
sendRcon(String command)
Sends the given command to the server and waits for a reply. |
void |
setRconPassword(String password)
Sets the server rcon password |
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 rconPassword
| Constructor Detail |
|---|
protected ValveServer(InetSocketAddress address)
address - the address of the server| Method Detail |
|---|
protected void parseData(byte[] data)
throws IOException
parseData in class UdpServerdata - the packet we received
IOException - if there is an error decompressing the packetsprotected abstract SequenceDvo parsePacketNumber(ReplyStream buffer)
buffer - the packet data
protected void handleMessage(int code,
ReplyStream stream)
code - the message typestream - the message itselfprotected void handlePlayers(ReplyStream stream)
stream - the message from the server
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 data
public void loadInformation()
throws IOException
IOException - if there was an error sending the requestBase.addListener(Listener)
public void loadPlayers()
throws IOException
IOException - if there was an error sending the requestBase.addListener(Listener)
public void loadRules()
throws IOException
IOException - if there was an error sending the requestBase.addListener(Listener)
protected void loadChallenge()
throws IOException
IOException - if there was an error sending the requestpublic void setRconPassword(String password)
password - the password to store
public abstract String sendRcon(String command)
throws FailedLoginException,
SocketTimeoutException
command - the command to send
FailedLoginException - if the password set by
setRconPassword(String) is bad
SocketTimeoutException - if there was an error contacting the serverpublic void sendRcon(String... commands)
commands - the commands to sendpublic String getGameDescription()
public int getApplicationId()
public ValveServer.OperatingSystem getOperatingSystem()
public boolean isVacSecure()
public TheShip getShip()
@Deprecated
public JSONObject toJsonObject()
throws JSONException
JSON.toJSON(GameServer)
GameServer
toJsonObject in class GameServerJSONException - if an error occurs
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||