All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----game.GameServer
main
method which
is used to boot up the server.
[FINISH ME]
GameServer
, with the specified game id.
GameInfo
informations for
all games in the server, including new and running games.
ClientHandler
from the set of
running client handlers.
Hashtable gameHandlers
GameFactory gameFactory
String name
int port
Properties props
Integer currentId
boolean debug
boolean shouldQuit
Vector clientHandlers
public GameServer()
public String getName()
public int getPort()
public Vector getAllGameInfos()
GameInfo
informations for
all games in the server, including new and running games.
public GameHandler addGame(Game game)
GameServer
, with the specified game id.
public GameHandler getGame(Object id)
GameHandler
which is
used to hold and run games in the server.
null if the
game cannot be found.
removeGame
public void removeGame(GameHandler handler)
- Remove the specified game from the set of games runned by the
server.
- Parameters:
- handler - the game to be removed from the server.
removePlayerFromGame
public void removePlayerFromGame(Player player,
GameHandler handler)
- Removes the specified player from the given game. If this makes the
game terminate, then remove the game from the server.
- Parameters:
- player - the player to remove from the game
- handler - the
GameHandler
from which to remove the player.
getNewId
public Integer getNewId()
- Returns a new unique Id for a new game beeing created.
handlerHasChanged
public void handlerHasChanged(Handler handler)
handlerLostConnection
public void handlerLostConnection(Handler handler)
sendToClients
public void sendToClients(LinkFrame frame)
- Sends the given frame to all currently connected clients.
The lastly added client will be messaged first.
- Parameters:
- frame - the frame to send to all clients.
main
public static void main(String args[])
- The GameServer entry point. [FINISH ME]
waitForConnections
public void waitForConnections()
- [DESCRIBE ME]
removeHandler
public void removeHandler(ClientHandler handler)
- Removes the specified
ClientHandler
from the set of
running client handlers.
- Parameters:
- handler - the handler to remove from the set.
All Packages Class Hierarchy This Package Previous Next Index