Fixed bug to let multiple people play at the same time.

This commit is contained in:
Kusal Ekanayake
2017-07-25 14:27:52 +12:00
parent 52bfa3ad34
commit 2f12f3e34f
3 changed files with 6 additions and 5 deletions
@@ -236,7 +236,7 @@ public class ServerToClientThread implements Runnable, Observer {
} catch (Exception e) {
// TODO: 24/07/17 zyt10 - fix a logic here when a client disconnected
serverLog("ERROR OCCURRED, CLOSING SERVER CONNECTION: " + socket.getRemoteSocketAddress().toString(), 1);
// e.printStackTrace();
e.printStackTrace();
closeSocket();
return;
}
@@ -364,7 +364,7 @@ public class ServerToClientThread implements Runnable, Observer {
// System.out.println("[SERVER] Lat: " + yacht.getLocation().getLat() + " Lon: " + yacht.getLocation().getLng());
BoatLocationMessage boatLocationMessage =
new BoatLocationMessage(
sourceId,
yacht.getSourceId(),
getSeqNo(),
yacht.getLocation().getLat(),
yacht.getLocation().getLng(),