Try to clean up after a failed hook.

This commit is contained in:
Kristian S. Stangeland 2012-09-27 05:22:08 +02:00
parent 240df9dc7a
commit eb8abd4635

View File

@ -433,9 +433,18 @@ public final class PacketFilterManager implements ProtocolManager {
break;
} catch (Exception e) {
// Mark this injection attempt as a failure
logger.log(Level.SEVERE, "Player hook " + currentHook.toString() + " failed.", e);
// Clean up as much as possible
try {
if (injector != null)
injector.cleanupAll();
} catch (Exception e2) {
logger.log(Level.WARNING, "Cleaing up after player hook failed.", e);
}
if (currentHook.ordinal() > 0) {
// Choose the previous player hook type
currentHook = PlayerInjectHooks.values()[currentHook.ordinal() - 1];