diff --git a/src/bedrock.rs b/src/bedrock.rs index ebc7352..04baf8d 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, @@ -51,6 +51,7 @@ impl From for crate::JavaServerInfo { enforces_secure_chat: None, prevents_chat_reports: None, previews_chat: None, + forge_data: None, } } } diff --git a/src/parse.rs b/src/parse.rs index cd72516..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)] @@ -29,8 +31,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>, } 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) => {