From 2f74e8d74d4d2d6cd588e04610b2464a52d559dd Mon Sep 17 00:00:00 2001 From: Spigot Date: Mon, 18 Feb 2013 17:46:31 +1100 Subject: [PATCH] Bit nicer for TagAPI By: md_5 --- CraftBukkit-Patches/0025-Netty.patch | 29 +++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/CraftBukkit-Patches/0025-Netty.patch b/CraftBukkit-Patches/0025-Netty.patch index b8cf39ff27..9780e2b17a 100644 --- a/CraftBukkit-Patches/0025-Netty.patch +++ b/CraftBukkit-Patches/0025-Netty.patch @@ -1,4 +1,4 @@ -From a83d974ced13c39e515fdfc3fa729e2dc68c7cfc Mon Sep 17 00:00:00 2001 +From 9a36abf31107d61dfaef4185db9753b098245ae8 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 14 Feb 2013 17:32:20 +1100 Subject: [PATCH] Netty @@ -18,14 +18,14 @@ This commit is licensed under the Creative Commons Attribution-ShareAlike 3.0 Un .../net/minecraft/server/Packet56MapChunkBulk.java | 2 +- .../net/minecraft/server/PendingConnection.java | 13 +- src/main/java/org/spigotmc/netty/CipherCodec.java | 65 ++++++ - .../org/spigotmc/netty/NettyNetworkManager.java | 209 +++++++++++++++++ + .../org/spigotmc/netty/NettyNetworkManager.java | 228 +++++++++++++++++++ .../org/spigotmc/netty/NettyServerConnection.java | 105 +++++++++ .../org/spigotmc/netty/NettySocketAdaptor.java | 248 +++++++++++++++++++++ .../java/org/spigotmc/netty/PacketDecoder.java | 63 ++++++ .../java/org/spigotmc/netty/PacketEncoder.java | 43 ++++ .../java/org/spigotmc/netty/PacketListener.java | 100 +++++++++ src/main/java/org/spigotmc/netty/ReadState.java | 16 ++ - 13 files changed, 866 insertions(+), 7 deletions(-) + 13 files changed, 885 insertions(+), 7 deletions(-) create mode 100644 src/main/java/org/spigotmc/netty/CipherCodec.java create mode 100644 src/main/java/org/spigotmc/netty/NettyNetworkManager.java create mode 100644 src/main/java/org/spigotmc/netty/NettyServerConnection.java @@ -203,10 +203,10 @@ index 0000000..f25af14 +} 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..5ae8a79 +index 0000000..5730244 --- /dev/null +++ b/src/main/java/org/spigotmc/netty/NettyNetworkManager.java -@@ -0,0 +1,209 @@ +@@ -0,0 +1,228 @@ +package org.spigotmc.netty; + +import io.netty.channel.Channel; @@ -216,6 +216,8 @@ index 0000000..5ae8a79 +import java.net.Socket; +import java.net.SocketAddress; +import java.security.PrivateKey; ++import java.util.AbstractList; ++import java.util.List; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ExecutorService; @@ -243,6 +245,22 @@ index 0000000..5ae8a79 + private static final NettyServerConnection serverConnection = (NettyServerConnection) server.ae(); + /*========================================================================*/ + private final Queue syncPackets = new ConcurrentLinkedQueue(); ++ private final List highPriorityQueue = new AbstractList() { ++ @Override ++ public void add(int index, Packet element) { ++ // NOP ++ } ++ ++ @Override ++ public Packet get(int index) { ++ throw new UnsupportedOperationException(); ++ } ++ ++ @Override ++ public int size() { ++ throw new UnsupportedOperationException(); ++ } ++ }; + private volatile boolean connected; + private Channel channel; + private SocketAddress address; @@ -327,6 +345,7 @@ index 0000000..5ae8a79 + packet = PacketListener.callQueued(this, handler, packet); + // If handler indicates packet send + if (packet != null) { ++ highPriorityQueue.add(packet); + channel.write(packet); + + // If needed, check and prepare encryption phase