Skip to content

Commit

Permalink
Add Harassment Warning (#183)
Browse files Browse the repository at this point in the history
* Add Harassment Warning and info

* Contract "DO NOT" to "DON'T" to avoid ellipses

* Some text changes

* More text changes
  • Loading branch information
Cyborger1 authored Jun 25, 2024
1 parent 6867120 commit 21db8b7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/main/java/com/botdetector/BotDetectorConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -82,6 +83,31 @@ 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 = "<html>We have received reports of legitimate players being harassed by users of this plugin." +
"<br>" +
"<br>Bot predictions from this plugin are not to be taken at face value, as players with lower" +
"<br>total XP or account builds that generally deviate from the expected average may throw" +
"<br>off our Machine Learning models, resulting in reductions in 'Real Player' confidence." +
"<br>" +
"<br>We ask that you <b>do not harass other players based on our predictions</b>." +
"<br>Harassment never helps, as bots do not care and legitimate players suffer unnecessarily." +
"<br>" +
"<br>For more context, please read the plugin's FAQ, available on both the plugin's GitHub" +
"<br>page and our Discord server before you continue using the plugin." +
"<br>" +
"<br>Thank you," +
"<br>- The Bot Detector team.</html>"
)
default boolean acknowledgedHarassmentWarning()
{
return false;
}

@ConfigItem(
position = 1,
keyName = ANONYMOUS_UPLOADING_KEY,
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/botdetector/BotDetectorPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/botdetector/ui/BotDetectorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ public enum WarningLabel
NAME_ERROR(Icons.ERROR_ICON, " Invalid Player Name",
"<html>Your player name could not be loaded correctly."
+ "<br>Most likely you spawned on Tutorial Island or your name was forcibly reset by Jagex."
+ "<br>Try relogging after setting a name.</html>")
+ "<br>Try relogging after setting a name.</html>"),
HARASSMENT_WARNING(Icons.STRONG_WARNING_ICON, " Please Don't Harass Players",
"<html>We have received reports of legitimate players being harassed by users of this plugin." +
"<br>You may remove this message by acknowledging and reading more about it in the plugin's config.</html>")
;

private final Icon image;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/botdetector/ui/Icons.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class Icons
public static final ImageIcon WEB_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "web.png"));
public static final ImageIcon TWITTER_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "twitter.png"));
public static final ImageIcon WARNING_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "warning.png"));
public static final ImageIcon STRONG_WARNING_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "strong_warning.png"));
public static final ImageIcon ERROR_ICON = new ImageIcon(ImageUtil.loadImageResource(PLUGIN_CLASS, "error.png"));

// Must not be ImageUtil.loadImageResource as it produces a static image
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 21db8b7

Please sign in to comment.