diff --git a/feather/server/src/initial_handler.rs b/feather/server/src/initial_handler.rs index 4266d5884..6a4d16b9c 100644 --- a/feather/server/src/initial_handler.rs +++ b/feather/server/src/initial_handler.rs @@ -27,6 +27,7 @@ use uuid::Uuid; use self::proxy::ProxyData; +const VERSION_STRING: &str = "1.16.5"; const SERVER_NAME: &str = "Feather 1.16.5"; const PROTOCOL_VERSION: i32 = 754; @@ -45,8 +46,7 @@ pub struct NewPlayer { /// Result of initial handling. pub enum InitialHandling { - /// The client should be disconnected (sent when - /// the connection was just a "status" ping.) + /// The client should be disconnected. Disconnect, /// We should create a new player. Join(NewPlayer), @@ -63,12 +63,13 @@ pub async fn handle(worker: &mut Worker) -> anyhow::Result { match handshake.next_state { HandshakeState::Status => handle_status(worker).await, HandshakeState::Login => { - if handshake.protocol_version < PROTOCOL_VERSION { + if handshake.protocol_version != PROTOCOL_VERSION { worker .write(ServerLoginPacket::DisconnectLogin(DisconnectLogin { - reason: Text::from( - "Invalid protocol! The server is running on version 1.16!", - ) + reason: Text::from(format!( + "Invalid protocol! The server is running on version {}!", + VERSION_STRING, + )) .to_string(), })) .await