From f5a5b2bd7625debb67127a017a4e5d27cd6f052e Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 28 Apr 2013 08:29:00 +1000 Subject: [PATCH] Increment written bytes value --- CraftBukkit-Patches/0020-Netty.patch | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/CraftBukkit-Patches/0020-Netty.patch b/CraftBukkit-Patches/0020-Netty.patch index fd3f0f6765..870358574e 100644 --- a/CraftBukkit-Patches/0020-Netty.patch +++ b/CraftBukkit-Patches/0020-Netty.patch @@ -1,4 +1,4 @@ -From f6adddd68afa44beb63b7da41c1ee732bb24d482 Mon Sep 17 00:00:00 2001 +From 6d03a8b1c00c39c32edbaa447e41a8f1b7e5b2be Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 23 Apr 2013 11:47:32 +1000 Subject: [PATCH] Netty @@ -449,10 +449,10 @@ index 0000000..2dbbf6c +} diff --git a/src/main/java/org/spigotmc/netty/NettyNetworkManager.java b/src/main/java/org/spigotmc/netty/NettyNetworkManager.java new file mode 100644 -index 0000000..f581384 +index 0000000..319e22a --- /dev/null +++ b/src/main/java/org/spigotmc/netty/NettyNetworkManager.java -@@ -0,0 +1,293 @@ +@@ -0,0 +1,290 @@ +package org.spigotmc.netty; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -639,6 +639,7 @@ index 0000000..f581384 + throw new RuntimeException("Writing packet", ex); + } + } ++ writtenBytes += buf.readableBytes(); + + channel.write(buf).addListener(new ChannelFutureListener() { + public void operationComplete(ChannelFuture future) throws Exception { @@ -741,10 +742,6 @@ index 0000000..f581384 + public long getWrittenBytes() { + return writtenBytes; + } -+ -+ public void addWrittenBytes(int written) { -+ writtenBytes += written; -+ } +} diff --git a/src/main/java/org/spigotmc/netty/NettyServerConnection.java b/src/main/java/org/spigotmc/netty/NettyServerConnection.java new file mode 100644 @@ -1158,7 +1155,7 @@ index 0000000..65074d2 +} diff --git a/src/main/java/org/spigotmc/netty/PacketEncoder.java b/src/main/java/org/spigotmc/netty/PacketEncoder.java new file mode 100644 -index 0000000..c8832d6 +index 0000000..69dff43 --- /dev/null +++ b/src/main/java/org/spigotmc/netty/PacketEncoder.java @@ -0,0 +1,50 @@ @@ -1175,6 +1172,7 @@ index 0000000..c8832d6 + * Netty encoder which takes a packet and encodes it, and adds a byte packet id + * header. + */ ++// TODO: Remove this +public class PacketEncoder extends MessageToByteEncoder { + + private ByteBuf outBuf; @@ -1197,7 +1195,6 @@ index 0000000..c8832d6 + out.writeByte(msg.n()); + msg.a(dataOut); + -+ networkManager.addWrittenBytes(outBuf.readableBytes()); + out.writeBytes(outBuf); + out.discardSomeReadBytes(); + }