From 16a7cf63bfd2734caa7650fa22e21ad8ac9a5c4e Mon Sep 17 00:00:00 2001 From: Cyborger1 <45152844+Cyborger1@users.noreply.github.com> Date: Mon, 24 May 2021 18:10:02 -0400 Subject: [PATCH] Normalize current player name --- src/main/java/com/botdetector/BotDetectorPlugin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/botdetector/BotDetectorPlugin.java b/src/main/java/com/botdetector/BotDetectorPlugin.java index bc59f75e..e7bb5528 100644 --- a/src/main/java/com/botdetector/BotDetectorPlugin.java +++ b/src/main/java/com/botdetector/BotDetectorPlugin.java @@ -643,11 +643,13 @@ private void processPlayer(Player player) return; } + String playerName = normalizePlayerName(player.getName()); + if (player == client.getLocalPlayer()) { - if (loggedPlayerName == null || !loggedPlayerName.equals(player.getName())) + if (loggedPlayerName == null || !loggedPlayerName.equalsIgnoreCase(playerName)) { - loggedPlayerName = player.getName(); + loggedPlayerName = playerName; updateTimeToAutoSend(); refreshPlayerStats(true); } @@ -660,7 +662,6 @@ private void processPlayer(Player player) return; } - String playerName = normalizePlayerName(player.getName()); CaseInsensitiveString wrappedName = wrap(playerName); if (playerName == null) { @@ -737,7 +738,7 @@ private void verifyDiscord(ChatMessage chatMessage, String message) String author; if (chatMessage.getType().equals(ChatMessageType.PRIVATECHATOUT)) { - author = normalizePlayerName(loggedPlayerName); + author = loggedPlayerName; } else {