|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.asdf.server.GameManager
public class GameManager
Handles creating, deleting and listing of games.
Nested Class Summary | |
---|---|
class |
GameManager.GameJoinException
|
Constructor Summary | |
---|---|
GameManager()
|
Method Summary | |
---|---|
void |
chat(GameRequest request,
long sessionID,
ClientConnection client)
Send chat message to Game |
void |
checkDelete(long id,
GameTimerTask task)
Checks wether a game instance is futile. |
GameResponse |
createGame(GameRequest request,
long sessionID,
ClientConnection client)
Create game with specified parameters. |
void |
deleteGame(GameRequest request,
long sessionID,
ClientConnection client)
Forcefully deletes an active game. |
void |
deliverAction(GameRequest request,
long sessionID,
ClientConnection client)
Gives a user action to a game instance for processing. |
void |
finalize()
Finalize GameManager by canceling timer |
java.sql.Connection |
getDbGameConnection()
Getter for database game connection. |
long |
getFreeGameID()
Returns next free game ID. |
void |
getGameDetails(GameDetailsResponse gres,
java.lang.Long gameID)
Asks for detailed information from a single game. |
void |
getGameTypes(java.util.List<AvailableGamesResponse.Game> gameTypes)
Reads meta data about games available in this server and sends this to client. |
GameTimer |
getTimer()
Returns the Timer object that can be used for synchronization in Game implementations. |
void |
handleGameResponse(GameResponse response,
long sessionID,
ClientConnection client)
Handles game responses. |
void |
joinGame(GameRequest request,
long sessionID,
ClientConnection client)
Join game. |
void |
listGames(java.util.List<GameListResponse.Games.Game> gameList,
java.util.List<java.lang.String> columnNames,
java.lang.String gameType)
Collects a list of game descriptions to be sent back to client. |
void |
partGame(GameRequest request,
long sessionID,
ClientConnection client)
Part game. |
void |
voice(GameRequest request,
long sessionID,
ClientConnection client)
Send voice message to Game |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GameManager()
Method Detail |
---|
public long getFreeGameID()
public GameTimer getTimer()
public void deliverAction(GameRequest request, long sessionID, ClientConnection client)
request
- GameRequest object containing possible custom commands needed by the gamesessionID
- Session ID of the source of the current messageclient
- Client informationpublic GameResponse createGame(GameRequest request, long sessionID, ClientConnection client)
request
- GameRequest object containing possible custom commands
needed by GamesessionID
- Session ID of the source of the current messageclient
- Client information to obtain a Server instance
public void joinGame(GameRequest request, long sessionID, ClientConnection client) throws GameManager.GameJoinException
request
- GameRequest containing optional parameterssessionID
- Session ID of the current messageclient
- ClientConnection from which the message was received.
GameManager.GameJoinException
public void partGame(GameRequest request, long sessionID, ClientConnection client)
request
- sessionID
- client
- public void deleteGame(GameRequest request, long sessionID, ClientConnection client)
request
- A GameRequest delivering the gameID to be deleted.sessionID
- SessionID of the user who is performing this action.client
- Client information of the user who is performing this action.public void chat(GameRequest request, long sessionID, ClientConnection client)
request
- GameRequestsessionID
- Session IDclient
- ClientConnectionpublic void voice(GameRequest request, long sessionID, ClientConnection client)
request
- GameRequestsessionID
- Session IDclient
- ClientConnectionpublic void handleGameResponse(GameResponse response, long sessionID, ClientConnection client)
response
- GameResponse delivering user information.sessionID
- Session ID of the user who sent the response.client
- Client information of the user.public void getGameTypes(java.util.List<AvailableGamesResponse.Game> gameTypes)
gameTypes
- a reference to a list of game meta data containers.public void listGames(java.util.List<GameListResponse.Games.Game> gameList, java.util.List<java.lang.String> columnNames, java.lang.String gameType) throws java.lang.ClassNotFoundException
gameList
- A list of Game description objects.columnNames
- A list of column namesgameType
- Type of the game
java.lang.ClassNotFoundException
public void getGameDetails(GameDetailsResponse gres, java.lang.Long gameID)
gres
- Message content object describing details of a game.gameID
- ID to identify a given game.public java.sql.Connection getDbGameConnection()
public void checkDelete(long id, GameTimerTask task)
id
- Game instance id.task
- The timer ask that invokes this check.public void finalize()
finalize
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |