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
@@ -0,0 +1,22 @@
package seng302.gameServer.server.messages;
public class RegistrationRequestMessage extends Message {
private static int MESSAGE_LENGTH = 2;
public RegistrationRequestMessage(ClientType type){
setHeader(new Header(MessageType.REGISTRATION_REQUEST, 1, (short) getSize()));
allocateBuffer();
writeHeaderToBuffer();
putInt(type.getCode(), 2);
writeCRC();
}
@Override
public int getSize() {
return MESSAGE_LENGTH;
}
}