Added size/type to the return packet.

This commit is contained in:
ProfMobius committed 2014-10-02 15:32:30 +02:00
1 parent e099f67fb0
commit 3692055926
2 files changed
+9 -5

No files matched your search

@@ -94,9 +94,13 @@ public class RConServer implements Runnable {
ChannelHandlerContext ctx = RConServer.instance.fakePlayers.get(player);
packet.encode(output);
ByteBuf msg = ctx.alloc().buffer(output.toByteArray().length);
msg.writeBytes(output.toByteArray());
ctx.write(msg);
byte[] data = output.toByteArray();
ByteBuf buf = ctx.alloc().buffer(data.length);
buf.writeInt(data.length);
buf.writeByte(packetTypes.indexOf(packet.getClass()));
buf.writeBytes(data);
ctx.write(buf);
ctx.flush();
modOpis.log.info("We should be sending back something here");