net.barkerjr.gameserver.unreal
Class UnrealEngine2Server

java.lang.Object
  extended by net.barkerjr.gameserver.Base
      extended by net.barkerjr.gameserver.GameServer
          extended by net.barkerjr.gameserver.UdpServer
              extended by net.barkerjr.gameserver.unreal.UnrealEngine2Server
All Implemented Interfaces:
Closeable

public class UnrealEngine2Server
extends UdpServer

Provides generic parsing and querying for Unreal Engine 2 servers

Since:
2009-08-30
Author:
BarkerJr
See Also:
Specification

Nested Class Summary
 
Nested classes/interfaces inherited from class net.barkerjr.gameserver.GameServer
GameServer.Dedicated, GameServer.Request, GameServer.RequestTimeoutException
 
Field Summary
 
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
UnrealEngine2Server(InetSocketAddress address)
          Creates a parser for an Unreal Engine 2 server
 
Method Summary
 int getGamePort()
          The game port
 String getGameType()
          The game type
static UnrealEngine2Server getInstance(InetSocketAddress address)
          Gets or creates an instance of the server at the given address.
 void load(GameServer.Request... requests)
          Supports: Request.INFORMATION Request.PLAYERS Request.RULES Loads the given requests asynchronously
protected  void parseData(byte[] data)
          Parses the given data
 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
 

Constructor Detail

UnrealEngine2Server

public UnrealEngine2Server(InetSocketAddress address)
Creates a parser for an Unreal Engine 2 server

Parameters:
address -
Since:
2009-08-30
Method Detail

getInstance

public static UnrealEngine2Server getInstance(InetSocketAddress address)
Gets or creates an instance of the server at the given address.

Parameters:
address - the address of the server
Returns:
the server
Since:
2009-08-30

parseData

protected void parseData(byte[] data)
                  throws IOException
Description copied from class: UdpServer
Parses the given data

Specified by:
parseData in class UdpServer
Parameters:
data - the bytes in the packet
Throws:
IOException - if there is a problem
Since:
2009-08-30

load

public void load(GameServer.Request... requests)
          throws IOException
Supports: Loads the given requests asynchronously

Overrides:
load in class GameServer
Parameters:
requests - the requests to load
Throws:
IOException - if there was an error sending or receiving the data
Since:
2009-08-30

getGamePort

public int getGamePort()
The game port

Returns:
the game port
Since:
2009-08-30

getGameType

public String getGameType()
The game type

Returns:
the game type
Since:
2009-08-30

toJsonObject

@Deprecated
public JSONObject toJsonObject()
                        throws JSONException
Deprecated. since 2010-03-23, use JSON.toJSON(GameServer)

Description copied from class: GameServer
Converts the server into a JSON object

Overrides:
toJsonObject in class GameServer
Returns:
the object describing this server
Throws:
JSONException - if an error occurs
Since:
2009-08-30