|
|||||||||
| 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 | |
|---|---|
private FreeColClient |
freeColClient
|
private static java.util.logging.Logger |
logger
|
| 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. |
private java.util.List<java.lang.String> |
getVacantPlayers(java.lang.String host,
int port)
Returns a list of vacant players on a given 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. |
private void |
loadModFragments(Specification specification)
|
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(Specification specification,
boolean publicServer,
java.lang.String username,
int port,
NationOptions.Advantages advantages,
OptionGroup level)
Starts a multiplayer server and connects to it. |
void |
startSingleplayerGame(Specification specification,
java.lang.String username,
NationOptions.Advantages advantages)
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 |
|---|
private static final java.util.logging.Logger logger
private final FreeColClient freeColClient
| Constructor Detail |
|---|
public ConnectController(FreeColClient freeColClient)
ConnectController.
freeColClient - The main controller.| Method Detail |
|---|
public void startMultiplayerGame(Specification specification,
boolean publicServer,
java.lang.String username,
int port,
NationOptions.Advantages advantages,
OptionGroup level)
username - The name to use when logging in.port - The port in which the server should listen for new clients.level - a DifficultyLevel value
public void startSingleplayerGame(Specification specification,
java.lang.String username,
NationOptions.Advantages advantages)
specification - a Specification valueusername - The name to use when logging in.advantages - an Advantages value
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 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.
private java.util.List<java.lang.String> getVacantPlayers(java.lang.String host,
int port)
host - The name of the machine running the FreeColServer.port - The port to use when connecting to the host.
usernames.public java.util.ArrayList<ServerInfo> getServerList()
ServerInfo objects.private void loadModFragments(Specification specification)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||