|
||||||||||
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,
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. |
boolean |
login(java.lang.String username,
java.lang.String host,
int port)
Starts the client and connects to host:port. |
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,
NationOptions nationOptions)
Starts a multiplayer server and connects to it. |
void |
startSingleplayerGame(java.lang.String username,
NationOptions nationOptions)
Starts a new singleplayer game by connecting to the server. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectController(FreeColClient freeColClient)
ConnectController
.
freeColClient
- The main controller.Method Detail |
---|
public void startMultiplayerGame(boolean publicServer, java.lang.String username, int port, NationOptions nationOptions)
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.nationOptions
- a NationOptions
valuepublic void startSingleplayerGame(java.lang.String username, NationOptions nationOptions)
username
- The name to use when logging in.nationOptions
- a NationOptions
valuepublic 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 boolean login(java.lang.String username, java.lang.String host, int port)
username
- The name to use when logging in. This should be a unique identifier.host
- The name of the machine running the FreeColServer
.port
- The port to use when connecting to the host.
boolean
valuepublic 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 |