|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.network.VoogaClient
vooga.network.gamelobby.VoogaLobbyClient
public class VoogaLobbyClient
VoogaLobbyClient allows users to interact with lobbies on the server in the interest of playing networked games. It allows for joining/leaving and creating lobbies, and when a receiver is registered, it will notify the receiver of information coming from the server concerning the construction of new lobbies, users entering and exiting lobbies, and the starting of games.
Constructor Summary | |
---|---|
VoogaLobbyClient(java.lang.String userName,
java.lang.String gameName)
Creates a lobby client for the named user and game. |
Method Summary | |
---|---|
void |
connect(java.net.InetAddress host)
Connects to the server at the specified address. |
void |
createGameLobby(java.lang.String lobbyName,
int occupancy)
Creates a game lobby with the given name and occupancy. |
protected void |
initializeConnection()
Performs any necessary set-up for a new connection. |
void |
joinGameLobby(long lobbyID)
Joins the lobby identified by the given ID. |
void |
leaveGameLobby(long lobbyID)
Leaves the lobby identified by the given ID. |
void |
registerReceiver(ILobbyInfoReceiver receiver)
Registers a receiver for this client. |
void |
requestGameLobbies()
Sends a request to the server asking to be notified of all existing lobbies and their occupants. |
void |
run()
|
void |
startGame(long lobbyID)
Starts the specified game with the users currently in the lobby. |
Methods inherited from class vooga.network.VoogaClient |
---|
allowConnection, blockConnection, connect, connect, disconnect, getMyInputStream, getMyName, getMyOutputStream, getMySocket, isConnected, setConnected, setMyName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VoogaLobbyClient(java.lang.String userName, java.lang.String gameName)
userName
- gameName
- Method Detail |
---|
public void registerReceiver(ILobbyInfoReceiver receiver)
receiver
- public void joinGameLobby(long lobbyID) throws java.io.IOException
lobbyID
-
java.io.IOException
public void leaveGameLobby(long lobbyID) throws java.io.IOException
lobbyID
-
java.io.IOException
public void createGameLobby(java.lang.String lobbyName, int occupancy) throws java.io.IOException
lobbyName
- occupancy
- - the maximum players who can play the game.
java.io.IOException
public void requestGameLobbies() throws java.io.IOException
java.io.IOException
public void startGame(long lobbyID) throws java.io.IOException
lobbyID
-
java.io.IOException
public void connect(java.net.InetAddress host) throws java.io.IOException
VoogaClient
connect
in class VoogaClient
host
- The IP of an existing VoogaChatServer.
java.io.IOException
protected void initializeConnection()
VoogaClient
initializeConnection
in class VoogaClient
public void run()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |