WIP: Adapted the old server thread class to the GameServerThread class to allow multiple clients to connect

tags: #story[1047]  #pair[wmu16]
This commit is contained in:
William Muir
2017-07-13 14:40:11 +12:00
parent 035841f221
commit 8090cd7985
9 changed files with 138 additions and 387 deletions
-44
View File
@@ -35,51 +35,7 @@ public class App extends Application {
}
public static void main(String[] args) {
StreamReceiver sr = null;
new ServerThread("Racevision Test Server");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (args.length == 1 && args[0].equals("-standalone")) {
return;
}
if (args.length == 3 && args[0].equals("-server")) {
sr = new StreamReceiver(args[1], Integer.valueOf(args[2]), "RaceStream");
} else if (args.length == 2 && args[0].equals("-server")) {
switch (args[1]) {
case "internal":
sr = new StreamReceiver("localhost", 4949, "RaceStream");
break;
case "staffserver":
sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4941, "RaceStream");
break;
case "official":
sr = new StreamReceiver("livedata.americascup.com", 4941, "RaceStream");
break;
}
}
//Change the StreamReceiver in this else block to change the default data source.
else{
// sr = new StreamReceiver("localhost", 4949, "RaceStream");
// sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4941, "RaceStream");
sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4942, "RaceStream");
// sr = new StreamReceiver("livedata.americascup.com", 4941, "RaceStream");
}
// sr.start();
// StreamParser streamParser = new StreamParser("StreamParser");
// streamParser.start();
launch(args);
}
}