From 1881616f156240949d4f423d475b893048191349 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sat, 26 Nov 2016 22:02:19 -0600 Subject: [PATCH] Alter last to force conflicts but keep contents --- .../Optimise-NetworkManager.patch | 99 ++++++++++++------- 1 file changed, 63 insertions(+), 36 deletions(-) diff --git a/Spigot-Server-Patches/Optimise-NetworkManager.patch b/Spigot-Server-Patches/Optimise-NetworkManager.patch index fdd91a8412..b646b8d211 100644 --- a/Spigot-Server-Patches/Optimise-NetworkManager.patch +++ b/Spigot-Server-Patches/Optimise-NetworkManager.patch @@ -24,19 +24,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.m(); this.a(packet, (GenericFutureListener[]) null); - } else { -+ } -+ // Paper start -+ /* else { - this.j.writeLock().lock(); - - try { -@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - } finally { - this.j.writeLock().unlock(); - } -- } +- this.j.writeLock().lock(); - -+ }*/ +- try { +- this.i.add(new NetworkManager.QueuedPacket(packet, (GenericFutureListener[]) null)); +- } finally { +- this.j.writeLock().unlock(); +- } + } +- ++ // Paper start - Remove but force a conflict ++// else { ++// this.j.writeLock().lock(); ++// ++// try { ++// this.i.add(new NetworkManager.QueuedPacket(packet, (GenericFutureListener[]) null)); ++// } finally { ++// this.j.writeLock().unlock(); ++// } ++// } + // Paper end } @@ -45,19 +51,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.m(); this.a(packet, (GenericFutureListener[]) ArrayUtils.add(agenericfuturelistener, 0, genericfuturelistener)); - } else { -+ } -+ // Paper start -+ /* -+ else { - this.j.writeLock().lock(); - - try { -@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - this.j.writeLock().unlock(); - } +- this.j.writeLock().lock(); +- +- try { +- this.i.add(new NetworkManager.QueuedPacket(packet, (GenericFutureListener[]) ArrayUtils.add(agenericfuturelistener, 0, genericfuturelistener))); +- } finally { +- this.j.writeLock().unlock(); +- } } - -+ */ ++ // Paper start - Remove but force a conflict ++// else { ++// this.j.writeLock().lock(); ++// ++// try { ++// this.i.add(new NetworkManager.QueuedPacket(packet, (GenericFutureListener[]) ArrayUtils.add(agenericfuturelistener, 0, genericfuturelistener))); ++// } finally { ++// this.j.writeLock().unlock(); ++// } ++// } + // Paper end } @@ -67,17 +79,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private void m() { - if (this.channel != null && this.channel.isOpen()) { -+ // Paper start -+ /* if (this.channel != null && this.channel.isOpen()) { - this.j.readLock().lock(); - - try { -@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - this.j.readLock().unlock(); - } - +- this.j.readLock().lock(); +- +- try { +- while (!this.i.isEmpty()) { +- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.i.poll(); +- +- this.a(networkmanager_queuedpacket.a, networkmanager_queuedpacket.b); +- } +- } finally { +- this.j.readLock().unlock(); +- } +- - } -+ }*/ ++ // Paper start - Remove but force a conflict ++// if (this.channel != null && this.channel.isOpen()) { ++// this.j.readLock().lock(); ++// ++// try { ++// while (!this.i.isEmpty()) { ++// NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.i.poll(); ++// ++// this.a(networkmanager_queuedpacket.a, networkmanager_queuedpacket.b); ++// } ++// } finally { ++// this.j.readLock().unlock(); ++// } ++// ++// } + // Paper end } @@ -91,6 +120,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } --- -2.9.3 (Apple Git-75) - +-- \ No newline at end of file