Request Messages now sending to server, need to update game and send response packet.

tags: #story[1142]
This commit is contained in:
Alistair McIntyre
2017-08-16 14:54:50 +12:00
parent bd213bcd9e
commit 1db75a8ae4
8 changed files with 115 additions and 7 deletions
@@ -203,6 +203,9 @@ public class ServerToClientThread implements Runnable, Observer {
completeRegistration(requestedType);
break;
case RACE_CUSTOMIZATION_REQUEST:
System.out.println("CUSTOMIZATION RECEIVED");
}
} else {
logger.warn("Packet has been dropped", 1);
@@ -12,12 +12,12 @@ public class CustomizeRequestMessage extends Message {
public CustomizeRequestMessage(CustomizeRequestType customizeType, double sourceID,
byte[] payload) {
payloadLength = payload.length;
setHeader(new Header(MessageType.CUSTOMIZATION_REQUEST, 1, (short) getSize()));
allocateBuffer();
writeHeaderToBuffer();
payloadLength = payload.length;
putInt((int) sourceID, 4);
putInt((int) customizeType.getType(), 2);
putBytes(payload);