Added functionality to host game and join a game in lobby. Host name and game name are not implemented yet.

#story[1087]
This commit is contained in:
zwu18
2017-07-26 20:42:36 +12:00
parent 578f04c74f
commit 9c9b98f882
10 changed files with 93 additions and 13 deletions
@@ -79,8 +79,8 @@ public class ConnectionController extends Controller {
public void initialize(URL location, ResourceBundle resources) {
// TODO - replace with config file
connections = FXCollections.observableArrayList();
connections.add(new RaceConnection("livedata.americascup.com", 4941));
connections.add(new RaceConnection("localhost", 4942));
connections.add(new RaceConnection("livedata.americascup.com", 4941, null));
connections.add(new RaceConnection("localhost", 4942, null));
connectionTable.setItems(connections);
hostnameColumn.setCellValueFactory(cellData -> cellData.getValue().hostnameProperty());
@@ -126,7 +126,7 @@ public class ConnectionController extends Controller {
String portString = portField.getText();
try{
int port = Integer.parseInt(portString);
connections.add(new RaceConnection(hostName, port));
connections.add(new RaceConnection(hostName, port, null));
}catch(NumberFormatException e){
System.err.println("Port number entered is not a number");
}