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 Jun 18, 2021
1 parent 94fc104 commit 16a7cf6
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 @@ -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);
}
Expand All @@ -660,7 +662,6 @@ private void processPlayer(Player player)
return;
}

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

0 comments on commit 16a7cf6

Please sign in to comment.