Skip to content

Commit

Permalink
Normalize current player name
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyborger1 committed Jul 14, 2021
1 parent 5aa1145 commit 41b9c38
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/com/botdetector/BotDetectorPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -689,7 +691,6 @@ private void processPlayer(Player player)
return;
}

String playerName = normalizePlayerName(player.getName());
CaseInsensitiveString wrappedName = wrap(playerName);
if (playerName == null)
{
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 41b9c38

Please sign in to comment.