net.barkerjr.gameserver.dice
Class BattlefieldBadCompany2Server

java.lang.Object
  extended by net.barkerjr.gameserver.Base
      extended by net.barkerjr.gameserver.GameServer
          extended by net.barkerjr.gameserver.dice.BattlefieldBadCompany2Server
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
BattlefieldBadCompany2

public class BattlefieldBadCompany2Server
extends GameServer
implements Closeable

Provides parsing and querying for Battlefield: Bad Company servers

Since:
2010-03-15
Author:
BarkerJr
See Also:
Specification, Forum Post

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.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
BattlefieldBadCompany2Server(InetSocketAddress address)
          Deprecated. since 2010-03-23, use BattlefieldBadCompany2Server(InetSocketAddress, int)
BattlefieldBadCompany2Server(InetSocketAddress address, int queryPort)
          Sets up the basic server information and DOM
 
Method Summary
 void close()
           
 String getGameMode()
          Provides the game mode
 int getQueryPort()
          Provides the query port
 void load(GameServer.Request... requests)
          Supports: Request.INFORMATION Loads the given requests asynchronously
 JSONObject toJsonObject()
          Deprecated. since 2010-03-23, use JSON.toJSON(GameServer)
 
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

BattlefieldBadCompany2Server

@Deprecated
public BattlefieldBadCompany2Server(InetSocketAddress address)
Deprecated. since 2010-03-23, use BattlefieldBadCompany2Server(InetSocketAddress, int)

Sets up the basic server information and DOM

Parameters:
address - the address of the server. The port is usually the server port plus 29321.
Since:
2010-03-15

BattlefieldBadCompany2Server

public BattlefieldBadCompany2Server(InetSocketAddress address,
                                    int queryPort)
Sets up the basic server information and DOM

Parameters:
address - the address of the server
queryPort - the port to query the server
Since:
2010-03-23
Method Detail

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:
2010-03-15

getGameMode

public String getGameMode()
Provides the game mode

Returns:
the mode of the server
Since:
2010-03-15

getQueryPort

public int getQueryPort()
Provides the query port

Returns:
the query port
Since:
2010-03-23

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:
2010-03-15

close

public void close()
Specified by:
close in interface Closeable
Since:
2010-03-15