Allow removal of packet handler

This commit is contained in:
libraryaddict 2014-11-25 23:36:53 +13:00
parent 3ae27ccc55
commit c76ad50136
2 changed files with 15 additions and 0 deletions

View File

@ -51,4 +51,14 @@ public class PacketHandler extends MiniPlugin
verifier.addPacketHandler(packetHandler);
}
}
public void removePacketHandler(IPacketHandler packetHandler)
{
_packetHandlers.remove(packetHandler);
for (PacketVerifier verifier : _playerVerifierMap.values())
{
verifier.removePacketHandler(packetHandler);
}
}
}

View File

@ -88,4 +88,9 @@ public class PacketVerifier implements IPacketVerifier
{
_packetHandlers.add(packetHandler);
}
public void removePacketHandler(IPacketHandler packetHandler)
{
_packetHandlers.remove(packetHandler);
}
}