mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-22 23:04:57 +00:00
Sanitize join & leave usernames
This commit is contained in:
parent
bd564798f0
commit
1f3a900e61
1 changed files with 3 additions and 2 deletions
|
@ -756,7 +756,7 @@ public class PlayerListener implements Listener {
|
|||
}
|
||||
|
||||
if (PlayerList.existsEntry(player)) {
|
||||
DiscordBridge.transmitMessage(String.format("**%s left the server**", player.getDisplayName()));
|
||||
DiscordBridge.transmitMessage(String.format("**%s left the server**", DiscordBridge.sanitizeMessage(player.getDisplayName())));
|
||||
}
|
||||
|
||||
PlayerList.removeEntry(player);
|
||||
|
@ -771,6 +771,7 @@ public class PlayerListener implements Listener {
|
|||
final String ip = Utilities.getIp(player);
|
||||
final Player playerEntry;
|
||||
Log.info("[JOIN] " + Utilities.formatPlayer(player) + " joined the game with IP address: " + ip, true);
|
||||
|
||||
// Check absolute value to account for negatives
|
||||
if (Math.abs(player.getLocation().getX()) >= MAX_XY_COORD || Math.abs(player.getLocation().getZ()) >= MAX_XY_COORD)
|
||||
{
|
||||
|
@ -907,7 +908,7 @@ public class PlayerListener implements Listener {
|
|||
PlayerData.getPlayerData(player).setTag(playerTag);
|
||||
}
|
||||
}
|
||||
DiscordBridge.transmitMessage(String.format("**%s joined the server**", player.getDisplayName()));
|
||||
DiscordBridge.transmitMessage(String.format("**%s joined the server**", DiscordBridge.sanitizeMessage(player.getDisplayName())));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
|
|
Loading…
Reference in a new issue