There was an error while loading. Please reload this page.
1 parent f6735af commit 01c276aCopy full SHA for 01c276a
1 file changed
feather/server/src/initial_handler.rs
@@ -11,7 +11,7 @@ use protocol::{
11
codec::CryptKey,
12
packets::{
13
client::{HandshakeState, Ping},
14
- server::{EncryptionRequest, LoginSuccess, Pong, Response},
+ server::{DisconnectLogin, EncryptionRequest, LoginSuccess, Pong, Response},
15
},
16
ClientHandshakePacket, ClientLoginPacket, ClientPlayPacket, ClientStatusPacket,
17
ServerLoginPacket, ServerPlayPacket, ServerStatusPacket,
@@ -61,6 +61,18 @@ pub async fn handle(worker: &mut Worker) -> anyhow::Result<InitialHandling> {
61
match handshake.next_state {
62
HandshakeState::Status => handle_status(worker).await,
63
HandshakeState::Login => {
64
+ if handshake.protocol_version < PROTOCOL_VERSION {
65
+ worker
66
+ .write(ServerLoginPacket::DisconnectLogin(DisconnectLogin {
67
+ reason: Text::from(
68
+ "Invalid protocol! The server is running on version 1.16!",
69
+ )
70
+ .to_string(),
71
+ }))
72
+ .await
73
+ .ok();
74
+ return Ok(InitialHandling::Disconnect);
75
+ }
76
let proxy_data =
77
if let Some(crate::options::ProxyMode::Bungeecord) = worker.options().proxy_mode {
78
Some(proxy::do_bungee_ip_forwarding(&handshake)?)
0 commit comments