rl.centurion.server
Class CenturionGameServer

java.lang.Object
  extended by rl.server.game.GameServer
      extended by rl.centurion.server.CenturionGameServer
All Implemented Interfaces:
CenturionFiringRoundListener, CenturionGameListener, CenturionGameTurnListener, CenturionMovementRoundListener, CenturionPaintingRoundListener, CommandProcessorListener, GameListener, GameLogger

public class CenturionGameServer
extends GameServer
implements CenturionGameListener, CenturionGameTurnListener, CenturionMovementRoundListener, CenturionPaintingRoundListener, CenturionFiringRoundListener


Field Summary
 
Fields inherited from class rl.server.game.GameServer
m_AdminConnection
 
Constructor Summary
CenturionGameServer(java.lang.String name, java.lang.String type)
           
 
Method Summary
 void boardLoaded()
           
protected  boolean canConnect()
          returns true if other players than the admin player are allowed to connect
 void commanderSelected(CenturionGameSide side, Commander commander)
          Called when a commander has been selected for a side
 void commanderToBeSelected(CenturionGameSide side, java.util.Vector<Commander> commanders)
          Called when there is more than one commander available for a side.
 void commandPointAdvantage(CenturionGameSide side)
          Sends the calculated Command Point Advantage to the side
 void elementFiring(GameElementIdentifier element, GameElementIdentifier target)
           
 void elementFiringComplete(GameElementIdentifier element, boolean roundComplete)
           
 void elementMoved(Player p, GameElementIdentifier element)
           
 void elementPainted(SuccessfulPaint sp)
           
 void elementPainting(GameElementIdentifier element, GameElementIdentifier target, boolean roundComplete)
           
 void elementsEligibleToFire(Player p, java.util.Vector<GameElementIdentifier> elements)
           
 void elementsEligibleToPaint(Player p, java.util.Vector<GameElementIdentifier> elements)
           
 void elementsRequiredToMove(Player p, java.util.Vector<GameElementIdentifier> elements)
           
 void firingPhaseCompleted()
           
 void firingPlayerSelectionRequired(CenturionGameSide side, java.util.Vector<Player> list)
           
 void firingRoundCompleted()
           
 void firingRoundStarted(CenturionFiringRound round)
           
 void gameElementDamaged(GameElementDamageSummary geds)
           
 void gameElementFiring(GameElementFiringSummary gefs)
           
 void gameElementMoved(GameElementMovementSummary gems)
           
 void gameElementPainting(GameElementPaintingSummary geps)
           
 java.lang.String getGameTypeName()
           
 void initiativeResult(CenturionGameSide winner, CenturionGameSide loser)
           
 void movementPhaseCompleted()
           
 void movementRoundCompleted()
           
 void movementRoundStarted(CenturionMovementRound round)
           
 void opportunityFire(Player p, GameElementIdentifier firer, GameElementIdentifier target)
           
 void opportunityFireResponsesRequired(Player p, java.util.HashMap<GameElementIdentifier,java.util.Vector<GameElementIdentifier>> firersAndTargets)
           
 void paintingPhaseCompleted()
           
 void paintingPlayerSelectionRequired(CenturionGameSide side, java.util.Vector<Player> list)
           
 void paintingRoundCompleted()
           
 void paintingRoundStarted(CenturionPaintingRound round)
           
 void phaseChange(java.lang.String phaseName, java.lang.String subPhaseName)
          Lets the clients know that there is a new phase/subphase
 void playerFiringAttempts(Player p, java.util.Vector<FireAttemptRecord> attempts)
           
 void playerPaintingAttempts(Player p, java.util.Vector<FireAttemptRecord> attempts)
           
 void pointDefenceAllocationRequired(Player p, PointDefenceAllocation pda)
           
 void queryCommandPointAdvantageAllocation()
           
 void selectMovementTeamOrder(CenturionGameSide initiativeWinner)
           
 void teamAFiringRoundComplete()
           
 void teamAMovementRoundComplete()
           
 void teamAPaintingRoundComplete()
           
 void turnCompleted(CenturionGameTurn turn)
          Lets the clients know this turn is complete
 void turnStarted(CenturionGameTurn turn)
          Lets the clients know this turn has started
 void unitSelectionRequired(CenturionGameSide side, java.util.Vector<UnitIdentifier> list)
           
 
Methods inherited from class rl.server.game.GameServer
addConnection, addListener, addObserverToGame, broadcastCommand, disconnected, elementNoLongerVisible, elementPlacementComplete, elementRemoved, elementVisible, gameDrawn, gameLost, gamePhase, gameWon, getCurrentTurn, getName, getStatus, getType, hasBeenAbandoned, isConnected, isReadyForConnection, log, notifyServerStatusChanged, observersAllowed, playerAdded, playerRemoved, postCommand, raceSelectionAllowed, registerHandler, removeConnection, removeListener, removeObserverFromGame, removePlayerFromGame, sendCurrentParticipants, sendGameSides, sendParticipationSelection, setGame, setName, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface rl.centurion.game.CenturionGameListener
elementNoLongerVisible, elementRemoved, elementVisible
 

Constructor Detail

CenturionGameServer

public CenturionGameServer(java.lang.String name,
                           java.lang.String type)
Method Detail

getGameTypeName

public java.lang.String getGameTypeName()
Specified by:
getGameTypeName in class GameServer

canConnect

protected boolean canConnect()
returns true if other players than the admin player are allowed to connect

Specified by:
canConnect in class GameServer

boardLoaded

public void boardLoaded()
Specified by:
boardLoaded in interface CenturionGameListener

commanderSelected

public void commanderSelected(CenturionGameSide side,
                              Commander commander)
Description copied from interface: CenturionGameListener
Called when a commander has been selected for a side

Specified by:
commanderSelected in interface CenturionGameListener
Parameters:
side - The game side the commander belongs to
commander - Commander that was selected as overall force commander

commandPointAdvantage

public void commandPointAdvantage(CenturionGameSide side)
Sends the calculated Command Point Advantage to the side

Specified by:
commandPointAdvantage in interface CenturionGameListener

commanderToBeSelected

public void commanderToBeSelected(CenturionGameSide side,
                                  java.util.Vector<Commander> commanders)
Description copied from interface: CenturionGameListener
Called when there is more than one commander available for a side.

Specified by:
commanderToBeSelected in interface CenturionGameListener
Parameters:
side - The game side the decision has to be made for
commanders - List of available Commanders to choose from.

initiativeResult

public void initiativeResult(CenturionGameSide winner,
                             CenturionGameSide loser)
Specified by:
initiativeResult in interface CenturionGameTurnListener

selectMovementTeamOrder

public void selectMovementTeamOrder(CenturionGameSide initiativeWinner)
Specified by:
selectMovementTeamOrder in interface CenturionGameTurnListener

phaseChange

public void phaseChange(java.lang.String phaseName,
                        java.lang.String subPhaseName)
Lets the clients know that there is a new phase/subphase

Specified by:
phaseChange in interface CenturionGameTurnListener

turnStarted

public void turnStarted(CenturionGameTurn turn)
Lets the clients know this turn has started

Specified by:
turnStarted in interface CenturionGameListener
Specified by:
turnStarted in interface CenturionGameTurnListener

turnCompleted

public void turnCompleted(CenturionGameTurn turn)
Lets the clients know this turn is complete

Specified by:
turnCompleted in interface CenturionGameListener
Specified by:
turnCompleted in interface CenturionGameTurnListener

queryCommandPointAdvantageAllocation

public void queryCommandPointAdvantageAllocation()
Specified by:
queryCommandPointAdvantageAllocation in interface CenturionGameTurnListener

movementRoundStarted

public void movementRoundStarted(CenturionMovementRound round)
Specified by:
movementRoundStarted in interface CenturionGameTurnListener

paintingRoundStarted

public void paintingRoundStarted(CenturionPaintingRound round)
Specified by:
paintingRoundStarted in interface CenturionGameTurnListener

elementPainted

public void elementPainted(SuccessfulPaint sp)
Specified by:
elementPainted in interface CenturionGameTurnListener

playerPaintingAttempts

public void playerPaintingAttempts(Player p,
                                   java.util.Vector<FireAttemptRecord> attempts)
Specified by:
playerPaintingAttempts in interface CenturionGameTurnListener

firingRoundStarted

public void firingRoundStarted(CenturionFiringRound round)
Specified by:
firingRoundStarted in interface CenturionGameTurnListener

playerFiringAttempts

public void playerFiringAttempts(Player p,
                                 java.util.Vector<FireAttemptRecord> attempts)
Specified by:
playerFiringAttempts in interface CenturionGameTurnListener

gameElementMoved

public void gameElementMoved(GameElementMovementSummary gems)
Specified by:
gameElementMoved in interface CenturionGameTurnListener

gameElementPainting

public void gameElementPainting(GameElementPaintingSummary geps)
Specified by:
gameElementPainting in interface CenturionGameTurnListener

gameElementFiring

public void gameElementFiring(GameElementFiringSummary gefs)
Specified by:
gameElementFiring in interface CenturionGameTurnListener

gameElementDamaged

public void gameElementDamaged(GameElementDamageSummary geds)
Specified by:
gameElementDamaged in interface CenturionGameTurnListener

opportunityFireResponsesRequired

public void opportunityFireResponsesRequired(Player p,
                                             java.util.HashMap<GameElementIdentifier,java.util.Vector<GameElementIdentifier>> firersAndTargets)
Specified by:
opportunityFireResponsesRequired in interface CenturionGameTurnListener

opportunityFire

public void opportunityFire(Player p,
                            GameElementIdentifier firer,
                            GameElementIdentifier target)
Specified by:
opportunityFire in interface CenturionGameTurnListener

pointDefenceAllocationRequired

public void pointDefenceAllocationRequired(Player p,
                                           PointDefenceAllocation pda)
Specified by:
pointDefenceAllocationRequired in interface CenturionGameTurnListener

unitSelectionRequired

public void unitSelectionRequired(CenturionGameSide side,
                                  java.util.Vector<UnitIdentifier> list)
Specified by:
unitSelectionRequired in interface CenturionMovementRoundListener

teamAMovementRoundComplete

public void teamAMovementRoundComplete()
Specified by:
teamAMovementRoundComplete in interface CenturionMovementRoundListener

movementRoundCompleted

public void movementRoundCompleted()
Specified by:
movementRoundCompleted in interface CenturionMovementRoundListener

movementPhaseCompleted

public void movementPhaseCompleted()
Specified by:
movementPhaseCompleted in interface CenturionMovementRoundListener

elementsRequiredToMove

public void elementsRequiredToMove(Player p,
                                   java.util.Vector<GameElementIdentifier> elements)
Specified by:
elementsRequiredToMove in interface CenturionMovementRoundListener

elementMoved

public void elementMoved(Player p,
                         GameElementIdentifier element)
Specified by:
elementMoved in interface CenturionMovementRoundListener

paintingPlayerSelectionRequired

public void paintingPlayerSelectionRequired(CenturionGameSide side,
                                            java.util.Vector<Player> list)
Specified by:
paintingPlayerSelectionRequired in interface CenturionPaintingRoundListener

elementsEligibleToPaint

public void elementsEligibleToPaint(Player p,
                                    java.util.Vector<GameElementIdentifier> elements)
Specified by:
elementsEligibleToPaint in interface CenturionPaintingRoundListener

teamAPaintingRoundComplete

public void teamAPaintingRoundComplete()
Specified by:
teamAPaintingRoundComplete in interface CenturionPaintingRoundListener

paintingRoundCompleted

public void paintingRoundCompleted()
Specified by:
paintingRoundCompleted in interface CenturionPaintingRoundListener

paintingPhaseCompleted

public void paintingPhaseCompleted()
Specified by:
paintingPhaseCompleted in interface CenturionPaintingRoundListener

elementPainting

public void elementPainting(GameElementIdentifier element,
                            GameElementIdentifier target,
                            boolean roundComplete)
Specified by:
elementPainting in interface CenturionPaintingRoundListener

firingPlayerSelectionRequired

public void firingPlayerSelectionRequired(CenturionGameSide side,
                                          java.util.Vector<Player> list)
Specified by:
firingPlayerSelectionRequired in interface CenturionFiringRoundListener

elementsEligibleToFire

public void elementsEligibleToFire(Player p,
                                   java.util.Vector<GameElementIdentifier> elements)
Specified by:
elementsEligibleToFire in interface CenturionFiringRoundListener

teamAFiringRoundComplete

public void teamAFiringRoundComplete()
Specified by:
teamAFiringRoundComplete in interface CenturionFiringRoundListener

firingRoundCompleted

public void firingRoundCompleted()
Specified by:
firingRoundCompleted in interface CenturionFiringRoundListener

firingPhaseCompleted

public void firingPhaseCompleted()
Specified by:
firingPhaseCompleted in interface CenturionFiringRoundListener

elementFiring

public void elementFiring(GameElementIdentifier element,
                          GameElementIdentifier target)
Specified by:
elementFiring in interface CenturionFiringRoundListener

elementFiringComplete

public void elementFiringComplete(GameElementIdentifier element,
                                  boolean roundComplete)
Specified by:
elementFiringComplete in interface CenturionFiringRoundListener