Created FrameRateTracker which can be used to track framerate.
Updated RequestToJoinEnum and JoinAcceptanceEnum to match the agreed connection API.
Added AssignPlayerBoat message, which is used internally on the client to assign the player a source ID once they have connected.
Fixed some race conditions in the MessageRouter.
Updated ConnectionAcceptor.CheckClientConnection to wait slightly longer before removing connection (there was a slight race condition before).
Race no longer has a reference to LatestMessages. LatestMessages no longer has specific messages types in it.
Created RaceState class, which contains the state that is shared between VisualiserRaceState and MockRaceState (currently only used on visualiser).
Split VisualiserRace into VisualiserRaceState and VisualiserRaceService.
Added the VisualiserRace commands (BoatLocatonCommand, RaceStatusCommand, etc...).
Slightly increased the preferred width of race.fxml table columns.
issues #27#37#35
#story[1095]
Added ConnectionToServerCommandFactory, and JoinSuccessfulCommand, RaceParticipantsFullCOmmand, ServerFullCommand.
Added IncomingHeartBeatCommandFactory, and IncomingHeartBeatCommand.
Added ConnectionToServerState, which represents the client's connection state to server.
Renamed VisualiserInput to VisualiserRaceController.
Added ConnectionToServer, which tracks the client's connection to server.
Added ConnectionToServerController, which accepts JoinAcceptance messages, turns them into commands, and passes them to ConnectionToServer.
Added IncomingHeartBeatService, which tracks the heart beat status of the connection.
Added IncomingHeartBeatController, which accepts HeartBeat messages, turns them into commands, and passes them to IncomingHeartBeatService.
Refactored ServerConnection a bit.
#story[1095]
-updated port and starboard boat checks
-added gps method to check if on correct side of a line
-updated pos check method to make boats round marks with the new tech
# Conflicts:
# racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
# racevisionGame/src/main/java/mock/app/Event.java
# racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
# racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
-updated port and starboard boat checks
-added gps method to check if on correct side of a line
-updated pos check method to make boats round marks with the new tech
# Conflicts:
# racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
# racevisionGame/src/main/java/mock/app/Event.java
# racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
# racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
Also got client-server handshake working. Multiple clients can connect and control their own boat.
The client's boat has a larger black triangle drawn around it. Probably needs tidying up.
Added isClientBoat boolean to VisualiserBoat.
WindGenerator is now an interface, implemented by ConstantWindGenerator (useful for testing) and RandomWindGenerator. Added ConstantWindGeneratorTest.
RandomWindGenerator was formerly WindGenerator.
The WindGenerator is passed in to MockRace.
CommandFactory throws a CommandConstructionException if it cannot create a command.
MessageSerialiser and MessageDeserialiser correctly terminate on error.
Readded VisualiserInput's switch statement in the main loop, pending a refactor.
Removed the sleep statement from LobbyController - it was blocking javaFX thread.
Lobby.fxml: moved buttons and text input into grid panes, so they don't break when you resize screen.
Added some test object creation functions in several test classes (MockRaceTest.createMockRace(), BoatXMLReaderTest.createBoatDataSource(), etc...).
#story[1095]
Pom profile fix
The racevisionGame pom still had "profiles", which aren't needed with a single jar build, and the built jar didn't have a mainifest/main class.
See merge request !19
Issue 28 & 36 - encoders and decoders refactor
This resolves#28#36.
This was on the story_61 branch, but I figured it may be helpful to push this into master/other branches before then.
The main changes:
- Moved encoding functions from RaceVisionByteEncoder into their own encoder classes.
- Added a EncoderFactory and DecoderFactory, which return correct en/decoder based on MessageType.
- All encoders implement MessageEncoder interface, and all decoder implement MessageDecoder interface.
Extra changes:
- Added names to most threads that are created.
- Removed the nested while loop from MockOutput, and moved the XML stuff before the main loop (functionally it's the same).
See merge request !23
63. [C, M] I'd like to be able to make small adjustments to the heading of my boat, as Gemma, either upwind or downwind.
Note: each keypress should change the boat's heading by a small amount (3 degrees?) Pressing the 'upwind' key will turn the boat's head towards the wind by that small amount, while the 'downwind' key will do the opposite. Continuing to press the downwind key when the boat is already heading straight downwind, or upwind when heading directly upwind, achieves nothing.
Acceptance criteria:
- The player boat turns towards wind a small amount for each press of the 'upwind' key.
- The player boat turns away from the wind by a small amount for each press of the 'downwind' key.
- If the boat heading is directly into wind after a series of 'upwind' keypresses, the heading will continue to change in the same direction for one more keypress.
- Substitute 'downwind' for 'upwind' for the downwind case.
See merge request !21