From 41b9c38f416d6dd1c41f8e624dde3473c1c54e0d 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 3d2cf357..75effee2 100644 --- a/src/main/java/com/botdetector/BotDetectorPlugin.java +++ b/src/main/java/com/botdetector/BotDetectorPlugin.java @@ -672,11 +672,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); } @@ -689,7 +691,6 @@ private void processPlayer(Player player) return; } - String playerName = normalizePlayerName(player.getName()); CaseInsensitiveString wrappedName = wrap(playerName); if (playerName == null) { @@ -779,7 +780,7 @@ private void verifyDiscord(ChatMessage chatMessage, String message) String author; if (chatMessage.getType().equals(ChatMessageType.PRIVATECHATOUT)) { - author = normalizePlayerName(loggedPlayerName); + author = loggedPlayerName; } else {