diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index 06b2583e..a425bd2c 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -346,7 +346,12 @@ impl Player { return; } - // TODO: filter message & validation + if message.chars().any(|c| c == 'ยง' || c < ' ' || c == '\x7F') { + self.kick(TextComponent::text("Illegal characters in chat")) + .await; + return; + } + let gameprofile = &self.gameprofile; log::info!("{}: {}", gameprofile.name, message);