mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user