Updated host to show the hosted address and port. Fixed css issue with lobby text field.

#story[1087]
This commit is contained in:
David Wu
2017-07-27 13:12:39 +12:00
parent f4eb03e79e
commit 2b8b334486
6 changed files with 57 additions and 25 deletions
@@ -33,11 +33,6 @@ public class HostController extends Controller {
@FXML
AnchorPane hostWrapper;
@FXML
TextField gameAddressFld;
@FXML
TextField gamePortFld;
@Override
public void initialize(URL location, ResourceBundle resources) {
@@ -46,12 +41,8 @@ public class HostController extends Controller {
public void hostGamePressed() throws IOException{
try {
Event game = Event.getEvent();
gameAddressFld.textProperty().set(game.getAddress());
gamePortFld.textProperty().set(Integer.toString(game.getPort()));
System.out.println(gameAddressFld.textProperty().getValue());
System.out.println(gamePortFld.textProperty().getValue());
game.start();
connectSocket(gameAddressFld.textProperty().getValue(), Integer.parseInt(gamePortFld.textProperty().getValue()));
connectSocket("localhost", 4942);
} catch (InvalidRaceDataException e) {
e.printStackTrace();
} catch (XMLReaderException e) {
@@ -60,8 +51,6 @@ public class HostController extends Controller {
e.printStackTrace();
} catch (InvalidRegattaDataException e) {
e.printStackTrace();
} catch (UnknownHostException e) {
e.printStackTrace();
}
}