diff --git a/src/client.rs b/src/client.rs index dadb8a8..e3ebc87 100644 --- a/src/client.rs +++ b/src/client.rs @@ -750,9 +750,6 @@ impl Client { C2sPlayPacket::QueryEntityNbt(_) => {} C2sPlayPacket::PlayerInteractEntity(p) => { if let Some(id) = entities.get_with_network_id(p.entity_id.0) { - // TODO: verify that the client has line of sight to the targeted entity and - // that the distance is <=4 blocks. - self.events.push_back(ClientEvent::InteractWithEntity { id, sneaking: p.sneaking, @@ -851,9 +848,6 @@ impl Client { C2sPlayPacket::CraftRequest(_) => {} C2sPlayPacket::UpdatePlayerAbilities(_) => {} C2sPlayPacket::PlayerAction(p) => { - // TODO: verify dug block is within the correct distance from the client. - // TODO: verify that the broken block is allowed to be broken? - if p.sequence.0 != 0 { self.dug_blocks.push(p.sequence.0); } diff --git a/src/client/event.rs b/src/client/event.rs index d5aab3a..f4efa83 100644 --- a/src/client/event.rs +++ b/src/client/event.rs @@ -16,7 +16,18 @@ use crate::protocol::VarInt; /// Represents an action performed by a client. /// /// Client events can be obtained from -/// [`pop_event`](crate::client::Client::pop_event). +/// [`pop_event`](super::Client::pop_event). +/// +/// # Event Validation +/// +/// [`Client`](super::Client) makes no attempt to validate events against the +/// expected rules for players. Malicious clients can teleport through walls, +/// interact with distant entities, sneak and sprint backwards, break +/// bedrock in survival mode, etc. +/// +/// It is best to think of events from clients as _requests_ to interact with +/// the server. It is then your responsibility to decide if the request should +/// be honored. #[derive(Debug)] pub enum ClientEvent { /// A regular message was sent to the chat.