Skip to content

Commit 21db8b7

Browse files
authored
Add Harassment Warning (#183)
* Add Harassment Warning and info * Contract "DO NOT" to "DON'T" to avoid ellipses * Some text changes * More text changes
1 parent 6867120 commit 21db8b7

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

src/main/java/com/botdetector/BotDetectorConfig.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public interface BotDetectorConfig extends Config
5050
String SHOW_FEEDBACK_TEXTBOX = "showFeedbackTextbox";
5151
String SHOW_DISCORD_VERIFICATION_ERRORS = "showDiscordVerificationErrors";
5252
String ANONYMOUS_UUID_KEY = "anonymousUUID";
53+
String ACKNOWLEDGED_HARASSMENT_WARNING_KEY = "acknowledgedHarassmentWarning";
5354

5455
int AUTO_SEND_MINIMUM_MINUTES = 5;
5556
int AUTO_SEND_MAXIMUM_MINUTES = 360;
@@ -82,6 +83,31 @@ public interface BotDetectorConfig extends Config
8283
)
8384
String miscSection = "miscSection";
8485

86+
@ConfigItem(
87+
position = 1,
88+
keyName = ACKNOWLEDGED_HARASSMENT_WARNING_KEY,
89+
name = "Acknowledge Harassment Warning",
90+
description = "Set this config to acknowledge you understand not to harass other players while using this plugin.",
91+
warning = "<html>We have received reports of legitimate players being harassed by users of this plugin." +
92+
"<br>" +
93+
"<br>Bot predictions from this plugin are not to be taken at face value, as players with lower" +
94+
"<br>total XP or account builds that generally deviate from the expected average may throw" +
95+
"<br>off our Machine Learning models, resulting in reductions in 'Real Player' confidence." +
96+
"<br>" +
97+
"<br>We ask that you <b>do not harass other players based on our predictions</b>." +
98+
"<br>Harassment never helps, as bots do not care and legitimate players suffer unnecessarily." +
99+
"<br>" +
100+
"<br>For more context, please read the plugin's FAQ, available on both the plugin's GitHub" +
101+
"<br>page and our Discord server before you continue using the plugin." +
102+
"<br>" +
103+
"<br>Thank you," +
104+
"<br>- The Bot Detector team.</html>"
105+
)
106+
default boolean acknowledgedHarassmentWarning()
107+
{
108+
return false;
109+
}
110+
85111
@ConfigItem(
86112
position = 1,
87113
keyName = ANONYMOUS_UPLOADING_KEY,

src/main/java/com/botdetector/BotDetectorPlugin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ protected void startUp()
332332
SwingUtilities.invokeLater(() ->
333333
{
334334
panel.setWarningVisible(BotDetectorPanel.WarningLabel.ANONYMOUS, config.enableAnonymousUploading());
335+
panel.setWarningVisible(BotDetectorPanel.WarningLabel.HARASSMENT_WARNING, !config.acknowledgedHarassmentWarning());
335336
panel.setPluginVersion(detectorClient.getPluginVersion());
336337
panel.setNamesUploaded(0, false);
337338
panel.setNamesUploaded(0, true);
@@ -615,6 +616,12 @@ private void onConfigChanged(ConfigChanged event)
615616
panel.forceHideFlaggingPanel();
616617
});
617618
break;
619+
case BotDetectorConfig.ACKNOWLEDGED_HARASSMENT_WARNING_KEY:
620+
SwingUtilities.invokeLater(() ->
621+
panel.setWarningVisible(
622+
BotDetectorPanel.WarningLabel.HARASSMENT_WARNING,
623+
!config.acknowledgedHarassmentWarning()));
624+
break;
618625
case BotDetectorConfig.PANEL_FONT_TYPE_KEY:
619626
SwingUtilities.invokeLater(() -> panel.setFontType(config.panelFontType()));
620627
break;

src/main/java/com/botdetector/ui/BotDetectorPanel.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ public enum WarningLabel
120120
NAME_ERROR(Icons.ERROR_ICON, " Invalid Player Name",
121121
"<html>Your player name could not be loaded correctly."
122122
+ "<br>Most likely you spawned on Tutorial Island or your name was forcibly reset by Jagex."
123-
+ "<br>Try relogging after setting a name.</html>")
123+
+ "<br>Try relogging after setting a name.</html>"),
124+
HARASSMENT_WARNING(Icons.STRONG_WARNING_ICON, " Please Don't Harass Players",
125+
"<html>We have received reports of legitimate players being harassed by users of this plugin." +
126+
"<br>You may remove this message by acknowledging and reading more about it in the plugin's config.</html>")
124127
;
125128

126129
private final Icon image;

src/main/java/com/botdetector/ui/Icons.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class Icons
3939
public static final ImageIcon WEB_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "web.png"));
4040
public static final ImageIcon TWITTER_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "twitter.png"));
4141
public static final ImageIcon WARNING_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "warning.png"));
42+
public static final ImageIcon STRONG_WARNING_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "strong_warning.png"));
4243
public static final ImageIcon ERROR_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "error.png"));
4344

4445
// Must not be ImageUtil.loadImageResource as it produces a static image
Loading

0 commit comments

Comments
 (0)