deepslate 0.2.0

A high-performance Minecraft server proxy written in Rust.
Documentation
//! Server list ping response builder.

use deepslate_protocol::version::ProtocolVersion;
use serde_json::json;

/// Build the default server list ping JSON response.
#[must_use]
pub fn build_status_response(
    motd: &str,
    max_players: i32,
    online_count: i32,
    protocol_version: i32,
) -> serde_json::Value {
    json!({
        "version": {
            "name": format!("Deepslate {}", ProtocolVersion::SUPPORTED_VERSIONS),
            "protocol": protocol_version
        },
        "players": {
            "max": max_players,
            "online": online_count,
            "sample": []
        },
        "description": {
            "text": motd
        },
        "enforcesSecureChat": false
    })
}