From bed74f6ab686cb34a642b2f2828ac60c9fe0342d Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Fri, 13 Sep 2013 09:35:53 +0200 Subject: [PATCH] Cleanup proxy packet injector in Spigot too. FIXES 127 --- .../comphenix/protocol/injector/PacketFilterManager.java | 2 ++ .../protocol/injector/spigot/SpigotPacketInjector.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java index 64686b22..63a55508 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PacketFilterManager.java @@ -1113,6 +1113,8 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok // Remove packet handlers if (packetInjector != null) packetInjector.cleanupAll(); + if (spigotInjector != null) + spigotInjector.cleanupAll(); // Remove server handler playerInjection.close(); diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java index e13c87f0..808c70a7 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/spigot/SpigotPacketInjector.java @@ -545,4 +545,13 @@ public class SpigotPacketInjector implements SpigotPacketListener { else throw new PlayerLoggedOutException("Player " + player + " has logged out"); } + + /** + * Invoked when the server is cleaning up. + */ + public void cleanupAll() { + if (proxyPacketInjector != null) { + proxyPacketInjector.cleanupAll(); + } + } }