mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
- Added methods for validating direct connection, Port Number Complete, Host Name not Complete.
- Added No Servers found Message - Found a potential bug with windows machines not running the correct service to handle Bonjour Service Addresses. tags: #story[1245]
This commit is contained in:
@@ -2,8 +2,11 @@ package seng302.visualiser.controllers.cells;
|
||||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXDecorator;
|
||||
import com.sun.org.apache.bcel.internal.classfile.Unknown;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import com.jfoenix.controls.JFXTextField;
|
||||
@@ -25,7 +28,6 @@ public class ServerCell implements Initializable {
|
||||
//Layout
|
||||
@FXML
|
||||
private GridPane serverListCell;
|
||||
|
||||
//Server Information
|
||||
@FXML
|
||||
private Label serverName;
|
||||
@@ -46,18 +48,17 @@ public class ServerCell implements Initializable {
|
||||
private String hostName;
|
||||
private Integer portNumber;
|
||||
|
||||
|
||||
public ServerCell(ServerDescription server) {
|
||||
this.name = server.getName();
|
||||
|
||||
this.currPlayerCount = server.getNumPlayers().toString() + "/" + server.getCapacity().toString();
|
||||
this.mapNameString = server.getMapName();
|
||||
|
||||
// Can cause issues on windows PCs without the bonjour service installed.
|
||||
this.hostName = server.getAddress();
|
||||
this.portNumber = server.portNumber();
|
||||
}
|
||||
|
||||
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
serverName.setText(name);
|
||||
serverPlayerCount.setText(currPlayerCount);
|
||||
@@ -67,9 +68,7 @@ public class ServerCell implements Initializable {
|
||||
}
|
||||
|
||||
public void joinServer() {
|
||||
// TODO: 7/09/17 ajm412: Connect to a server here with the values stored in the hostName/portNumber variables.
|
||||
System.out.println("Connecting to " + serverName.getText());
|
||||
|
||||
ViewManager.getInstance().getGameClient().runAsClient(hostName, portNumber);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user