public class UT2004Server extends AbstractUT2004Server<UT2004WorldView,IAct> implements IUT2004Server
Modifier and Type | Class and Description |
---|---|
class |
UT2004Server.MapChangeFuture |
Modifier and Type | Field and Description |
---|---|
protected boolean |
changingMap |
protected int |
changingMapAttempt |
protected Object |
changingMapMutex |
static int |
MAP_CHANGE_CONNECT_INTERVAL_MILLIS |
protected UT2004Server.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 |
worldAddress
events, INTROSPECTION_ROOT_NAME, log, LOG_CATEGORY_NAME
Constructor and Description |
---|
UT2004Server(UT2004AgentParameters params,
IAgentLogger agentLogger,
IComponentBus bus,
SocketConnection connection,
UT2004WorldView worldView,
IAct act) |
Modifier and Type | Method and Description |
---|---|
void |
connectNativeBot(String botName,
String botType) |
UT2004AgentParameters |
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)
Method that initiates map-change.
|
protected void |
startAgent() |
protected void |
startPausedAgent() |
connectNativeBot, createPasswordReply, getAgents, getAvailableMaps, getGameInfo, getGameSpeedFlag, getMap, getMapName, getMutators, getNativeAgents, getPasswordReply, getPlayers, getWorldView, killAgent, readyCommandRequested, resetAgent, setAddress, setPassword, stopAgent
getWorldAddress
getAct
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, stop, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
connectNativeBot, getAvailableMaps, getGameSpeedFlag, getMap, getMapName, getMutators, getNativeAgents, getPlayers, setAddress
getWorldAddress
getAgents
getAct
getWorldView
getComponentId, getIntrospection, getLogger, getName, getState, kill, pause, resume, start, startPaused, stop
getEventBus
public static final int MAX_CHANGING_MAP_ATTEMPTS
public static final int MAP_CHANGE_CONNECT_INTERVAL_MILLIS
protected IWorldEventListener<PlayerJoinsGame> playerJoinsListener
protected IWorldEventListener<MapListObtained> mapListListener
protected Object changingMapMutex
protected boolean changingMap
protected int changingMapAttempt
protected String targetMap
protected UT2004Server.MapChangeFuture mapChangeFuture
@Inject public UT2004Server(UT2004AgentParameters params, IAgentLogger agentLogger, IComponentBus bus, SocketConnection connection, UT2004WorldView worldView, IAct act)
public UT2004AgentParameters getParams()
This is a great place to parametrize your agent. Note that you may pass arbitrary subclass of UT2004AgentParameters
to the constructor/factory/runner and pick them up here.
protected void startAgent()
startAgent
in class AbstractUT2004Server<UT2004WorldView,IAct>
protected void startPausedAgent()
startPausedAgent
in class AbstractUT2004Server<UT2004WorldView,IAct>
protected void reset()
AbstractUT2004Server
reset
in class AbstractUT2004Server<UT2004WorldView,IAct>
public Future<Boolean> setGameMap(String map) throws MapChangeException
IUT2004Server
Note that the object must restart itself in order to reconnect to the new server.
setGameMap
in interface IUnrealServer<IUT2004Bot>
setGameMap
in interface IUT2004Server
MapChangeException
public void connectNativeBot(String botName, String botType)
connectNativeBot
in interface IUnrealServer<IUT2004Bot>
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.