Message types for Request and Response created, and Messages for them also created.

tags: #story[1142]
This commit is contained in:
Alistair McIntyre
2017-08-14 15:30:42 +12:00
parent 3754b71f4d
commit 1f09005147
2 changed files with 40 additions and 6 deletions
@@ -0,0 +1,28 @@
package seng302.gameServer.server.messages;
/**
* Created by ajm412 on 14/08/17.
*/
public class CustomizeResponseMessage extends Message {
private static int MESSAGE_LENGTH = 2;
public CustomizeResponseMessage(CustomizeResponseType responseType) {
setHeader(new Header(MessageType.CUSTOMIZATION_RESPONSE, 1, (short) getSize()));
allocateBuffer();
writeHeaderToBuffer();
putInt(responseType.getType(), 2);
writeCRC();
rewind();
}
@Override
public int getSize() {
return MESSAGE_LENGTH; // placeholder
}
}