cz.cuni.pogamut.server
Interface UTWorld

All Known Implementing Classes:
UTServer

public interface UTWorld


Method Summary
 void addBotEnteredWorldListener(BotEnteredWorldListener listener)
          Add listener to the bot-enetered-the-world event.
 void addBotLeftWorldListener(BotLeftWorldListener listener)
          Add listener to the bot-left-the-world event.
 void addInventory(java.lang.String botUnrealId, java.lang.String inventoryClass)
          Adds the item to the bot's inventory.
 void botAutoTrace(java.lang.String botUnrealId, boolean autoTrace)
          TODO: comment
 void botInvulnerable(java.lang.String botUnrealId, boolean invulnerable)
          According to param 'invulnerable' sets (or retract) the invulnerability of the specified bot.
 void botManualSpawn(java.lang.String botUnrealId, boolean manualSpawn)
          TODO: comment
 java.lang.String connectBot(Agent newBot)
          Connects new == NEVER STARTED agent to the world.
 java.lang.String connectBot(Agent newBot, java.lang.String botName)
          Connects new == NEVER STARTED agent to the world.
 void connectOriginalBot(java.lang.String unrealID, Triple location, int difficultyLevel, int team)
          Spawns the original UT bot.
 void disconnectAllBots()
          Disconnect all bots from the world.
 void disconnectBot(Agent bot)
          Disconnect the bot from the world
 void disconnectBot(java.lang.String botUnrealId)
          Disconnect the bot from the world
 java.util.Collection<Player> getAllBots()
          Returns list of players inside the world.
 java.util.Collection<UTMap> getAvailableMaps()
          Returns names of maps available for current game in UT.
 java.util.Collection<Agent> getConnectedBots()
           
 java.util.Map<java.lang.String,Item> getInventory()
           
 java.util.Collection<Item> getItems()
          Returns list of items, which are present in the world.
 java.lang.String getMap()
          Returns name of the map which is loaded into UT2004.
 java.lang.String getName()
          Returns human-readable identification of the server.
 java.util.Collection<NavPoint> getNavPoints()
          Returns list of navpoints, which are present in the world.
 Flag<UTServerState> getServerStateFlag()
          Returns flag with the state of server.
 void changeAttribute(java.lang.String botUnrealId, java.lang.String attribute, java.lang.String value)
          Changes the bot's attribute value to a specified value.
 boolean isConnectionAlive()
          Whether the connection is OK (healthy ;-).
 void kickBot(java.lang.String botUnrealId)
          Kick bot from the game.
 Agent loadAgent(java.lang.String fullyClassifiedClassName)
          Loads and instantiate a new agent object.
 java.lang.Class loadAgentClass(java.lang.String fullyClassifiedClassName)
          Returns class of the required agent - special class loader is used.
 void pause(boolean completely)
          Pause the world.
 void removeBotEnteredWorldListener(BotEnteredWorldListener listener)
          Remove listener to the bot-enetered-the-world event.
 void removeBotLeftWorldListener(BotLeftWorldListener listener)
          Remove listener to the bot-left-the-world event.
 void respawnBot(java.lang.String botUnrealId)
          Respawns specified bot at random place.
 void respawnBot(java.lang.String botUnrealId, Triple location)
          Respawns specified bot at specified location.
 void resume()
          Resume the world;
 void setBotName(java.lang.String botUnrealId, java.lang.String name)
          TODO: comment
 void setGameSpeed(double speed)
          Sets game speed of UT2004.
 boolean setMap(java.lang.String name)
          Sets the map of the UT2004, NO BLOCK
 boolean setMapAndWait(java.lang.String name)
          Will send command to change the map IFF it's not the one that is currently running.
 void setVisionTime(double visionTime)
          Set vision time... whatever it is.
 void startRecording(java.lang.String fileName)
          Starts recording of the "replay" to a specified file at server.
 void stopRecording()
          Stops recording of the "replay".
 

Method Detail

isConnectionAlive

boolean isConnectionAlive()
Whether the connection is OK (healthy ;-).

Returns:
connection is alive

getName

java.lang.String getName()
Returns human-readable identification of the server.

Returns:
human-readable identification of the server

getServerStateFlag

Flag<UTServerState> getServerStateFlag()
Returns flag with the state of server.

Returns:

addBotEnteredWorldListener

void addBotEnteredWorldListener(BotEnteredWorldListener listener)
Add listener to the bot-enetered-the-world event.

Parameters:
listener -

removeBotEnteredWorldListener

void removeBotEnteredWorldListener(BotEnteredWorldListener listener)
Remove listener to the bot-enetered-the-world event.

Parameters:
listener -

addBotLeftWorldListener

void addBotLeftWorldListener(BotLeftWorldListener listener)
Add listener to the bot-left-the-world event.

Parameters:
listener -

removeBotLeftWorldListener

void removeBotLeftWorldListener(BotLeftWorldListener listener)
Remove listener to the bot-left-the-world event.

Parameters:
listener -

getMap

java.lang.String getMap()
Returns name of the map which is loaded into UT2004.

Returns:
String name of the map

setMap

boolean setMap(java.lang.String name)
               throws PogamutException
Sets the map of the UT2004, NO BLOCK

Returns:
true if succeeded
Throws:
PogamutException

setMapAndWait

boolean setMapAndWait(java.lang.String name)
                      throws PogamutException
Will send command to change the map IFF it's not the one that is currently running. After that it will take care not to connect to the server with the same map again. Block until connection to server with specified map name is made or until it fails to change the map.

Parameters:
mapName -
Throws:
PogamutException

getAvailableMaps

java.util.Collection<UTMap> getAvailableMaps()
                                             throws PogamutException
Returns names of maps available for current game in UT.

Returns:
available maps names
Throws:
PogamutException

getNavPoints

java.util.Collection<NavPoint> getNavPoints()
                                            throws PogamutException
Returns list of navpoints, which are present in the world.

Returns:
list of all navpoints in the world
Throws:
PogamutException

getItems

java.util.Collection<Item> getItems()
                                    throws PogamutException
Returns list of items, which are present in the world.

Returns:
list of items, which are present in the world
Throws:
PogamutException

getAllBots

java.util.Collection<Player> getAllBots()
                                        throws PogamutException
Returns list of players inside the world. Probably will take some time to resolve as it needs to do the round trip between the class and GameBots (UT2004).

Returns:
list of players in the game
Throws:
PogamutException

getConnectedBots

java.util.Collection<Agent> getConnectedBots()
Returns:
agents connected via this class (which implements this).

getInventory

java.util.Map<java.lang.String,Item> getInventory()
Returns:
list of items that can be added to the bot's inventory

connectBot

java.lang.String connectBot(Agent newBot)
                            throws PogamutException
Connects new == NEVER STARTED agent to the world. Note that you have to create new instance of agent if you want to connect agent of the same class to the world.

Parameters:
newBot -
Returns:
name of the bot inside UT2004
Throws:
PogamutException

connectBot

java.lang.String connectBot(Agent newBot,
                            java.lang.String botName)
                            throws PogamutException
Connects new == NEVER STARTED agent to the world. Note that you have to create new instance of agent if you want to connect agent of the same class to the world. Agent is given a name as specified.

Parameters:
newBot -
botName -
Returns:
name of the bot inside UT2004
Throws:
PogamutException

connectOriginalBot

void connectOriginalBot(java.lang.String unrealID,
                        Triple location,
                        int difficultyLevel,
                        int team)
                        throws PogamutException
Spawns the original UT bot.

Parameters:
unrealID - identificator of the bot class inside UT
location -
difficultyLevel -
team -
Throws:
PogamutException

respawnBot

void respawnBot(java.lang.String botUnrealId)
                throws PogamutException
Respawns specified bot at random place.

Parameters:
botUnrealId -
Throws:
PogamutException

respawnBot

void respawnBot(java.lang.String botUnrealId,
                Triple location)
                throws PogamutException
Respawns specified bot at specified location.

Parameters:
botUnrealId -
location -
Throws:
PogamutException

kickBot

void kickBot(java.lang.String botUnrealId)
             throws PogamutException
Kick bot from the game.

Parameters:
botUnrealId - Id of bot we want to kick from the game
Throws:
PogamutException

disconnectBot

void disconnectBot(java.lang.String botUnrealId)
Disconnect the bot from the world

Parameters:
botUnrealId -

disconnectBot

void disconnectBot(Agent bot)
Disconnect the bot from the world

Parameters:
bot -

disconnectAllBots

void disconnectAllBots()
Disconnect all bots from the world.


pause

void pause(boolean completely)
           throws PogamutException
Pause the world. Completely == true ... pause the spectator as well.

Parameters:
completely -
Throws:
PogamutException

resume

void resume()
            throws PogamutException
Resume the world;

Throws:
PogamutException

setVisionTime

void setVisionTime(double visionTime)
                   throws PogamutException
Set vision time... whatever it is.

Throws:
PogamutException

addInventory

void addInventory(java.lang.String botUnrealId,
                  java.lang.String inventoryClass)
                  throws PogamutException
Adds the item to the bot's inventory.

Parameters:
botUnrealId -
inventoryClass -
Throws:
PogamutException

changeAttribute

void changeAttribute(java.lang.String botUnrealId,
                     java.lang.String attribute,
                     java.lang.String value)
                     throws PogamutException
Changes the bot's attribute value to a specified value.

Parameters:
botUnrealId -
attribute -
value -
Throws:
PogamutException

botInvulnerable

void botInvulnerable(java.lang.String botUnrealId,
                     boolean invulnerable)
                     throws PogamutException
According to param 'invulnerable' sets (or retract) the invulnerability of the specified bot.

Parameters:
botUnrealId -
invulnerable -
Throws:
PogamutException

botAutoTrace

void botAutoTrace(java.lang.String botUnrealId,
                  boolean autoTrace)
                  throws PogamutException
TODO: comment

Throws:
PogamutException

botManualSpawn

void botManualSpawn(java.lang.String botUnrealId,
                    boolean manualSpawn)
                    throws PogamutException
TODO: comment

Throws:
PogamutException

setBotName

void setBotName(java.lang.String botUnrealId,
                java.lang.String name)
                throws PogamutException
TODO: comment

Throws:
PogamutException

setGameSpeed

void setGameSpeed(double speed)
                  throws PogamutException
Sets game speed of UT2004.

Parameters:
speed -
Throws:
PogamutException

startRecording

void startRecording(java.lang.String fileName)
                    throws PogamutException
Starts recording of the "replay" to a specified file at server.

Parameters:
fileName -
Throws:
PogamutException

stopRecording

void stopRecording()
                   throws PogamutException
Stops recording of the "replay".

Throws:
PogamutException

loadAgentClass

java.lang.Class loadAgentClass(java.lang.String fullyClassifiedClassName)
                               throws PogamutException
Returns class of the required agent - special class loader is used.

Parameters:
fullyClassifiedName - e.g. hunter.Main
Returns:
Class of the agent
Throws:
PogamutException - usualy class not found exception

loadAgent

Agent loadAgent(java.lang.String fullyClassifiedClassName)
                throws PogamutException
Loads and instantiate a new agent object. You would probably want to call utWorld.connectBot(newAgentInstance) afterwards.

Parameters:
fullyClassifiedName - e.g. hunter.Main
Returns:
Agent instantiated agent
Throws:
PogamutException - usualy class not found exception