Three way handshake implemented client and server side and functioning

Server generates a new Id for connections (Size of connections + 1)
Client now stores an id allocated to it by the server
The id is currently being saved in the clientToServer thread client side

tags: #story[987] #implement
This commit is contained in:
William Muir
2017-07-22 17:44:37 +12:00
parent 3ec930491f
commit 2869d139a3
3 changed files with 88 additions and 26 deletions
@@ -121,4 +121,14 @@ public class GameState {
yacht.update(timeInterval);
}
}
/**
* Generates a new ID based off the size of current players + 1
* @return a playerID to be allocated to a new connetion
*/
public static Integer getUniquePlayerID() {
// TODO: 22/07/17 wmu16 - This may not be robust enough and may have to be improved on.
return yachts.size() + 1;
}
}