|
|
|
|
@ -40,7 +40,6 @@ public class LobbyController extends Controller {
|
|
|
|
|
private @FXML TextField addressFld;
|
|
|
|
|
private @FXML TextField portFld;
|
|
|
|
|
|
|
|
|
|
private ObservableList<RaceConnection> connections;
|
|
|
|
|
private ObservableList<RaceConnection> customConnections;
|
|
|
|
|
|
|
|
|
|
private AudioClip sound;
|
|
|
|
|
@ -83,7 +82,7 @@ public class LobbyController extends Controller {
|
|
|
|
|
sound = new AudioClip(this.getClass().getResource("/visualiser/sounds/buttonpress.wav").toExternalForm());
|
|
|
|
|
sound.play();
|
|
|
|
|
addServerGames();
|
|
|
|
|
for(RaceConnection connection: connections) {
|
|
|
|
|
for(RaceConnection connection: httpMatchBrowserClient.connections) {
|
|
|
|
|
connection.check();
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
@ -144,9 +143,9 @@ public class LobbyController extends Controller {
|
|
|
|
|
try {
|
|
|
|
|
int port = Integer.parseInt(portString);
|
|
|
|
|
customConnections.add(new RaceConnection(hostName, port, "Boat Game"));
|
|
|
|
|
connections.addAll(customConnections);
|
|
|
|
|
addressFld.clear();
|
|
|
|
|
portFld.clear();
|
|
|
|
|
refreshBtnPressed();
|
|
|
|
|
} catch (NumberFormatException e) {
|
|
|
|
|
System.err.println("Port number entered is not a number");
|
|
|
|
|
}
|
|
|
|
|
@ -174,6 +173,7 @@ public class LobbyController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
private void addServerGames() {
|
|
|
|
|
httpMatchBrowserClient.connections.addAll(customConnections);
|
|
|
|
|
customConnections.clear();
|
|
|
|
|
httpMatchBrowserClient.connections.addListener(new ListChangeListener<RaceConnection>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onChanged(Change<? extends RaceConnection> c) {
|
|
|
|
|
|