cz.cuni.amis.pogamut.udk.server.impl
Class UDKServer

Package class diagram package UDKServer
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
      extended by cz.cuni.amis.pogamut.base.agent.impl.AbstractObservingAgent<WORLD_VIEW>
          extended by cz.cuni.amis.pogamut.base.agent.impl.AbstractGhostAgent<WORLD_VIEW,ACT>
              extended by cz.cuni.amis.pogamut.base.server.AbstractWorldServer<WORLD_VIEW,ACT,IUDKBot>
                  extended by cz.cuni.amis.pogamut.udk.server.impl.AbstractUDKServer<UDKWorldView,IAct>
                      extended by cz.cuni.amis.pogamut.udk.server.impl.UDKServer
All Implemented Interfaces:
IAgent, IGhostAgent, IObservingAgent, IComponent, IComponentAware, IControllable, IWorldAgentsObserver<IUDKBot>, IWorldServer<IUDKBot>, IUDKServer, IUnrealServer<IUDKBot>

public class UDKServer
extends AbstractUDKServer<UDKWorldView,IAct>
implements IUDKServer


Nested Class Summary
 class UDKServer.MapChangeFuture
           
 
Field Summary
protected  boolean changingMap
           
protected  int changingMapAttempt
           
protected  Object changingMapMutex
           
static int MAP_CHANGE_CONNECT_INTERVAL_MILLIS
           
protected  UDKServer.MapChangeFuture mapChangeFuture
           
protected  IWorldEventListener<MapListObtained> mapListListener
           
static int MAX_CHANGING_MAP_ATTEMPTS
          How many times we're going to try to connect to the GB2004 before declaring that the change-map has failed.
protected  IWorldEventListener<PlayerJoinsGame> playerJoinsListener
           
protected  String targetMap
           
 
Fields inherited from class cz.cuni.amis.pogamut.base.server.AbstractWorldServer
worldAddress
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
events, INTROSPECTION_ROOT_NAME, log, LOG_CATEGORY_NAME
 
Constructor Summary
UDKServer(UDKAgentParameters params, IAgentLogger agentLogger, IComponentBus bus, SocketConnection connection, UDKWorldView worldView, IAct act)
           
 
Method Summary
 UDKAgentParameters getParams()
          Returns parameters that were passed into the agent during the construction.
protected  void reset()
          Called during stop/kill/reset events.
 Future<Boolean> setGameMap(String map)
          As of now, this just plain does not work.
protected  void startAgent()
           
 
Methods inherited from class cz.cuni.amis.pogamut.udk.server.impl.AbstractUDKServer
connectNativeBot, createPasswordReply, getAgents, getAvailableMaps, getGameInfo, getGameSpeedFlag, getMap, getMapName, getMutators, getNativeAgents, getPasswordReply, getPlayers, getWorldView, killAgent, readyCommandRequested, resetAgent, setAddress, setPassword, stopAgent
 
Methods inherited from class cz.cuni.amis.pogamut.base.server.AbstractWorldServer
getWorldAddress
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractGhostAgent
getAct
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
addDependency, addDependency, addDependency, addJMXComponents, awaitState, awaitState, componentFatalError, componentStarted, componentStarted, componentStopped, componentStopping, createAgentJMX, createIntrospection, equals, getComponentId, getEventBus, getIntrospection, getJMX, getLog, getLogger, getName, getState, hashCode, inState, kill, notInState, pause, pauseAgent, preKillAgent, preStopAgent, resetEvent, resume, resumeAgent, setState, start, startPaused, startPausedAgent, stop, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.udk.server.IUDKServer
connectNativeBot, getAvailableMaps, getGameSpeedFlag, getMap, getMapName, getMutators, getNativeAgents, getPlayers, setAddress
 
Methods inherited from interface cz.cuni.amis.pogamut.base.server.IWorldServer
getWorldAddress
 
Methods inherited from interface cz.cuni.amis.pogamut.base.server.IWorldAgentsObserver
getAgents
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IGhostAgent
getAct
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IObservingAgent
getWorldView
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IAgent
getComponentId, getIntrospection, getLogger, getName, getState, kill, pause, resume, start, startPaused, stop
 
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponentAware
getEventBus
 

Field Detail

MAX_CHANGING_MAP_ATTEMPTS

public static final int MAX_CHANGING_MAP_ATTEMPTS
How many times we're going to try to connect to the GB2004 before declaring that the change-map has failed.

See Also:
Constant Field Values

MAP_CHANGE_CONNECT_INTERVAL_MILLIS

public static final int MAP_CHANGE_CONNECT_INTERVAL_MILLIS
See Also:
Constant Field Values

playerJoinsListener

protected IWorldEventListener<PlayerJoinsGame> playerJoinsListener

mapListListener

protected IWorldEventListener<MapListObtained> mapListListener

changingMapMutex

protected Object changingMapMutex

changingMap

protected boolean changingMap

changingMapAttempt

protected int changingMapAttempt

targetMap

protected String targetMap

mapChangeFuture

protected UDKServer.MapChangeFuture mapChangeFuture
Constructor Detail

UDKServer

@Inject
public UDKServer(UDKAgentParameters params,
                        IAgentLogger agentLogger,
                        IComponentBus bus,
                        SocketConnection connection,
                        UDKWorldView worldView,
                        IAct act)
Method Detail

getParams

public UDKAgentParameters getParams()
Returns parameters that were passed into the agent during the construction.

This is a great place to parametrize your agent. Note that you may pass arbitrary subclass of UDKAgentParameters to the constructor/factory/runner and pick them up here.

Returns:
parameters

startAgent

protected void startAgent()
Overrides:
startAgent in class AbstractUDKServer<UDKWorldView,IAct>

reset

protected void reset()
Description copied from class: AbstractUDKServer
Called during stop/kill/reset events.

Overrides:
reset in class AbstractUDKServer<UDKWorldView,IAct>

setGameMap

public Future<Boolean> setGameMap(String map)
                           throws MapChangeException
As of now, this just plain does not work. If you started the server yourself, you may use UCCWrapper#changeMap(java.lang.String, long) which works.

Specified by:
setGameMap in interface IUDKServer
Specified by:
setGameMap in interface IUnrealServer<IUDKBot>
Parameters:
map -
Returns:
Throws:
MapChangeException


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.