net.sf.freecol.server.control
Class PreGameInputHandler

java.lang.Object
  extended by net.sf.freecol.server.control.FreeColServerHolder
      extended by net.sf.freecol.server.control.InputHandler
          extended by net.sf.freecol.server.control.PreGameInputHandler
All Implemented Interfaces:
MessageHandler

public final class PreGameInputHandler
extends InputHandler

Handles the network messages that arrives before the game starts.

See Also:
PreGameController

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.freecol.server.control.InputHandler
InputHandler.CurrentPlayerNetworkRequestHandler, InputHandler.NetworkRequestHandler
 
Field Summary
private  boolean launching
           
private static java.util.logging.Logger logger
           
 
Constructor Summary
PreGameInputHandler(FreeColServer freeColServer)
          The constructor to use.
 
Method Summary
private  org.w3c.dom.Element available(Connection connection, org.w3c.dom.Element element)
          Handles a "setAvailable"-message from a client.
protected  org.w3c.dom.Element logout(Connection connection, org.w3c.dom.Element logoutElement)
          Handles a "logout"-message.
private  org.w3c.dom.Element nation(Connection connection, org.w3c.dom.Element element)
          Handles a "setNation"-message from a client.
private  org.w3c.dom.Element nationType(Connection connection, org.w3c.dom.Element element)
          Handles a "setNationType"-message from a client.
private  org.w3c.dom.Element ready(Connection connection, org.w3c.dom.Element element)
          Handles a "ready"-message from a client.
private  org.w3c.dom.Element requestLaunch(Connection connection, org.w3c.dom.Element element)
          Handles a "requestLaunch"-message from a client.
private  org.w3c.dom.Element updateGameOptions(Connection connection, org.w3c.dom.Element element)
          Handles a "updateGameOptions"-message from a client.
private  org.w3c.dom.Element updateMapGeneratorOptions(Connection connection, org.w3c.dom.Element element)
          Handles a "updateMapGeneratorOptions"-message from a client.
 
Methods inherited from class net.sf.freecol.server.control.InputHandler
createErrorReply, handle, logException, register
 
Methods inherited from class net.sf.freecol.server.control.FreeColServerHolder
getFreeColServer, getGame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static java.util.logging.Logger logger

launching

private boolean launching
Constructor Detail

PreGameInputHandler

public PreGameInputHandler(FreeColServer freeColServer)
The constructor to use.

Parameters:
freeColServer - The main server object.
Method Detail

updateGameOptions

private org.w3c.dom.Element updateGameOptions(Connection connection,
                                              org.w3c.dom.Element element)
Handles a "updateGameOptions"-message from a client.

Parameters:
connection - The connection the message came from.
element - The element containing the request.
Returns:
The reply.

updateMapGeneratorOptions

private org.w3c.dom.Element updateMapGeneratorOptions(Connection connection,
                                                      org.w3c.dom.Element element)
Handles a "updateMapGeneratorOptions"-message from a client.

Parameters:
connection - The connection the message came from.
element - The element containing the request.
Returns:
The reply.

ready

private org.w3c.dom.Element ready(Connection connection,
                                  org.w3c.dom.Element element)
Handles a "ready"-message from a client.

Parameters:
connection - The connection the message came from.
element - The element containing the request.

nation

private org.w3c.dom.Element nation(Connection connection,
                                   org.w3c.dom.Element element)
Handles a "setNation"-message from a client.

Parameters:
connection - The connection the message came from.
element - The element containing the request.

nationType

private org.w3c.dom.Element nationType(Connection connection,
                                       org.w3c.dom.Element element)
Handles a "setNationType"-message from a client.

Parameters:
connection - The connection the message came from.
element - The element containing the request.

available

private org.w3c.dom.Element available(Connection connection,
                                      org.w3c.dom.Element element)
Handles a "setAvailable"-message from a client.

Parameters:
connection - The connection the message came from.
element - The element containing the request.

requestLaunch

private org.w3c.dom.Element requestLaunch(Connection connection,
                                          org.w3c.dom.Element element)
Handles a "requestLaunch"-message from a client.

Parameters:
connection - The connection the message came from.
element - The element containing the request.

logout

protected org.w3c.dom.Element logout(Connection connection,
                                     org.w3c.dom.Element logoutElement)
Handles a "logout"-message.

Specified by:
logout in class InputHandler
Parameters:
connection - The Connection the message was received on.
logoutElement - The element (root element in a DOM-parsed XML tree) that holds all the information.
Returns:
The reply.