Implemented new client - server handshake protocol

- Implemented new packet types
- Changed server & client logic to use new protocol

Tags: #story[1124] (Issue 39)
This commit is contained in:
Michael Rausch
2017-08-10 19:01:30 +12:00
parent 9c79897e01
commit 09c4f98056
11 changed files with 274 additions and 111 deletions
@@ -19,7 +19,9 @@ public enum PacketType {
COURSE_WIND,
AVG_WIND,
BOAT_ACTION,
OTHER;
OTHER,
RACE_REGISTRATION_REQUEST,
RACE_REGISTRATION_RESPONSE;
public static PacketType assignPacketType(int packetType, byte[] payload){
switch(packetType){
@@ -56,6 +58,10 @@ public enum PacketType {
return AVG_WIND;
case 100:
return BOAT_ACTION;
case 101:
return RACE_REGISTRATION_REQUEST;
case 102:
return RACE_REGISTRATION_RESPONSE;
default:
}
return OTHER;