WIP: Connected game client to main server thread to pass compound mark variable.

Boats are initialised in main server thread behind start line before game starts.

#story[1117]
This commit is contained in:
Zhi You Tan
2017-08-03 18:39:15 +12:00
parent 1ab849fd0d
commit 8af80e6c3a
7 changed files with 69 additions and 506 deletions
@@ -64,6 +64,8 @@ public class ServerToClientThread implements Runnable, Observer {
private XMLGenerator xml;
private Yacht yacht;
public ServerToClientThread(Socket socket) {
this.socket = socket;
BufferedReader fn;
@@ -98,7 +100,7 @@ public class ServerToClientThread implements Runnable, Observer {
sourceId = GameState.getUniquePlayerID();
if (threeWayHandshake(sourceId)) {
serverLog("Successful handshake. Client allocated id: " + sourceId, 0);
Yacht yacht = new Yacht(
yacht = new Yacht(
"Yacht", sourceId, sourceId.toString(), fName, fName + " " + lName, "NZ"
);
// Yacht yacht = new Yacht("Kappa", "Kap", new GeoPoint(57.6708220, 11.8321340), 90.0);
@@ -366,4 +368,8 @@ public class ServerToClientThread implements Runnable, Observer {
public Socket getSocket() {
return socket;
}
public Yacht getYacht() {
return yacht;
}
}