Add a couple of extra error handlers.
Dieser Commit ist enthalten in:
Ursprung
2239c1ea32
Commit
8636215b98
@ -590,27 +590,43 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
|
|||||||
manager.registerEvents(new Listener() {
|
manager.registerEvents(new Listener() {
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onPrePlayerJoin(PlayerJoinEvent event) {
|
public void onPrePlayerJoin(PlayerJoinEvent event) {
|
||||||
// Let's clean up the other injection first.
|
try {
|
||||||
playerInjection.uninjectPlayer(event.getPlayer().getAddress());
|
// Let's clean up the other injection first.
|
||||||
|
playerInjection.uninjectPlayer(event.getPlayer().getAddress());
|
||||||
|
} catch (Exception e) {
|
||||||
|
reporter.reportDetailed(PacketFilterManager.this, "Unable to uninject net handler for player.", e, event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
// This call will be ignored if no listeners are registered
|
try {
|
||||||
playerInjection.injectPlayer(event.getPlayer());
|
// This call will be ignored if no listeners are registered
|
||||||
|
playerInjection.injectPlayer(event.getPlayer());
|
||||||
|
} catch (Exception e) {
|
||||||
|
reporter.reportDetailed(PacketFilterManager.this, "Unable to inject player.", e, event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
playerInjection.handleDisconnect(event.getPlayer());
|
try {
|
||||||
playerInjection.uninjectPlayer(event.getPlayer());
|
playerInjection.handleDisconnect(event.getPlayer());
|
||||||
|
playerInjection.uninjectPlayer(event.getPlayer());
|
||||||
|
} catch (Exception e) {
|
||||||
|
reporter.reportDetailed(PacketFilterManager.this, "Unable to uninject logged off player.", e, event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onPluginDisabled(PluginDisableEvent event) {
|
public void onPluginDisabled(PluginDisableEvent event) {
|
||||||
// Clean up in case the plugin forgets
|
try {
|
||||||
if (event.getPlugin() != plugin) {
|
// Clean up in case the plugin forgets
|
||||||
removePacketListeners(event.getPlugin());
|
if (event.getPlugin() != plugin) {
|
||||||
|
removePacketListeners(event.getPlugin());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
reporter.reportDetailed(PacketFilterManager.this, "Unable handle disabled plugin.", e, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren