Fixed not being able to add custom connections. Still need to test if it works with the http match browser (can't test it atm. #story[1352]
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user