get rod of an unnecessary allocation that was using a lot of mem

This commit is contained in:
Eoghanmc22 2021-03-07 21:41:09 -05:00
parent a61034fc1d
commit f7cd00fb18

View File

@ -163,8 +163,8 @@ public class NettyPlayerConnection extends PlayerConnection {
if (message instanceof FramedPacket) {
final FramedPacket framedPacket = (FramedPacket) message;
synchronized (tickBuffer) {
// Duplicate is necessary because of cached packets
tickBuffer.writeBytes(framedPacket.getBody().duplicate());
final ByteBuf body = framedPacket.getBody();
tickBuffer.writeBytes(body, body.readerIndex(), body.readableBytes());
}
return;
} else if (message instanceof ServerPacket) {