|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
cz.cuni.amis.pogamut.base.agent.impl.AbstractObservingAgent<WORLD_VIEW>
cz.cuni.amis.pogamut.base.agent.impl.AbstractGhostAgent<WORLD_VIEW,ACT>
cz.cuni.amis.pogamut.base.server.AbstractWorldServer<WORLD_VIEW,ACT,IUDKBot>
cz.cuni.amis.pogamut.udk.server.impl.AbstractUDKServer<WORLD_VIEW,ACT>
public abstract class AbstractUDKServer<WORLD_VIEW extends cz.cuni.amis.pogamut.base.communication.worldview.IWorldView,ACT extends cz.cuni.amis.pogamut.base.communication.command.IAct>
Abstract class - ancestor of all UT2004 server controls.
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.
| Field Summary |
|---|
| 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 | |
|---|---|
AbstractUDKServer(cz.cuni.amis.pogamut.base.agent.IAgentId agentId,
cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger agentLogger,
cz.cuni.amis.pogamut.base.component.bus.IComponentBus bus,
cz.cuni.amis.pogamut.base.communication.connection.impl.socket.SocketConnection connection,
WORLD_VIEW worldView,
ACT act)
|
|
| Method Summary | |
|---|---|
void |
connectNativeBot(String botName,
String botType)
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<IUDKBot> |
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. |
UDKMap |
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 NativeUDKBotAdapter> |
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 |
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 |
|---|
setGameMap |
| Methods inherited from interface cz.cuni.amis.pogamut.base.server.IWorldServer |
|---|
getWorldAddress |
| Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IGhostAgent |
|---|
getAct |
| 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 |
| Constructor Detail |
|---|
@Inject
public AbstractUDKServer(cz.cuni.amis.pogamut.base.agent.IAgentId agentId,
cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger agentLogger,
cz.cuni.amis.pogamut.base.component.bus.IComponentBus bus,
cz.cuni.amis.pogamut.base.communication.connection.impl.socket.SocketConnection connection,
WORLD_VIEW worldView,
ACT act)
| Method Detail |
|---|
public void setAddress(String host,
int port)
IUDKServerIAgent.stop() and IAgent.start().
setAddress in interface IUDKServersetAddress in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>public 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 cz.cuni.amis.pogamut.base.agent.IObservingAgentgetWorldView in class cz.cuni.amis.pogamut.base.agent.impl.AbstractObservingAgent<WORLD_VIEW extends cz.cuni.amis.pogamut.base.communication.worldview.IWorldView>public Collection<MapList> getAvailableMaps()
getAvailableMaps in interface IUDKServergetAvailableMaps in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>public cz.cuni.amis.utils.flag.Flag<Double> getGameSpeedFlag()
IUDKServer
getGameSpeedFlag in interface IUDKServergetGameSpeedFlag in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>public String getMapName()
getMapName in interface IUDKServergetMapName in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>public cz.cuni.amis.utils.collections.ObservableCollection<Player> getPlayers()
IUDKServer
getPlayers in interface IUDKServergetPlayers in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>public List<Mutator> getMutators()
IUDKServer
getMutators in interface IUDKServergetMutators in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>public cz.cuni.amis.utils.collections.ObservableCollection<IUDKBot> getAgents()
getAgents in interface cz.cuni.amis.pogamut.base.server.IWorldAgentsObserver<IUDKBot>public cz.cuni.amis.utils.collections.ObservableCollection<? extends NativeUDKBotAdapter> getNativeAgents()
IUDKServer
getNativeAgents in interface IUDKServergetNativeAgents in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>
public void connectNativeBot(String botName,
String botType)
IUDKServer
connectNativeBot in interface IUDKServerconnectNativeBot in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>public UDKMap getMap()
IUDKServer
getMap in interface IUDKServergetMap in interface cz.cuni.amis.pogamut.unreal.server.IUnrealServer<IUDKBot>protected void reset()
protected void resetAgent()
resetAgent in class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgentprotected void stopAgent()
stopAgent in class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgentprotected void killAgent()
killAgent in class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgentprotected void startAgent()
startAgent in class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||