aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2024-06-09 10:26:17 +0100
committerLuck <git@lucko.me>2024-06-09 10:26:17 +0100
commitc3aa0cd5d855f6cb831ffc1389f00f234b328fb2 (patch)
treeedafb2fed70e4fd501626036035059cddb208ebc
parent3ac58fd0dd69418725412e830c63cf70f1422bb4 (diff)
downloadspark-c3aa0cd5d855f6cb831ffc1389f00f234b328fb2.tar.gz
spark-c3aa0cd5d855f6cb831ffc1389f00f234b328fb2.tar.bz2
spark-c3aa0cd5d855f6cb831ffc1389f00f234b328fb2.zip
Add note to /spark profiler open about expiry time
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java
index ad0557d..076dad0 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java
@@ -479,6 +479,20 @@ public class SamplerModule implements CommandModule {
.build()
);
+ String cmd = "/" + platform.getPlugin().getCommandName() + " profiler stop";
+ resp.broadcastPrefixed(text()
+ .append(text("(Note: this link is temporary and will expire after a short period of time. " +
+ "If you need a link to share with other people (e.g. in a bug report), please use ", GRAY))
+ .append(text()
+ .content(cmd)
+ .color(WHITE)
+ .clickEvent(ClickEvent.runCommand(cmd))
+ .build()
+ )
+ .append(text(" instead.)", GRAY))
+ .build()
+ );
+
platform.getActivityLog().addToLog(Activity.urlActivity(resp.sender(), System.currentTimeMillis(), "Profiler (live)", url));
} catch (Exception e) {
resp.replyPrefixed(text("An error occurred whilst opening the live profiler.", RED));