Merge remote-tracking branch 'remotes/origin/master' into css
This commit is contained in:
@@ -4,6 +4,7 @@ import network.Messages.Enums.XMLMessageType;
|
|||||||
import network.Messages.LatestMessages;
|
import network.Messages.LatestMessages;
|
||||||
import network.Messages.XMLMessage;
|
import network.Messages.XMLMessage;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
|
import visualiser.gameController.ControllerServer;
|
||||||
|
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -75,7 +76,9 @@ public class ConnectionAcceptor implements Runnable {
|
|||||||
Socket mockSocket = serverSocket.accept();
|
Socket mockSocket = serverSocket.accept();
|
||||||
DataOutputStream outToVisualiser = new DataOutputStream(mockSocket.getOutputStream());
|
DataOutputStream outToVisualiser = new DataOutputStream(mockSocket.getOutputStream());
|
||||||
MockOutput mockOutput = new MockOutput(latestMessages, outToVisualiser);
|
MockOutput mockOutput = new MockOutput(latestMessages, outToVisualiser);
|
||||||
|
ControllerServer controllerServer = new ControllerServer(mockSocket);
|
||||||
new Thread(mockOutput).start();
|
new Thread(mockOutput).start();
|
||||||
|
new Thread(controllerServer).start();
|
||||||
mockOutputList.add(mockOutput);
|
mockOutputList.add(mockOutput);
|
||||||
System.out.println(String.format("%d number of Visualisers Connected.", mockOutputList.size()));
|
System.out.println(String.format("%d number of Visualisers Connected.", mockOutputList.size()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class Event {
|
|||||||
private Event() {
|
private Event() {
|
||||||
try {
|
try {
|
||||||
this.raceXML = getRaceXMLAtCurrentTime(XMLReader.readXMLFileToString("mock/mockXML/raceTest.xml", StandardCharsets.UTF_8));
|
this.raceXML = getRaceXMLAtCurrentTime(XMLReader.readXMLFileToString("mock/mockXML/raceTest.xml", StandardCharsets.UTF_8));
|
||||||
this.boatXML = XMLReader.readXMLFileToString("mock/mockXML/boatTest.xml", StandardCharsets.UTF_8);
|
this.boatXML = XMLReader.readXMLFileToString("mock/mockXML/boatsSinglePlayer.xml", StandardCharsets.UTF_8);
|
||||||
this.regattaXML = XMLReader.readXMLFileToString("mock/mockXML/regattaTest.xml", StandardCharsets.UTF_8);
|
this.regattaXML = XMLReader.readXMLFileToString("mock/mockXML/regattaTest.xml", StandardCharsets.UTF_8);
|
||||||
this.xmlFileType = XMLFileType.Contents;
|
this.xmlFileType = XMLFileType.Contents;
|
||||||
|
|
||||||
@@ -94,7 +94,6 @@ public class Event {
|
|||||||
MockRace newRace = new MockRace(boatDataSource, raceDataSource, regattaDataSource, this.latestMessages, this.boatPolars, Constants.RaceTimeScale);
|
MockRace newRace = new MockRace(boatDataSource, raceDataSource, regattaDataSource, this.latestMessages, this.boatPolars, Constants.RaceTimeScale);
|
||||||
|
|
||||||
new Thread(newRace).start();
|
new Thread(newRace).start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -193,6 +193,10 @@ public class BinaryMessageDecoder {
|
|||||||
AverageWindDecoder awDecoder = new AverageWindDecoder(messageBody);
|
AverageWindDecoder awDecoder = new AverageWindDecoder(messageBody);
|
||||||
return awDecoder.getAverageWind();
|
return awDecoder.getAverageWind();
|
||||||
|
|
||||||
|
case BOATACTION:
|
||||||
|
BoatActionDecoder baDecoder = new BoatActionDecoder(messageBody);
|
||||||
|
return new BoatAction(baDecoder.getBoatAction());
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//System.out.println("Broken Message!");
|
//System.out.println("Broken Message!");
|
||||||
//throw new InvalidMessageException("Broken message! Did not recognise message type: " + headerMessageType + ".");
|
//throw new InvalidMessageException("Broken message! Did not recognise message type: " + headerMessageType + ".");
|
||||||
|
|||||||
@@ -94,6 +94,15 @@ public class BinaryMessageEncoder {
|
|||||||
this.fullMessage = tempFullMessageByteBuffer.array();
|
this.fullMessage = tempFullMessageByteBuffer.array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a binary message from message type and message body.
|
||||||
|
* @param headerMessageType of message
|
||||||
|
* @param messageBody of message
|
||||||
|
*/
|
||||||
|
public BinaryMessageEncoder(MessageType headerMessageType, byte[] messageBody) {
|
||||||
|
this(headerMessageType, System.currentTimeMillis(), 69, (short)messageBody.length, messageBody);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the full encoded message. This includes the header, body, and CRC.
|
* Returns the full encoded message. This includes the header, body, and CRC.
|
||||||
* @return Full encoded message.
|
* @return Full encoded message.
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package network.MessageDecoders;
|
||||||
|
|
||||||
|
import network.Messages.Enums.BoatActionEnum;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class BoatActionDecoder {
|
||||||
|
byte byteBoatAction;
|
||||||
|
BoatActionEnum boatAction;
|
||||||
|
|
||||||
|
public BoatActionDecoder(byte[] encodedBoatAction) {
|
||||||
|
byteBoatAction = encodedBoatAction[0];
|
||||||
|
|
||||||
|
boatAction = BoatActionEnum.fromByte(byteBoatAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoatActionEnum getBoatAction() {
|
||||||
|
return boatAction;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -339,4 +339,11 @@ public class RaceVisionByteEncoder {
|
|||||||
return result.array();
|
return result.array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static byte[] boatActionMessage(BoatAction boatAction){
|
||||||
|
ByteBuffer boatActionMessage = ByteBuffer.allocate(1);
|
||||||
|
boatActionMessage.put(intToBytes(boatAction.getBoatAction(), 1));
|
||||||
|
byte [] result = boatActionMessage.array();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package network.Messages;
|
||||||
|
|
||||||
|
import network.Messages.Enums.BoatActionEnum;
|
||||||
|
import network.Messages.Enums.MessageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by David on 10/07/2017.
|
||||||
|
*/
|
||||||
|
public class BoatAction extends AC35Data {
|
||||||
|
|
||||||
|
private byte boatAction;
|
||||||
|
|
||||||
|
public BoatAction(BoatActionEnum boatAction){
|
||||||
|
super(MessageType.BOATACTION);
|
||||||
|
this.boatAction = boatAction.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getBoatAction() {
|
||||||
|
return boatAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package network.Messages.Enums;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boat actions
|
||||||
|
*/
|
||||||
|
public enum BoatActionEnum {
|
||||||
|
NOT_A_STATUS(-1),
|
||||||
|
AUTO_PILOT(1),
|
||||||
|
SAILS_IN(2),
|
||||||
|
SAILS_OUT(3),
|
||||||
|
TACK_GYBE(4),
|
||||||
|
UPWIND(5),
|
||||||
|
DOWNWIND(6);
|
||||||
|
|
||||||
|
private byte value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ctor. Creates a BoatActionEnum from a given primitive integer value, cast to a byte.
|
||||||
|
* @param value Integer, which is cast to byte, to construct from.
|
||||||
|
*/
|
||||||
|
private BoatActionEnum(int value) {
|
||||||
|
this.value = (byte) value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the primitive value of the enum.
|
||||||
|
* @return Primitive value of the enum.
|
||||||
|
*/
|
||||||
|
public byte getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores a mapping between Byte values and BoatActionEnum values.
|
||||||
|
*/
|
||||||
|
private static final Map<Byte, BoatActionEnum> byteToStatusMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Static initialization block. Initializes the byteToStatusMap.
|
||||||
|
*/
|
||||||
|
static {
|
||||||
|
for (BoatActionEnum type : BoatActionEnum.values()) {
|
||||||
|
BoatActionEnum.byteToStatusMap.put(type.value, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the enumeration value which corresponds to a given byte value.
|
||||||
|
* @param boatActionEnum Byte value to convert to a BoatActionEnum value.
|
||||||
|
* @return The BoatActionEnum value which corresponds to the given byte value.
|
||||||
|
*/
|
||||||
|
public static BoatActionEnum fromByte(byte boatActionEnum) {
|
||||||
|
//Gets the corresponding MessageType from the map.
|
||||||
|
BoatActionEnum type = BoatActionEnum.byteToStatusMap.get(boatActionEnum);
|
||||||
|
|
||||||
|
if (type == null) {
|
||||||
|
//If the byte value wasn't found, return the NOT_A_STATUS boatActionEnum.
|
||||||
|
return BoatActionEnum.NOT_A_STATUS;
|
||||||
|
} else {
|
||||||
|
//Otherwise, return the boatActionEnum.
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ public enum MessageType {
|
|||||||
MARKROUNDING(38),
|
MARKROUNDING(38),
|
||||||
COURSEWIND(44),
|
COURSEWIND(44),
|
||||||
AVGWIND(47),
|
AVGWIND(47),
|
||||||
|
BOATACTION(100),
|
||||||
NOTAMESSAGE(0);
|
NOTAMESSAGE(0);
|
||||||
|
|
||||||
///Primitive value of the enum.
|
///Primitive value of the enum.
|
||||||
|
|||||||
@@ -81,6 +81,13 @@ public class ConnectionController extends Controller {
|
|||||||
|
|
||||||
private ObservableList<RaceConnection> connections;
|
private ObservableList<RaceConnection> connections;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents whether the client is currently hosting a game already - this is to ensure they don't launch multiple servers.
|
||||||
|
*/
|
||||||
|
private boolean currentlyHostingGame = false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL location, ResourceBundle resources) {
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
// TODO - replace with config file
|
// TODO - replace with config file
|
||||||
@@ -91,7 +98,7 @@ public class ConnectionController extends Controller {
|
|||||||
statusColumn.setCellValueFactory(cellData -> cellData.getValue().statusProperty());
|
statusColumn.setCellValueFactory(cellData -> cellData.getValue().statusProperty());
|
||||||
|
|
||||||
connectionTable.getSelectionModel().selectedItemProperty().addListener((obs, prev, curr) -> {
|
connectionTable.getSelectionModel().selectedItemProperty().addListener((obs, prev, curr) -> {
|
||||||
if (curr != null && ((RaceConnection)curr).check()) connectButton.setDisable(false);
|
if (curr != null && curr.check()) connectButton.setDisable(false);
|
||||||
else connectButton.setDisable(true);
|
else connectButton.setDisable(true);
|
||||||
});
|
});
|
||||||
connectButton.setDisable(true);
|
connectButton.setDisable(true);
|
||||||
@@ -142,12 +149,17 @@ public class ConnectionController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public void addLocal() {
|
public void addLocal() {
|
||||||
try {
|
try {
|
||||||
|
//We don't want to host more than one game.
|
||||||
|
if (!currentlyHostingGame) {
|
||||||
Event game = Event.getEvent();
|
Event game = Event.getEvent();
|
||||||
urlField.textProperty().set(game.getAddress());
|
urlField.textProperty().set(game.getAddress());
|
||||||
portField.textProperty().set(Integer.toString(game.getPort()));
|
portField.textProperty().set(Integer.toString(game.getPort()));
|
||||||
|
|
||||||
game.start();
|
game.start();
|
||||||
addConnection();
|
addConnection();
|
||||||
|
|
||||||
|
currentlyHostingGame = true;
|
||||||
|
}
|
||||||
} catch (InvalidRaceDataException e) {
|
} catch (InvalidRaceDataException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (XMLReaderException e) {
|
} catch (XMLReaderException e) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import javafx.collections.ObservableList;
|
|||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import visualiser.app.VisualiserInput;
|
import visualiser.app.VisualiserInput;
|
||||||
|
import visualiser.gameController.ControllerClient;
|
||||||
import visualiser.model.VisualiserBoat;
|
import visualiser.model.VisualiserBoat;
|
||||||
import visualiser.model.VisualiserRace;
|
import visualiser.model.VisualiserRace;
|
||||||
|
|
||||||
@@ -38,8 +39,8 @@ public class MainController extends Controller {
|
|||||||
* @param visualiserInput The object used to read packets from the race server.
|
* @param visualiserInput The object used to read packets from the race server.
|
||||||
* @param visualiserRace The object modelling the race.
|
* @param visualiserRace The object modelling the race.
|
||||||
*/
|
*/
|
||||||
public void beginRace(VisualiserInput visualiserInput, VisualiserRace visualiserRace) {
|
public void beginRace(VisualiserInput visualiserInput, VisualiserRace visualiserRace, ControllerClient controllerClient) {
|
||||||
raceController.startRace(visualiserInput, visualiserRace);
|
raceController.startRace(visualiserInput, visualiserRace, controllerClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ import javafx.util.Callback;
|
|||||||
import network.Messages.Enums.RaceStatusEnum;
|
import network.Messages.Enums.RaceStatusEnum;
|
||||||
import shared.model.Leg;
|
import shared.model.Leg;
|
||||||
import visualiser.app.VisualiserInput;
|
import visualiser.app.VisualiserInput;
|
||||||
|
import visualiser.gameController.ControllerClient;
|
||||||
import visualiser.gameController.Keys.ControlKey;
|
import visualiser.gameController.Keys.ControlKey;
|
||||||
import visualiser.gameController.Keys.KeyFactory;
|
import visualiser.gameController.Keys.KeyFactory;
|
||||||
import visualiser.model.*;
|
import visualiser.model.*;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
@@ -58,6 +60,11 @@ public class RaceController extends Controller {
|
|||||||
*/
|
*/
|
||||||
private Sparkline sparkline;
|
private Sparkline sparkline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for sending keystrokes to server
|
||||||
|
*/
|
||||||
|
private ControllerClient controllerClient;
|
||||||
|
|
||||||
|
|
||||||
@FXML private GridPane canvasBase;
|
@FXML private GridPane canvasBase;
|
||||||
@FXML private Pane arrow;
|
@FXML private Pane arrow;
|
||||||
@@ -85,12 +92,20 @@ public class RaceController extends Controller {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL location, ResourceBundle resources) {
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
|
KeyFactory keyFactory = KeyFactory.getFactory();
|
||||||
|
|
||||||
// Initialise keyboard handler
|
// Initialise keyboard handler
|
||||||
race.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
|
race.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
|
||||||
String codeString = event.getCode().toString();
|
String codeString = event.getCode().toString();
|
||||||
ControlKey controlKey = KeyFactory.getKey(codeString);
|
ControlKey controlKey = keyFactory.getKey(codeString);
|
||||||
if(controlKey != null) {
|
if(controlKey != null) {
|
||||||
System.out.println(controlKey.toString() + " is Pressed.");
|
try {
|
||||||
|
controllerClient.sendKey(controlKey);
|
||||||
|
controlKey.onAction(); // Change key state if applicable
|
||||||
|
event.consume();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -324,10 +339,11 @@ public class RaceController extends Controller {
|
|||||||
* @param visualiserInput Object used to read packets from server.
|
* @param visualiserInput Object used to read packets from server.
|
||||||
* @param visualiserRace Object modelling the race.
|
* @param visualiserRace Object modelling the race.
|
||||||
*/
|
*/
|
||||||
public void startRace(VisualiserInput visualiserInput, VisualiserRace visualiserRace) {
|
public void startRace(VisualiserInput visualiserInput, VisualiserRace visualiserRace, ControllerClient controllerClient) {
|
||||||
|
|
||||||
this.visualiserInput = visualiserInput;
|
this.visualiserInput = visualiserInput;
|
||||||
this.visualiserRace = visualiserRace;
|
this.visualiserRace = visualiserRace;
|
||||||
|
this.controllerClient = controllerClient;
|
||||||
|
|
||||||
initialiseRace();
|
initialiseRace();
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import shared.exceptions.InvalidRaceDataException;
|
|||||||
import shared.exceptions.InvalidRegattaDataException;
|
import shared.exceptions.InvalidRegattaDataException;
|
||||||
import shared.exceptions.XMLReaderException;
|
import shared.exceptions.XMLReaderException;
|
||||||
import visualiser.app.VisualiserInput;
|
import visualiser.app.VisualiserInput;
|
||||||
|
import visualiser.gameController.ControllerClient;
|
||||||
import visualiser.model.VisualiserBoat;
|
import visualiser.model.VisualiserBoat;
|
||||||
import visualiser.model.VisualiserRace;
|
import visualiser.model.VisualiserRace;
|
||||||
|
|
||||||
@@ -76,6 +77,8 @@ public class StartController extends Controller implements Observer {
|
|||||||
*/
|
*/
|
||||||
private VisualiserRace visualiserRace;
|
private VisualiserRace visualiserRace;
|
||||||
|
|
||||||
|
private ControllerClient controllerClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of colors used to assign colors to each boat - passed in to the VisualiserRace constructor.
|
* An array of colors used to assign colors to each boat - passed in to the VisualiserRace constructor.
|
||||||
*/
|
*/
|
||||||
@@ -258,7 +261,7 @@ public class StartController extends Controller implements Observer {
|
|||||||
startWrapper.setVisible(false);
|
startWrapper.setVisible(false);
|
||||||
start.setVisible(false);
|
start.setVisible(false);
|
||||||
|
|
||||||
parent.beginRace(visualiserInput, visualiserRace);
|
parent.beginRace(visualiserInput, visualiserRace, controllerClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
@@ -308,6 +311,8 @@ public class StartController extends Controller implements Observer {
|
|||||||
try {
|
try {
|
||||||
//Begin reading packets from the socket/server.
|
//Begin reading packets from the socket/server.
|
||||||
this.visualiserInput = new VisualiserInput(socket);
|
this.visualiserInput = new VisualiserInput(socket);
|
||||||
|
//Send controller input to server
|
||||||
|
this.controllerClient = new ControllerClient(socket);
|
||||||
//Store a reference to latestMessages so that we can observe it.
|
//Store a reference to latestMessages so that we can observe it.
|
||||||
LatestMessages latestMessages = this.visualiserInput.getLatestMessages();
|
LatestMessages latestMessages = this.visualiserInput.getLatestMessages();
|
||||||
latestMessages.addObserver(this);
|
latestMessages.addObserver(this);
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package visualiser.gameController;
|
||||||
|
|
||||||
|
import network.BinaryMessageEncoder;
|
||||||
|
import network.MessageEncoders.RaceVisionByteEncoder;
|
||||||
|
import network.Messages.BoatAction;
|
||||||
|
import network.Messages.Enums.BoatActionEnum;
|
||||||
|
import network.Messages.Enums.MessageType;
|
||||||
|
import visualiser.gameController.Keys.ControlKey;
|
||||||
|
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic service for sending key presses to game server
|
||||||
|
*/
|
||||||
|
public class ControllerClient {
|
||||||
|
/**
|
||||||
|
* Socket to server
|
||||||
|
*/
|
||||||
|
Socket socket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output stream wrapper for socket to server
|
||||||
|
*/
|
||||||
|
DataOutputStream outputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise controller client with live socket.
|
||||||
|
* @param socket to server
|
||||||
|
*/
|
||||||
|
public ControllerClient(Socket socket) {
|
||||||
|
this.socket = socket;
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.outputStream = new DataOutputStream(socket.getOutputStream());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a keypress to server
|
||||||
|
* @param key to send
|
||||||
|
* @throws IOException if socket write fails
|
||||||
|
*/
|
||||||
|
public void sendKey(ControlKey key) throws IOException {
|
||||||
|
int protocolCode = key.getProtocolCode();
|
||||||
|
if(protocolCode > -1) {
|
||||||
|
|
||||||
|
byte[] bytes = new byte[4];
|
||||||
|
ByteBuffer.wrap(bytes).putInt(key.getProtocolCode());
|
||||||
|
BoatActionEnum boatActionEnum = BoatActionEnum.fromByte(bytes[3]);
|
||||||
|
|
||||||
|
BoatAction boatAction = new BoatAction(boatActionEnum);
|
||||||
|
|
||||||
|
byte[] encodedBoatAction = RaceVisionByteEncoder.boatActionMessage(boatAction);
|
||||||
|
|
||||||
|
BinaryMessageEncoder binaryMessage = new BinaryMessageEncoder(MessageType.BOATACTION, System.currentTimeMillis(), 0,
|
||||||
|
(short) encodedBoatAction.length, encodedBoatAction);
|
||||||
|
|
||||||
|
System.out.println("Sending out key: " + boatActionEnum);
|
||||||
|
outputStream.write(binaryMessage.getFullMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package visualiser.gameController;
|
||||||
|
|
||||||
|
import network.BinaryMessageDecoder;
|
||||||
|
import network.MessageDecoders.BoatActionDecoder;
|
||||||
|
import network.Messages.Enums.BoatActionEnum;
|
||||||
|
import visualiser.gameController.Keys.ControlKey;
|
||||||
|
import visualiser.gameController.Keys.KeyFactory;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.Socket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for dispatching key press data to race from client
|
||||||
|
*/
|
||||||
|
public class ControllerServer implements Runnable {
|
||||||
|
/**
|
||||||
|
* Socket to client
|
||||||
|
*/
|
||||||
|
private Socket socket;
|
||||||
|
/**
|
||||||
|
* Wrapper for input from client
|
||||||
|
*/
|
||||||
|
private DataInputStream inputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise server-side controller with live client socket
|
||||||
|
* @param socket to client
|
||||||
|
*/
|
||||||
|
public ControllerServer(Socket socket) {
|
||||||
|
this.socket = socket;
|
||||||
|
try {
|
||||||
|
this.inputStream = new DataInputStream(this.socket.getInputStream());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wait for controller key input from client and loop.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
while(true) {
|
||||||
|
byte[] message = new byte[20];
|
||||||
|
try {
|
||||||
|
if (inputStream.available() > 0) {
|
||||||
|
inputStream.read(message);
|
||||||
|
BinaryMessageDecoder encodedMessage = new BinaryMessageDecoder(message);
|
||||||
|
BoatActionDecoder boatActionDecoder = new BoatActionDecoder(encodedMessage.getMessageBody());
|
||||||
|
BoatActionEnum decodedMessage = boatActionDecoder.getBoatAction();
|
||||||
|
System.out.println("Received key: " + decodedMessage);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,10 +20,12 @@ public class InputChecker {
|
|||||||
* @param scene Scene the controller is to run in parallel with.
|
* @param scene Scene the controller is to run in parallel with.
|
||||||
*/
|
*/
|
||||||
public void runWithScene(Scene scene){
|
public void runWithScene(Scene scene){
|
||||||
|
KeyFactory keyFactory = KeyFactory.getFactory();
|
||||||
|
|
||||||
scene.setOnKeyPressed(event -> {
|
scene.setOnKeyPressed(event -> {
|
||||||
String codeString = event.getCode().toString();
|
String codeString = event.getCode().toString();
|
||||||
if (!currentlyActiveKeys.containsKey(codeString)) {
|
if (!currentlyActiveKeys.containsKey(codeString)) {
|
||||||
ControlKey controlKey = KeyFactory.getKey(codeString);
|
ControlKey controlKey = keyFactory.getKey(codeString);
|
||||||
if (controlKey != null) {
|
if (controlKey != null) {
|
||||||
controlKey.onAction();
|
controlKey.onAction();
|
||||||
System.out.println(controlKey.toString() + " is Pressed.");
|
System.out.println(controlKey.toString() + " is Pressed.");
|
||||||
@@ -34,7 +36,7 @@ public class InputChecker {
|
|||||||
|
|
||||||
scene.setOnKeyReleased(event -> {
|
scene.setOnKeyReleased(event -> {
|
||||||
String codeString = event.getCode().toString();
|
String codeString = event.getCode().toString();
|
||||||
ControlKey controlKey = KeyFactory.getKey(codeString);
|
ControlKey controlKey = keyFactory.getKey(codeString);
|
||||||
if (controlKey != null) {
|
if (controlKey != null) {
|
||||||
controlKey.onRelease();
|
controlKey.onRelease();
|
||||||
System.out.println(controlKey.toString() + " is Released.");
|
System.out.println(controlKey.toString() + " is Released.");
|
||||||
@@ -46,7 +48,7 @@ public class InputChecker {
|
|||||||
@Override
|
@Override
|
||||||
public void handle(long now) {
|
public void handle(long now) {
|
||||||
for (String key: currentlyActiveKeys.keySet()){
|
for (String key: currentlyActiveKeys.keySet()){
|
||||||
ControlKey controlKey = KeyFactory.getKey(key);
|
ControlKey controlKey = keyFactory.getKey(key);
|
||||||
if (controlKey != null){
|
if (controlKey != null){
|
||||||
controlKey.onHold();
|
controlKey.onHold();
|
||||||
System.out.println(controlKey.toString() + " is Held.");
|
System.out.println(controlKey.toString() + " is Held.");
|
||||||
|
|||||||
@@ -8,16 +8,29 @@ import javafx.scene.input.KeyCode;
|
|||||||
public abstract class ControlKey {
|
public abstract class ControlKey {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private KeyCode keyCode;
|
protected int protocolCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for Control
|
* Constructor for key state with specified protocol code
|
||||||
* @param name name of the key
|
* @param name of action
|
||||||
* @param keyCode key code for the key
|
* @param protocolCode -1 if not sent
|
||||||
*/
|
*/
|
||||||
public ControlKey(String name, KeyCode keyCode){
|
public ControlKey(String name, int protocolCode) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.keyCode = keyCode;
|
this.protocolCode = protocolCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for key state not sent over network
|
||||||
|
* @param name name of the key
|
||||||
|
*/
|
||||||
|
public ControlKey(String name){
|
||||||
|
this.name = name;
|
||||||
|
this.protocolCode = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getProtocolCode() {
|
||||||
|
return protocolCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package visualiser.gameController.Keys;
|
package visualiser.gameController.Keys;
|
||||||
|
|
||||||
import javafx.scene.input.KeyCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Key to send downwind packet to server
|
* Key to send downwind packet to server
|
||||||
*/
|
*/
|
||||||
@@ -9,12 +7,11 @@ public class DownWindKey extends ControlKey {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for Control
|
* Constructor for Control
|
||||||
*
|
|
||||||
* @param name name of the key
|
* @param name name of the key
|
||||||
* @param keyCode key code for the key
|
*
|
||||||
*/
|
*/
|
||||||
public DownWindKey(String name, KeyCode keyCode) {
|
public DownWindKey(String name) {
|
||||||
super(name, keyCode);
|
super(name, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,36 +1,51 @@
|
|||||||
package visualiser.gameController.Keys;
|
package visualiser.gameController.Keys;
|
||||||
|
|
||||||
import javafx.scene.input.KeyCode;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory for creating Keys, these could be predefined in the future.
|
* Factory for creating Keys, these could be predefined in the future.
|
||||||
*/
|
*/
|
||||||
public class KeyFactory {
|
public class KeyFactory {
|
||||||
|
/**
|
||||||
|
* Retrieve command given key
|
||||||
|
*/
|
||||||
|
private Map<String, ControlKey> keyState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Singleton instance to enforce consistent key state
|
||||||
|
*/
|
||||||
|
private static KeyFactory theFactory = new KeyFactory();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Singleton constructor for key state, set up initial state of each action.
|
||||||
|
*/
|
||||||
|
private KeyFactory() {
|
||||||
|
this.keyState = new HashMap<>();
|
||||||
|
keyState.put("Z", new ZoomInKey("Zoom In"));
|
||||||
|
keyState.put("X", new ZoomOutKey("Zoom Out"));
|
||||||
|
keyState.put("SPACE", new VMGKey("VMG"));
|
||||||
|
keyState.put("SHIFT", new SailsToggleKey("Toggle Sails"));
|
||||||
|
keyState.put("ENTER", new TackGybeKey("Tack/Gybe"));
|
||||||
|
keyState.put("PAGE_UP", new UpWindKey("Upwind"));
|
||||||
|
keyState.put("PAGE_DOWN", new DownWindKey("Downwind"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get singleton instance of KeyFactory to interact with key state
|
||||||
|
* @return automatically constructed KeyFactory
|
||||||
|
*/
|
||||||
|
public static KeyFactory getFactory() {
|
||||||
|
return theFactory;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Control Key in charge of a key press
|
* Get the Control Key in charge of a key press
|
||||||
* @param key key pressed (String value of KeyCode)
|
* @param key key pressed (String value of KeyCode)
|
||||||
* @return the Control Key behaviour of the key pressed.
|
* @return the Control Key behaviour of the key pressed.
|
||||||
*/
|
*/
|
||||||
public static ControlKey getKey(String key){
|
public ControlKey getKey(String key){
|
||||||
switch(key){
|
return keyState.get(key);
|
||||||
case "Z":
|
|
||||||
return new ZoomInKey("Z", KeyCode.Z);
|
|
||||||
case "X":
|
|
||||||
return new ZoomOutKey("X", KeyCode.X);
|
|
||||||
case "SPACE":
|
|
||||||
return new VMGKey("SPACE", KeyCode.SPACE);
|
|
||||||
case "SHIFT":
|
|
||||||
return new SailsToggleKey("SHIFT", KeyCode.SHIFT);
|
|
||||||
case "ENTER":
|
|
||||||
return new TackGybeKey("ENTER", KeyCode.ENTER);
|
|
||||||
case "PAGE_UP":
|
|
||||||
return new UpWindKey("PAGE_UP", KeyCode.PAGE_UP);
|
|
||||||
case "PAGE_DOWN":
|
|
||||||
return new DownWindKey("PAGE_DOWN", KeyCode.PAGE_DOWN);
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package visualiser.gameController.Keys;
|
package visualiser.gameController.Keys;
|
||||||
|
|
||||||
import javafx.scene.input.KeyCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Key to toggle the sails
|
* Key to toggle the sails
|
||||||
*/
|
*/
|
||||||
@@ -9,17 +7,19 @@ public class SailsToggleKey extends ControlKey {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for Control
|
* Constructor for Control
|
||||||
*
|
|
||||||
* @param name name of the key
|
* @param name name of the key
|
||||||
* @param keyCode key code for the key
|
*
|
||||||
*/
|
*/
|
||||||
public SailsToggleKey(String name, KeyCode keyCode) {
|
public SailsToggleKey(String name) {
|
||||||
super(name, keyCode);
|
super(name, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle command associated with sails key
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onAction() {
|
public void onAction() {
|
||||||
|
protocolCode = protocolCode == 2? 3 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package visualiser.gameController.Keys;
|
package visualiser.gameController.Keys;
|
||||||
|
|
||||||
import javafx.scene.input.KeyCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key to toggle between tacking and gybing
|
* key to toggle between tacking and gybing
|
||||||
*/
|
*/
|
||||||
@@ -9,12 +7,11 @@ public class TackGybeKey extends ControlKey {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for Control
|
* Constructor for Control
|
||||||
*
|
|
||||||
* @param name name of the key
|
* @param name name of the key
|
||||||
* @param keyCode key code for the key
|
*
|
||||||
*/
|
*/
|
||||||
public TackGybeKey(String name, KeyCode keyCode) {
|
public TackGybeKey(String name) {
|
||||||
super(name, keyCode);
|
super(name, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package visualiser.gameController.Keys;
|
package visualiser.gameController.Keys;
|
||||||
|
|
||||||
import javafx.scene.input.KeyCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Key to go upwind
|
* Key to go upwind
|
||||||
*/
|
*/
|
||||||
@@ -9,12 +7,11 @@ public class UpWindKey extends ControlKey {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for Control
|
* Constructor for Control
|
||||||
*
|
|
||||||
* @param name name of the key
|
* @param name name of the key
|
||||||
* @param keyCode key code for the key
|
*
|
||||||
*/
|
*/
|
||||||
public UpWindKey(String name, KeyCode keyCode) {
|
public UpWindKey(String name) {
|
||||||
super(name, keyCode);
|
super(name, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,10 +11,9 @@ public class VMGKey extends ControlKey{
|
|||||||
* Constructor for Control
|
* Constructor for Control
|
||||||
*
|
*
|
||||||
* @param name name of the key
|
* @param name name of the key
|
||||||
* @param keyCode key code for the key
|
|
||||||
*/
|
*/
|
||||||
public VMGKey(String name, KeyCode keyCode) {
|
public VMGKey(String name) {
|
||||||
super(name, keyCode);
|
super(name, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import javafx.scene.input.KeyCode;
|
|||||||
*/
|
*/
|
||||||
public class ZoomInKey extends ControlKey {
|
public class ZoomInKey extends ControlKey {
|
||||||
|
|
||||||
public ZoomInKey(String name, KeyCode keyCode) {
|
public ZoomInKey(String name) {
|
||||||
super(name, keyCode);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package visualiser.gameController.Keys;
|
package visualiser.gameController.Keys;
|
||||||
|
|
||||||
import javafx.scene.input.KeyCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Key to zoom out of the game.
|
* Key to zoom out of the game.
|
||||||
*/
|
*/
|
||||||
@@ -9,12 +7,11 @@ public class ZoomOutKey extends ControlKey{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for Control
|
* Constructor for Control
|
||||||
*
|
|
||||||
* @param name name of the key
|
* @param name name of the key
|
||||||
* @param keyCode key code for the key
|
*
|
||||||
*/
|
*/
|
||||||
public ZoomOutKey(String name, KeyCode keyCode) {
|
public ZoomOutKey(String name) {
|
||||||
super(name, keyCode);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -33,23 +33,8 @@
|
|||||||
</Boat>
|
</Boat>
|
||||||
|
|
||||||
<!--Participants-->
|
<!--Participants-->
|
||||||
<Boat BoatName="Team ORACLE USA" HullNum="RG01" ShapeID="0" ShortName="USA" SourceID="121" StoweName="USA" Type="Yacht">
|
|
||||||
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
|
||||||
</Boat>
|
|
||||||
<Boat BoatName="Land Rover BAR" HullNum="RG01" ShapeID="0" ShortName="GBR" SourceID="122" StoweName="GBR" Type="Yacht">
|
|
||||||
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
|
||||||
</Boat>
|
|
||||||
<Boat BoatName="SoftBank Team Japan" HullNum="RG01" ShapeID="0" ShortName="JPN" SourceID="123" StoweName="JPN" Type="Yacht">
|
|
||||||
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
|
||||||
</Boat>
|
|
||||||
<Boat BoatName="Groupama Team France" HullNum="RG01" ShapeID="0" ShortName="FRA" SourceID="124" StoweName="FRA" Type="Yacht">
|
|
||||||
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
|
||||||
</Boat>
|
|
||||||
<Boat BoatName="Artemis Racing" HullNum="RG01" ShapeID="0" ShortName="SWE" SourceID="125" StoweName="SWE" Type="Yacht">
|
<Boat BoatName="Artemis Racing" HullNum="RG01" ShapeID="0" ShortName="SWE" SourceID="125" StoweName="SWE" Type="Yacht">
|
||||||
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
||||||
</Boat>
|
</Boat>
|
||||||
<Boat BoatName="Emirates Team New Zealand" HullNum="RG01" ShapeID="0" ShortName="NZL" SourceID="126" StoweName="NZL" Type="Yacht">
|
|
||||||
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
|
||||||
</Boat>
|
|
||||||
</Boats>
|
</Boats>
|
||||||
</BoatConfig>
|
</BoatConfig>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
|
||||||
|
<BoatConfig>
|
||||||
|
<Boats>
|
||||||
|
|
||||||
|
<!--Mark Boats-->
|
||||||
|
<Boat Type="Mark" BoatName="PRO" SourceID="101" >
|
||||||
|
<GPSposition X= "-64.854304" Y="32.296577" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="PIN" SourceID="102" >
|
||||||
|
<GPSposition X= "-64.855242" Y="32.293771" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="Marker1" SourceID="103" >
|
||||||
|
<GPSposition X= "-64.843983" Y="32.293039" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="WGL" SourceID="104" >
|
||||||
|
<GPSposition X= "-64.850045" Y="32.28468" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="WGR" SourceID="105" >
|
||||||
|
<GPSposition X= "-64.847591" Y="32.280164" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="LGL" SourceID="106" >
|
||||||
|
<GPSposition X= "-64.835249" Y="32.309693" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="LGR" SourceID="107" >
|
||||||
|
<GPSposition X= "-64.831785" Y="32.308046" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="FL" SourceID="108" >
|
||||||
|
<GPSposition X= "-64.839291" Y="32.317379" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat Type="Mark" BoatName="FR" SourceID="109" >
|
||||||
|
<GPSposition X= "-64.83626" Y="32.317257" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
|
||||||
|
<!--Participants-->
|
||||||
|
<Boat BoatName="Emirates Team New Zealand" HullNum="RG01" ShapeID="0" ShortName="NZL" SourceID="126" StoweName="NZL" Type="Yacht">
|
||||||
|
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat BoatName="Land Rover BAR" HullNum="RG01" ShapeID="0" ShortName="GBR" SourceID="122" StoweName="GBR" Type="Yacht">
|
||||||
|
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat BoatName="SoftBank Team Japan" HullNum="RG01" ShapeID="0" ShortName="JPN" SourceID="123" StoweName="JPN" Type="Yacht">
|
||||||
|
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat BoatName="Groupama Team France" HullNum="RG01" ShapeID="0" ShortName="FRA" SourceID="124" StoweName="FRA" Type="Yacht">
|
||||||
|
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat BoatName="Artemis Racing" HullNum="RG01" ShapeID="0" ShortName="SWE" SourceID="125" StoweName="SWE" Type="Yacht">
|
||||||
|
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
<Boat BoatName="Emirates Team New Zealand" HullNum="RG01" ShapeID="0" ShortName="NZL" SourceID="126" StoweName="NZL" Type="Yacht">
|
||||||
|
<GPSposition X="-64.854304" Y="32.296577" Z="0"/>
|
||||||
|
</Boat>
|
||||||
|
</Boats>
|
||||||
|
</BoatConfig>
|
||||||
@@ -5,12 +5,7 @@
|
|||||||
<CreationTimeDate>CREATION_TIME</CreationTimeDate>
|
<CreationTimeDate>CREATION_TIME</CreationTimeDate>
|
||||||
<RaceStartTime Postpone="false" Time="START_TIME"/>
|
<RaceStartTime Postpone="false" Time="START_TIME"/>
|
||||||
<Participants>
|
<Participants>
|
||||||
<Yacht SourceID="121"/>
|
|
||||||
<Yacht SourceID="122"/>
|
|
||||||
<Yacht SourceID="123"/>
|
|
||||||
<Yacht SourceID="124"/>
|
|
||||||
<Yacht SourceID="125"/>
|
<Yacht SourceID="125"/>
|
||||||
<Yacht SourceID="126"/>
|
|
||||||
</Participants>
|
</Participants>
|
||||||
<CompoundMarkSequence>
|
<CompoundMarkSequence>
|
||||||
<Corner CompoundMarkID="1" SeqID="1"/>
|
<Corner CompoundMarkID="1" SeqID="1"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user