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:
@@ -14,12 +14,14 @@ public class RaceConnection {
|
||||
private final StringProperty hostname;
|
||||
private final int port;
|
||||
private final StringProperty status;
|
||||
private final StringProperty gamename;
|
||||
|
||||
public RaceConnection(String hostname, int port) {
|
||||
public RaceConnection(String hostname, int port, String gamename) {
|
||||
this.hostname = new SimpleStringProperty(hostname);
|
||||
this.port = port;
|
||||
this.status = new SimpleStringProperty("");
|
||||
check();
|
||||
this.gamename = new SimpleStringProperty(gamename);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,7 +36,8 @@ public class RaceConnection {
|
||||
s.connect(i, 750);//TODO this should be at least a second or two, once moved to its own thread
|
||||
status.set("Ready");
|
||||
return true;
|
||||
} catch (IOException e) {}
|
||||
} catch (IOException e) {
|
||||
}
|
||||
|
||||
status.set("Offline");
|
||||
return false;
|
||||
@@ -55,4 +58,6 @@ public class RaceConnection {
|
||||
public StringProperty statusProperty() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public StringProperty gamenameProperty() { return gamename;}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user