Started implementing the gameState broadcasts.

Initial xml files are almost broad casted, just need to create them (or import the for the regatta). Started the setup for sending boat location packets, should work once we get at least the boat xml working when being sent.

#story[1047]
This commit is contained in:
Kusal Ekanayake
2017-07-21 13:16:43 +12:00
parent 2fff73c075
commit 5df7efda03
9 changed files with 73 additions and 25 deletions
@@ -59,13 +59,15 @@ public class MainServerThread extends Thread implements PacketBufferDelegate, Cl
if (GameState.getCurrentStage() == GameStages.PRE_RACE) {
GameState.update();
updateClients();
}
//RACING
if (GameState.getCurrentStage() == GameStages.RACING) {
GameState.update();
updateClients();
}
//FINISHED
else if (GameState.getCurrentStage() == GameStages.FINISHED) {
@@ -115,13 +117,6 @@ public class MainServerThread extends Thread implements PacketBufferDelegate, Cl
return packetBuffer.add(streamPacket);
}
private void initializeRace(){
for (ServerToClientThread serverToClientThread : serverToClientThreads) {
serverToClientThread.updateClient();
}
}
/**
* A client has tried to connect to the server
* @param serverToClientThread The player that connected