public abstract class AbstractUT2004Server<WORLD_VIEW extends IWorldView,ACT extends IAct> extends AbstractWorldServer<WORLD_VIEW,ACT,IUT2004Bot> implements IUT2004Server
It counts with GameBots2004 protocol therefore taking care of:
Also introducing user-method for setting up custom worldview listeners that is called before Ready message is sent - prePrepareServer().
You may use setPassword() method to specify the password before starting the agent.
worldAddressevents, INTROSPECTION_ROOT_NAME, log, LOG_CATEGORY_NAME| Constructor and Description |
|---|
AbstractUT2004Server(IAgentId agentId,
IAgentLogger agentLogger,
IComponentBus bus,
SocketConnection connection,
WORLD_VIEW worldView,
ACT act) |
| Modifier and Type | Method and Description |
|---|---|
void |
connectNativeBot(String botName,
String botType,
int team)
Connects a UT native bot to the current map.
|
protected PasswordReply |
createPasswordReply()
This method is called whenever the Password event is caught telling us
the world is locked and is requiring a password.
|
cz.cuni.amis.utils.collections.ObservableCollection<IUT2004Bot> |
getAgents() |
Collection<MapList> |
getAvailableMaps() |
GameInfo |
getGameInfo() |
cz.cuni.amis.utils.flag.Flag<Double> |
getGameSpeedFlag()
The flag raises events even when the game speed was changed by another
UTServer instance or directly in game.
|
UT2004Map |
getMap()
Get current map from the server
|
String |
getMapName() |
List<Mutator> |
getMutators()
Reeturns list of all mutators available on the server.
|
cz.cuni.amis.utils.collections.ObservableCollection<? extends NativeUT2004BotAdapter> |
getNativeAgents()
Returns list of all non pogamut players connected to the game server.
|
PasswordReply |
getPasswordReply()
Instance of the password reply command that was sent upon receivieng
request for the password (the world is locked).
|
cz.cuni.amis.utils.collections.ObservableCollection<Player> |
getPlayers()
Returns list of all players connected to the game server.
|
WORLD_VIEW |
getWorldView() |
protected void |
killAgent() |
protected void |
readyCommandRequested()
This method is called whenever HelloBot message is parsed - the
GameBots2004 is awaiting the bot to reply with Ready command to begin the
handshake.
|
protected void |
reset()
Called during stop/kill/reset events.
|
protected void |
resetAgent() |
void |
setAddress(String host,
int port)
Sets the address of the server to different location - does not automatically reconnect,
use
IAgent.stop() and IAgent.start(). |
void |
setPassword(String password)
Specify the password that should be used if required by the world.
|
protected void |
startAgent() |
protected void |
startPausedAgent() |
protected void |
stopAgent() |
getWorldAddressgetActaddDependency, 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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitsetGameMapconnectNativeBotgetWorldAddressgetActgetComponentId, getIntrospection, getLogger, getName, getState, kill, pause, resume, start, startPaused, stopgetEventBus@Inject public AbstractUT2004Server(IAgentId agentId, IAgentLogger agentLogger, IComponentBus bus, SocketConnection connection, WORLD_VIEW worldView, ACT act)
public void setAddress(String host, int port)
IUT2004ServerIAgent.stop() and IAgent.start().setAddress in interface IUnrealServer<IUT2004Bot>setAddress in interface IUT2004Serverpublic void setPassword(String password)
password - protected void readyCommandRequested()
public PasswordReply getPasswordReply()
If null the password was not required by the time the bot connected to the world.
protected PasswordReply createPasswordReply()
May return null - in that case an empty password is sent to the server (which will probably result in closing the connection and termination of the agent).
This message is then saved to private field passwordReply and is accessible via getPasswordReply() method if required to be probed during the bot's runtime.
Note that if setPassword() method is called before this one it will use provided password via that method.
public GameInfo getGameInfo()
public WORLD_VIEW getWorldView()
getWorldView in interface IObservingAgentgetWorldView in class AbstractObservingAgent<WORLD_VIEW extends IWorldView>public Collection<MapList> getAvailableMaps()
getAvailableMaps in interface IUnrealServer<IUT2004Bot>getAvailableMaps in interface IUT2004Serverpublic cz.cuni.amis.utils.flag.Flag<Double> getGameSpeedFlag()
IUT2004ServergetGameSpeedFlag in interface IUnrealServer<IUT2004Bot>getGameSpeedFlag in interface IUT2004Serverpublic String getMapName()
getMapName in interface IUnrealServer<IUT2004Bot>getMapName in interface IUT2004Serverpublic cz.cuni.amis.utils.collections.ObservableCollection<Player> getPlayers()
IUT2004Server
Custom-bots (created by Pogamut platform) can be recognized. They have non-null+non-empty Player.getJmx() field.
getPlayers in interface IUnrealServer<IUT2004Bot>getPlayers in interface IUT2004Serverpublic List<Mutator> getMutators()
IUT2004ServergetMutators in interface IUnrealServer<IUT2004Bot>getMutators in interface IUT2004Serverpublic cz.cuni.amis.utils.collections.ObservableCollection<IUT2004Bot> getAgents()
getAgents in interface IWorldAgentsObserver<IUT2004Bot>public cz.cuni.amis.utils.collections.ObservableCollection<? extends NativeUT2004BotAdapter> getNativeAgents()
IUT2004ServergetNativeAgents in interface IUnrealServer<IUT2004Bot>getNativeAgents in interface IUT2004Serverpublic void connectNativeBot(String botName, String botType, int team)
IUT2004ServerconnectNativeBot in interface IUT2004Serverpublic UT2004Map getMap()
IUT2004ServergetMap in interface IUnrealServer<IUT2004Bot>getMap in interface IUT2004Serverprotected void reset()
protected void resetAgent()
resetAgent in class AbstractAgentprotected void stopAgent()
stopAgent in class AbstractAgentprotected void killAgent()
killAgent in class AbstractAgentprotected void startAgent()
startAgent in class AbstractAgentprotected void startPausedAgent()
startPausedAgent in class AbstractAgentCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.