Merging game lobby with game state broadcast. Merge conflicts resolved.

Port numbers updated to 4942.
This commit is contained in:
Kusal Ekanayake
2017-07-24 15:26:51 +12:00
parent 1daac842f2
commit 526c12127f
6 changed files with 8 additions and 6 deletions
@@ -220,6 +220,7 @@ public class LobbyController implements Initializable, Observer{
@FXML
public void readyButtonPressed() {
setContentPane("/views/RaceView.fxml");
GameState.setCurrentStage(GameStages.RACING);
}
@@ -96,12 +96,12 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
startingBoats = new ArrayList<>(ClientPacketParser.getBoats().values());
includedCanvasController.setup(this);
// includedCanvasController.initializeCanvas();
includedCanvasController.initializeCanvas();
initializeUpdateTimer();
initialiseFPSCheckBox();
initialiseAnnotationSlider();
initialiseBoatSelectionComboBox();
// includedCanvasController.timer.start();
includedCanvasController.timer.start();
selectAnnotationBtn.setOnAction(event -> loadSelectAnnotationView());
}
@@ -75,7 +75,8 @@ public class StartScreenController {
new MainServerThread();
ClientState.setHost(true);
// host will connect and handshake to itself after setting up the server
ClientToServerThread clientToServerThread = new ClientToServerThread(ClientState.getHostIp(), 4950);
// TODO: 24/07/17 wmu16 - Make port number some static global type constant?
ClientToServerThread clientToServerThread = new ClientToServerThread(ClientState.getHostIp(), 4942);
ClientState.setConnectedToHost(true);
controller.setClientToServerThread(clientToServerThread);
setContentPane("/views/LobbyView.fxml");
@@ -18,7 +18,7 @@ import java.util.*;
public class GameServerThread implements Runnable, Observer, ClientConnectionDelegate{
private static final Integer MAX_NUM_PLAYERS = 10;
public static final int PORT_NUMBER = 4950;
public static final int PORT_NUMBER = 4942;
private Boolean hosting = true;
@@ -17,7 +17,7 @@ import java.util.concurrent.PriorityBlockingQueue;
*/
public class MainServerThread implements Runnable, PacketBufferDelegate, ClientConnectionDelegate{
private static final int PORT = 4950;
private static final int PORT = 4942;
private static final Integer MAX_NUM_PLAYERS = 3;
private static final int LOG_LEVEL = 1;