Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/bedrock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64>,
pub map_name: Option<String>,
pub game_mode: Option<String>,
Expand Down Expand Up @@ -51,6 +51,7 @@ impl From<BedrockServerInfo> for crate::JavaServerInfo {
enforces_secure_chat: None,
prevents_chat_reports: None,
previews_chat: None,
forge_data: None,
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub struct JavaServerInfo {
pub previews_chat: Option<bool>,
/// Servers will set this field to `true` if they block chat messages that cannot be reported to Mojang.
pub enforces_secure_chat: Option<bool>,
/// Forge servers will include additional data in this field.
pub forge_data: Option<serde_json::Value>,
}

#[derive(Serialize, Deserialize, Debug, Hash, Clone, PartialEq, Eq)]
Expand All @@ -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<Vec<ServerPlayersSample>>,
}

Expand Down
1 change: 1 addition & 0 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ pub async fn connect(mut addrs: (String, u16)) -> Result<SlpProtocol, ProtocolEr
match TcpStream::connect(socket_addrs).await {
Ok(stream) => {
info!("Connected to SLP server");
stream.set_nodelay(true)?;
Ok(SlpProtocol::new(addrs.0, addrs.1, stream))
}
Err(error) => {
Expand Down