Fixed issue where games can't be hosted if you quit as host in the lobby menu. Added more doc.#story[1188]
This commit is contained in:
@@ -39,7 +39,7 @@ public class Constants {
|
||||
* The race pre-start time, in milliseconds. 3 minutes (30 seconds for development).
|
||||
*/
|
||||
// public static final long RacePreStartTime = 30 * 1000;
|
||||
public static final long RacePreStartTime = 5000;
|
||||
public static final long RacePreStartTime = 1000;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -231,6 +231,7 @@ public class InGameLobbyController extends Controller {
|
||||
//Get the current race status.
|
||||
RaceStatusEnum raceStatus = visualiserRaceEvent.getVisualiserRaceState().getRaceStatusEnum();
|
||||
|
||||
//Try catch for getting interval times
|
||||
try {
|
||||
long interval = ChronoUnit.MILLIS.between(visualiserRaceEvent.getVisualiserRaceState().getRaceClock().getCurrentTime(), visualiserRaceEvent.getVisualiserRaceState().getRaceClock().getStartingTime());
|
||||
if(interval<=10000){
|
||||
@@ -286,13 +287,14 @@ public class InGameLobbyController extends Controller {
|
||||
/**
|
||||
* Menu button pressed. Prompt alert then return to menu
|
||||
*/
|
||||
public void menuBtnPressed(){
|
||||
public void menuBtnPressed() throws IOException {
|
||||
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
|
||||
alert.setTitle("Quitting race");
|
||||
alert.setContentText("Do you wish to quit the race?");
|
||||
alert.setHeaderText("You are about to quit the race");
|
||||
Optional<ButtonType> result = alert.showAndWait();
|
||||
if(result.get() == ButtonType.OK){
|
||||
parent.endEvent();
|
||||
visualiserRaceEvent.terminate();
|
||||
gameLobbyWrapper.setVisible(false);
|
||||
parent.enterTitle();
|
||||
@@ -322,6 +324,7 @@ public class InGameLobbyController extends Controller {
|
||||
|
||||
//Do nothing if 5 seconds or less to go
|
||||
if (interval <=5000){
|
||||
countdownTenPane.setVisible(false);
|
||||
//countdownTenText.setText("5");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user