diff options
Diffstat (limited to 'common/src/main/java')
-rw-r--r-- | common/src/main/java/com/sk89q/warmroast/StackNode.java | 6 | ||||
-rw-r--r-- | common/src/main/java/me/lucko/spark/common/CommandHandler.java | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/common/src/main/java/com/sk89q/warmroast/StackNode.java b/common/src/main/java/com/sk89q/warmroast/StackNode.java index f077309..8fd0661 100644 --- a/common/src/main/java/com/sk89q/warmroast/StackNode.java +++ b/common/src/main/java/com/sk89q/warmroast/StackNode.java @@ -36,6 +36,8 @@ import java.util.Map; */ public class StackNode implements Comparable<StackNode> { + private static final int MAX_STACK_DEPTH = 300; + /** * The name of this node */ @@ -87,6 +89,10 @@ public class StackNode implements Comparable<StackNode> { private void log(StackTraceElement[] elements, int skip, long time) { accumulateTime(time); + + if (skip >= MAX_STACK_DEPTH) { + return; + } if (elements.length - skip == 0) { return; diff --git a/common/src/main/java/me/lucko/spark/common/CommandHandler.java b/common/src/main/java/me/lucko/spark/common/CommandHandler.java index c015cb3..52cdbe1 100644 --- a/common/src/main/java/me/lucko/spark/common/CommandHandler.java +++ b/common/src/main/java/me/lucko/spark/common/CommandHandler.java @@ -51,6 +51,7 @@ public abstract class CommandHandler<T> { // abstract methods implemented by each platform protected abstract void sendMessage(T sender, String message); + protected abstract void sendLink(T sender, String url); protected abstract void runAsync(Runnable r); private void sendPrefixedMessage(T sender, String message) { @@ -231,7 +232,8 @@ public abstract class CommandHandler<T> { JsonObject output = sampler.formOutput(); try { String pasteId = Bytebin.postContent(output); - sendPrefixedMessage(sender, "&bSampling results: &7" + VIEWER_URL + pasteId); + sendPrefixedMessage(sender, "&bSampling results:"); + sendLink(sender, VIEWER_URL + pasteId); } catch (IOException e) { sendPrefixedMessage(sender, "&cAn error occurred whilst uploading the results."); e.printStackTrace(); |