Merged with multi visualiser branch so now multiple visualisers can connect to the same host.
#story[1087]
This commit is contained in:
@@ -5,12 +5,17 @@ import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.stage.Stage;
|
||||
import mock.app.App;
|
||||
import mock.app.Event;
|
||||
import shared.exceptions.InvalidBoatDataException;
|
||||
import shared.exceptions.InvalidRaceDataException;
|
||||
import shared.exceptions.InvalidRegattaDataException;
|
||||
import shared.exceptions.XMLReaderException;
|
||||
import visualiser.model.RaceConnection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
@@ -33,10 +38,20 @@ public class HostController extends Controller {
|
||||
}
|
||||
|
||||
public void hostGamePressed() throws IOException{
|
||||
new App().start(new Stage());
|
||||
System.out.println("Run mock");
|
||||
connectSocket();
|
||||
}
|
||||
try {
|
||||
Event game = Event.getEvent();
|
||||
game.start();
|
||||
connectSocket();
|
||||
} catch (InvalidRaceDataException e) {
|
||||
e.printStackTrace();
|
||||
} catch (XMLReaderException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidBoatDataException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidRegattaDataException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}}
|
||||
|
||||
public void connectSocket() {
|
||||
try{
|
||||
|
||||
Reference in New Issue
Block a user