net.barkerjr.gameserver.valve
Class OrangeBoxServer

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.valve.ValveServer
                  extended by net.barkerjr.gameserver.valve.SourceServer
                      extended by net.barkerjr.gameserver.valve.OrangeBoxServer
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
Left4DeadServer

public class OrangeBoxServer
extends SourceServer

Provides parsing and Orange-Box-specific server query handling. Orange Box is the Half-Life 2: Episode 2 engine.

Since:
2010-03-17
Author:
BarkerJr
See Also:
Specification

Nested Class Summary
 
Nested classes/interfaces inherited from class net.barkerjr.gameserver.valve.ValveServer
ValveServer.OperatingSystem
 
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.valve.ValveServer
rconPassword
 
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
OrangeBoxServer(InetSocketAddress address)
          Creates a server for the Valve Orange Box Source engine
 
Method Summary
static OrangeBoxServer getInstance(InetSocketAddress address)
          Gets or creates an instance of the server at the given address.
protected  void loadChallenge()
          Requests A2S_PLAYER instead of A2S_SERVERQUERY_GETCHALLENGE, which is broken Requests (Asynchronously) the challenge code from the server
protected  SequenceDvo parsePacketNumber(ReplyStream buffer)
          Parses the next two bytes for the packet sequence numbers Determines which packet in the multi-packet response this is
 
Methods inherited from class net.barkerjr.gameserver.valve.SourceServer
sendRcon
 
Methods inherited from class net.barkerjr.gameserver.valve.ValveServer
getApplicationId, getGameDescription, getOperatingSystem, getShip, handleMessage, handlePlayers, isVacSecure, load, loadInformation, loadPlayers, loadRules, parseData, sendRcon, setRconPassword, toJsonObject
 
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

OrangeBoxServer

public OrangeBoxServer(InetSocketAddress address)
Creates a server for the Valve Orange Box Source engine

Parameters:
address - the address of the server
Since:
2010-03-17
Method Detail

getInstance

public static OrangeBoxServer 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:
2010-03-17

parsePacketNumber

protected SequenceDvo parsePacketNumber(ReplyStream buffer)
Description copied from class: SourceServer
Parses the next two bytes for the packet sequence numbers Determines which packet in the multi-packet response this is

Overrides:
parsePacketNumber in class SourceServer
Parameters:
buffer - the packet data
Returns:
a DVO containing this packet's sequence number, and the total number of packets to expect
Since:
2010-03-17

loadChallenge

protected void loadChallenge()
                      throws IOException
Requests A2S_PLAYER instead of A2S_SERVERQUERY_GETCHALLENGE, which is broken Requests (Asynchronously) the challenge code from the server

Overrides:
loadChallenge in class ValveServer
Throws:
IOException - if there was an error sending the request
Since:
2010-03-17