From 2a40d3d7897e38074d72bfd437b1cbb527024f2d Mon Sep 17 00:00:00 2001
From: Cyborger1 <45152844+Cyborger1@users.noreply.github.com>
Date: Sun, 23 Jun 2024 14:46:33 -0400
Subject: [PATCH 1/4] Add Harassment Warning and info
---
.../com/botdetector/BotDetectorConfig.java | 24 ++++++++++++++++++
.../com/botdetector/BotDetectorPlugin.java | 7 +++++
.../com/botdetector/ui/BotDetectorPanel.java | 5 +++-
src/main/java/com/botdetector/ui/Icons.java | 1 +
.../com/botdetector/ui/strong_warning.png | Bin 0 -> 830 bytes
5 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 src/main/resources/com/botdetector/ui/strong_warning.png
diff --git a/src/main/java/com/botdetector/BotDetectorConfig.java b/src/main/java/com/botdetector/BotDetectorConfig.java
index dc7bade7..41c8b82c 100644
--- a/src/main/java/com/botdetector/BotDetectorConfig.java
+++ b/src/main/java/com/botdetector/BotDetectorConfig.java
@@ -50,6 +50,7 @@ public interface BotDetectorConfig extends Config
String SHOW_FEEDBACK_TEXTBOX = "showFeedbackTextbox";
String SHOW_DISCORD_VERIFICATION_ERRORS = "showDiscordVerificationErrors";
String ANONYMOUS_UUID_KEY = "anonymousUUID";
+ String ACKNOWLEDGED_HARASSMENT_WARNING_KEY = "acknowledgedHarassmentWarning";
int AUTO_SEND_MINIMUM_MINUTES = 5;
int AUTO_SEND_MAXIMUM_MINUTES = 360;
@@ -82,6 +83,29 @@ public interface BotDetectorConfig extends Config
)
String miscSection = "miscSection";
+ @ConfigItem(
+ position = 1,
+ keyName = ACKNOWLEDGED_HARASSMENT_WARNING_KEY,
+ name = "Acknowledge Harassment Warning",
+ description = "Set this config to acknowledge you understand not to harass other players while using this plugin.",
+ warning = "We have received reports of legitimate players being harassed by users of this plugin." +
+ "
" +
+ "
Bot predictions from this plugin are not to be taken at face value, as players with lower" +
+ "
total XP or account builds that generally deviate from the expected average may throw off" +
+ "
our Machine Learning models, resulting in erroneous reductions in 'Real Player' confidence." +
+ "
" +
+ "
We ask that you do not harass players based on a potentially faulty prediction." +
+ "
For more context, please read the plugin's FAQ, available on both the plugin's GitHub page" +
+ "
and our Discord server before you continue using the plugin." +
+ "
" +
+ "
Thank you," +
+ "
- The Bot Detector team."
+ )
+ default boolean acknowledgedHarassmentWarning()
+ {
+ return false;
+ }
+
@ConfigItem(
position = 1,
keyName = ANONYMOUS_UPLOADING_KEY,
diff --git a/src/main/java/com/botdetector/BotDetectorPlugin.java b/src/main/java/com/botdetector/BotDetectorPlugin.java
index 2042dfbb..af3726ab 100644
--- a/src/main/java/com/botdetector/BotDetectorPlugin.java
+++ b/src/main/java/com/botdetector/BotDetectorPlugin.java
@@ -332,6 +332,7 @@ protected void startUp()
SwingUtilities.invokeLater(() ->
{
panel.setWarningVisible(BotDetectorPanel.WarningLabel.ANONYMOUS, config.enableAnonymousUploading());
+ panel.setWarningVisible(BotDetectorPanel.WarningLabel.HARASSMENT_WARNING, !config.acknowledgedHarassmentWarning());
panel.setPluginVersion(detectorClient.getPluginVersion());
panel.setNamesUploaded(0, false);
panel.setNamesUploaded(0, true);
@@ -615,6 +616,12 @@ private void onConfigChanged(ConfigChanged event)
panel.forceHideFlaggingPanel();
});
break;
+ case BotDetectorConfig.ACKNOWLEDGED_HARASSMENT_WARNING_KEY:
+ SwingUtilities.invokeLater(() ->
+ panel.setWarningVisible(
+ BotDetectorPanel.WarningLabel.HARASSMENT_WARNING,
+ !config.acknowledgedHarassmentWarning()));
+ break;
case BotDetectorConfig.PANEL_FONT_TYPE_KEY:
SwingUtilities.invokeLater(() -> panel.setFontType(config.panelFontType()));
break;
diff --git a/src/main/java/com/botdetector/ui/BotDetectorPanel.java b/src/main/java/com/botdetector/ui/BotDetectorPanel.java
index e7cb4278..8cf205f2 100644
--- a/src/main/java/com/botdetector/ui/BotDetectorPanel.java
+++ b/src/main/java/com/botdetector/ui/BotDetectorPanel.java
@@ -120,7 +120,10 @@ public enum WarningLabel
NAME_ERROR(Icons.ERROR_ICON, " Invalid Player Name",
"Your player name could not be loaded correctly."
+ "
Most likely you spawned on Tutorial Island or your name was forcibly reset by Jagex."
- + "
Try relogging after setting a name.")
+ + "
Try relogging after setting a name.