|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.client.control.ConnectController
public final class ConnectController
The controller responsible for starting a server and
connecting to it. PreGameInputHandler will be set
as the input handler when a successful login has been completed,
| Field Summary | |
|---|---|
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
LICENSE
|
static java.lang.String |
REVISION
|
| Constructor Summary | |
|---|---|
ConnectController(FreeColClient freeColClient)
Creates a new ConnectController. |
|
| Method Summary | |
|---|---|
java.util.ArrayList<ServerInfo> |
getServerList()
Gets a list of servers from the meta server. |
void |
joinMultiplayerGame(java.lang.String username,
java.lang.String host,
int port)
Starts a new multiplayer game by connecting to the server. |
void |
loadGame()
Opens a dialog where the user should specify the filename and loads the game. |
void |
loadGame(java.io.File file)
Loads a game from the given file. |
void |
logout(boolean notifyServer)
Sends a logout message to the server. |
void |
quitGame(boolean bStopServer)
Quits the current game. |
void |
quitGame(boolean bStopServer,
boolean notifyServer)
Quits the current game. |
void |
reconnect()
Reconnects to the server. |
void |
startMultiplayerGame(boolean publicServer,
java.lang.String username,
int port)
Starts a multiplayer server and connects to it. |
void |
startSingleplayerGame(java.lang.String username)
Starts a new singleplayer game by connecting to the server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String LICENSE
public static final java.lang.String REVISION
| Constructor Detail |
|---|
public ConnectController(FreeColClient freeColClient)
ConnectController.
freeColClient - The main controller.| Method Detail |
|---|
public void startMultiplayerGame(boolean publicServer,
java.lang.String username,
int port)
publicServer - Should this server be listed at the meta server.username - The name to use when logging in.port - The port in which the server should listen for new clients.public void startSingleplayerGame(java.lang.String username)
username - The name to use when logging in.
public void joinMultiplayerGame(java.lang.String username,
java.lang.String host,
int port)
username - The name to use when logging in.host - The name of the machine running the FreeColServer.port - The port to use when connecting to the host.public void reconnect()
public void loadGame()
public void loadGame(java.io.File file)
file - The File.public void logout(boolean notifyServer)
notifyServer - Whether or not the server should be notified of the logout.
For example: if the server kicked us out then we don't need to confirm with a logout
message.
public void quitGame(boolean bStopServer,
boolean notifyServer)
bStopServer - Indicates whether or not a server that was started through this
client should be stopped.notifyServer - Whether or not the server should be notified of the logout.
For example: if the server kicked us out then we don't need to confirm with a logout
message.public void quitGame(boolean bStopServer)
bStopServer - Indicates whether or not a server that was started through this
client should be stopped.public java.util.ArrayList<ServerInfo> getServerList()
ServerInfo objects.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||