Async Operation Catching

Catch and throw an exception when a potentially unsafe operation occurs on a thread other than the main server thread.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2014-03-25 16:10:01 +11:00
parent 973f52a650
commit 5240271410
12 changed files with 185 additions and 97 deletions

View File

@@ -898,6 +898,7 @@ public final class CraftServer implements Server {
public boolean dispatchCommand(CommandSender sender, String commandLine) {
Preconditions.checkArgument(sender != null, "sender cannot be null");
Preconditions.checkArgument(commandLine != null, "commandLine cannot be null");
org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot
if (this.commandMap.dispatch(sender, commandLine)) {
return true;