Merging main features into story 6. App now sends and receives key strokes. #story[1007, 1089]
This commit is contained in:
@@ -43,7 +43,7 @@ public class Event {
|
||||
private Event() {
|
||||
try {
|
||||
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.xmlFileType = XMLFileType.Contents;
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ public class ControllerClient {
|
||||
BinaryMessageEncoder binaryMessage = new BinaryMessageEncoder(MessageType.BOATACTION, System.currentTimeMillis(), 0,
|
||||
(short) encodedBoatAction.length, encodedBoatAction);
|
||||
|
||||
System.out.println("Sending out key: " + protocolCode);
|
||||
outputStream.write(binaryMessage.getFullMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public class ControllerServer implements Runnable {
|
||||
BoatActionDecoder boatActionDecoder = new BoatActionDecoder(encodedMessage.getMessageBody());
|
||||
BoatActionEnum decodedMessage = boatActionDecoder.getBoatAction();
|
||||
int key = decodedMessage.getValue();
|
||||
System.out.println("Received key: " + key);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user