From aba21e69ec132e00f281e3ee65bdaebd75f6b4c2 Mon Sep 17 00:00:00 2001 From: jj hunt Date: Mon, 4 Nov 2024 22:25:47 +0000 Subject: [PATCH 1/5] Add tcp no delay --- src/protocol.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/protocol.rs b/src/protocol.rs index de4db40..03dea4e 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -320,6 +320,7 @@ pub async fn connect(mut addrs: (String, u16)) -> Result { info!("Connected to SLP server"); + stream.set_nodelay(true)?; Ok(SlpProtocol::new(addrs.0, addrs.1, stream)) } Err(error) => { From 4634d7e66017722bcdc768c28261a2813cdb9a2b Mon Sep 17 00:00:00 2001 From: Night_Hunter Date: Mon, 9 Dec 2024 18:40:18 +1300 Subject: [PATCH 2/5] fix types to match spec --- src/parse.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse.rs b/src/parse.rs index cd72516..ce4e483 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -29,8 +29,8 @@ pub struct ServerVersion { #[derive(Serialize, Deserialize, Debug, Hash, Clone, PartialEq, Eq)] #[non_exhaustive] pub struct ServerPlayers { - pub max: u32, - pub online: u32, + pub max: i32, + pub online: i32, pub sample: Option>, } From bf28a492e06d76de2f8f14db575befd9e0fbc70c Mon Sep 17 00:00:00 2001 From: Night_Hunter Date: Mon, 9 Dec 2024 18:43:51 +1300 Subject: [PATCH 3/5] fix bed rock --- src/bedrock.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bedrock.rs b/src/bedrock.rs index ebc7352..df88871 100644 --- a/src/bedrock.rs +++ b/src/bedrock.rs @@ -20,8 +20,8 @@ pub struct BedrockServerInfo { pub name: String, pub protocol_version: u32, pub mc_version: String, - pub online_players: u32, - pub max_players: u32, + pub online_players: i32, + pub max_players: i32, pub server_id: Option, pub map_name: Option, pub game_mode: Option, From e4c59470e69f860e736a3124a6d39983d05509ac Mon Sep 17 00:00:00 2001 From: Night_Hunter Date: Tue, 17 Dec 2024 02:44:42 +1300 Subject: [PATCH 4/5] add forge data field --- src/parse.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/parse.rs b/src/parse.rs index ce4e483..eba92f8 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -17,6 +17,8 @@ pub struct JavaServerInfo { pub previews_chat: Option, /// Servers will set this field to `true` if they block chat messages that cannot be reported to Mojang. pub enforces_secure_chat: Option, + /// Forge servers will include additional data in this field. + pub forge_data: Option, } #[derive(Serialize, Deserialize, Debug, Hash, Clone, PartialEq, Eq)] From 1c08e60f3b93add8c091a7dfc169d22f6f3144e6 Mon Sep 17 00:00:00 2001 From: Night_Hunter Date: Tue, 17 Dec 2024 02:48:01 +1300 Subject: [PATCH 5/5] fix bedrock --- src/bedrock.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bedrock.rs b/src/bedrock.rs index df88871..04baf8d 100644 --- a/src/bedrock.rs +++ b/src/bedrock.rs @@ -51,6 +51,7 @@ impl From for crate::JavaServerInfo { enforces_secure_chat: None, prevents_chat_reports: None, previews_chat: None, + forge_data: None, } } }