PLW error handling
This commit is contained in:
parent
34e3bb0ead
commit
0e24344efd
1 changed files with 4 additions and 3 deletions
|
@ -15,20 +15,21 @@ public class GeneralEventBroadcasterModule extends Component<DiscordPlugin> {
|
||||||
PlayerListWatcher.hookUp();
|
PlayerListWatcher.hookUp();
|
||||||
DPUtils.getLogger().info("Finished hooking into the player list");
|
DPUtils.getLogger().info("Finished hooking into the player list");
|
||||||
hooked = true;
|
hooked = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception | NoClassDefFoundError e) {
|
||||||
TBMCCoreAPI.SendException("Error while hacking the player list!", e);
|
TBMCCoreAPI.SendException("Error while hacking the player list! Disable this module if you're on an incompatible version.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void disable() {
|
protected void disable() {
|
||||||
try {
|
try {
|
||||||
|
if (!hooked) return;
|
||||||
if (PlayerListWatcher.hookDown())
|
if (PlayerListWatcher.hookDown())
|
||||||
DPUtils.getLogger().info("Finished unhooking the player list!");
|
DPUtils.getLogger().info("Finished unhooking the player list!");
|
||||||
else
|
else
|
||||||
DPUtils.getLogger().info("Didn't have the player list hooked.");
|
DPUtils.getLogger().info("Didn't have the player list hooked.");
|
||||||
hooked = false;
|
hooked = false;
|
||||||
} catch (Exception e) {
|
} catch (Exception | NoClassDefFoundError e) {
|
||||||
TBMCCoreAPI.SendException("Error while hacking the player list!", e);
|
TBMCCoreAPI.SendException("Error while hacking the player list!", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue