diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bad1465..4961485 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,7 +128,7 @@ jobs: - name: Install MSRV uses: actions-rs/toolchain@v1 with: - toolchain: 1.71.1 + toolchain: 1.81.0 override: true - name: Run MSRV run: cargo check -p gamedig @@ -151,7 +151,7 @@ jobs: - name: Install Formatting nightly uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2023-07-09 + toolchain: nightly-2025-04-19 components: rustfmt override: true - name: Run Formatting check diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f69eeda..f0e01d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: language: system files: '([.]rs|Cargo\.toml)$' pass_filenames: false - entry: rustup run --install nightly-2023-07-09 cargo-clippy -- --workspace --all-features -- -D warnings + entry: rustup run --install nightly-2025-04-19 cargo-clippy -- --workspace --all-features -- -D warnings - id: build-no-features name: Check crate build with no features @@ -36,14 +36,14 @@ repos: language: system files: '([.]rs|Cargo\.toml)$' pass_filenames: false - entry: rustup run --install nightly-2023-07-09 cargo-fmt --check + entry: rustup run --install nightly-2025-04-19 cargo-fmt --check - id: msrv name: Check MSRV compiles (lib only) language: system files: '([.]rs|Cargo\.toml)$' pass_filenames: false - entry: rustup run --install 1.71.1 cargo check -p gamedig + entry: rustup run --install 1.81.0 cargo check -p gamedig - id: docs name: Check rustdoc compiles diff --git a/.rustfmt.toml b/.rustfmt.toml index 313f091..d410c70 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -27,7 +27,7 @@ format_macro_bodies = true format_strings = true group_imports = "Preserve" hard_tabs = false -hide_parse_errors = false +show_parse_errors = true hex_literal_case = "Preserve" ignore = [] indent_style = "Block" @@ -48,7 +48,7 @@ overflow_delimited_expr = false reorder_impl_items = false reorder_imports = true reorder_modules = true -required_version = "1.6.0" +required_version = "1.8.0" short_array_element_width_threshold = 10 single_line_if_else_max_width = 50 skip_children = false @@ -67,6 +67,6 @@ unstable_features = false use_field_init_shorthand = false use_small_heuristics = "Default" use_try_shorthand = true -version = "Two" +style_edition = "2021" where_single_line = true wrap_comments = true diff --git a/README.md b/README.md index 7954ccd..9e6010a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ on Discord. ## Usage -Minimum Supported Rust Version is `1.71.1"` and the code is cross-platform. +Minimum Supported Rust Version is `1.81.0` and the code is cross-platform. Pick a game/service/protocol (check the [GAMES](GAMES.md), [SERVICES](SERVICES.md) and [PROTOCOLS](PROTOCOLS.md) files to see the currently supported ones), provide the ip and the port (be aware that some game servers use a separate port @@ -101,8 +101,8 @@ Want to see more examples? Checkout the [examples](crates/lib/examples) folder. ## Command Line Interface -The library also has an [official CLI](https://crates.io/crates/gamedig_cli) that you can use but it has -MSRV of `1.74.1`. +The library also has an [official CLI](https://crates.io/crates/gamedig_cli) that you can use, it has +MSRV of `1.81.0`. ## Documentation diff --git a/VERSIONS.md b/VERSIONS.md index 5968444..6826097 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -1,6 +1,6 @@ # MSRV (Minimum Supported Rust Version) -Current: `1.71.1` +Current: `1.81.0` Places to update: @@ -11,7 +11,7 @@ Places to update: # rustfmt version -Current: `1.6.0` +Current: `1.8.0` Places to update: @@ -22,7 +22,7 @@ Places to update: The toolchain version used to run rustfmt in CI -Current: `nightly-2023-07-09` +Current: `nightly-2025-04-19` Places to update: diff --git a/crates/cli/CHANGELOG.md b/crates/cli/CHANGELOG.md index 15cf9ca..f6c59f3 100644 --- a/crates/cli/CHANGELOG.md +++ b/crates/cli/CHANGELOG.md @@ -4,6 +4,16 @@ Who knows what the future holds... Nothing... yet. +# 0.3.0 - 23/04/2025 + +### Changes: + +- CLI now uses `gamedig` v0.7.0 (To update, run `cargo install gamedig_cli`). + +### Breaking Changes: + +- MSRV has been updated to `1.81.0` to match the latest `gamedig` version. + # 0.2.1 - 05/12/2024 Dependencies: diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index d7dd247..ae93492 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -5,14 +5,14 @@ authors = [ ] description = "A command line interface for gamedig" license = "MIT" -version = "0.2.1" +version = "0.3.0" edition = "2021" default-run = "gamedig_cli" homepage = "https://gamedig.github.io/" repository = "https://github.com/gamedig/rust-gamedig" readme = "README.md" keywords = ["server", "query", "game", "check", "status"] -rust-version = "1.74.1" +rust-version = "1.81.0" categories = ["command-line-interface"] [features] @@ -33,7 +33,7 @@ browser = ["dep:webbrowser"] # Core Dependencies thiserror = "2.0.0" clap = { version = "4.5.4", default-features = false, features = ["derive"] } -gamedig = { version = "0.6.1", default-features = false, features = [ +gamedig = { version = "0.7.0", default-features = false, features = [ "clap", "games", "game_defs", diff --git a/crates/lib/CHANGELOG.md b/crates/lib/CHANGELOG.md index 2a1d292..a1f6a0d 100644 --- a/crates/lib/CHANGELOG.md +++ b/crates/lib/CHANGELOG.md @@ -2,12 +2,20 @@ Who knows what the future holds... # X.Y.Z - DD/MM/YYYY -# 0.6.2 - DD/MM/YYYY +# 0.7.0 - 23/04/2025 + +Breaking: + +- MSRV is now `1.81.0` (was `1.71.1`), this is due to deps we rely on requiring a higher version Games: - Added `Arma 3` support (by @Perondas). +Crate: + +- Some minor clippy fixes + # 0.6.1 - 05/12/2024 Games: diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index e3587ab..9aadfa0 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gamedig" -version = "0.6.1" +version = "0.7.0" edition = "2021" authors = [ "rust-GameDig contributors [https://github.com/gamedig/rust-gamedig/contributors]", @@ -13,7 +13,7 @@ documentation = "https://docs.rs/gamedig/latest/gamedig/" repository = "https://github.com/gamedig/rust-gamedig" readme = "README.md" keywords = ["server", "query", "game", "check", "status"] -rust-version = "1.71.1" +rust-version = "1.81.0" categories = ["parser-implementations", "parsing", "network-programming", "encoding"] [features] diff --git a/crates/lib/README.md b/crates/lib/README.md index 54d71e4..e000d5c 100644 --- a/crates/lib/README.md +++ b/crates/lib/README.md @@ -36,7 +36,7 @@ on Discord. ## Usage -Minimum Supported Rust Version is `1.71.1` and the code is cross-platform. +Minimum Supported Rust Version is `1.81.0` and the code is cross-platform. Pick a game/service/protocol (check the [GAMES](https://github.com/gamedig/rust-gamedig/blob/main/GAMES.md), [SERVICES](https://github.com/gamedig/rust-gamedig/blob/main/SERVICES.md) diff --git a/crates/lib/src/buffer.rs b/crates/lib/src/buffer.rs index d16745d..dff7cf0 100644 --- a/crates/lib/src/buffer.rs +++ b/crates/lib/src/buffer.rs @@ -132,14 +132,13 @@ impl<'a, B: ByteOrder> Buffer<'a, B> { /// # Type Parameters /// /// * `D` - The type of string decoder to use. This type must implement the - /// `StringDecoder` trait with the same byte order as the buffer. + /// `StringDecoder` trait with the same byte order as the buffer. /// /// # Arguments /// /// * `until` - An optional delimiter. If provided, the method will read - /// until this - /// delimiter is encountered. If not provided, the method will read until - /// the default delimiter of the decoder. + /// until this delimiter is encountered. If not provided, the method will + /// read until the default delimiter of the decoder. /// /// # Errors /// diff --git a/crates/lib/src/games/ffow/protocol.rs b/crates/lib/src/games/ffow/protocol.rs index 9eb7423..95899d0 100644 --- a/crates/lib/src/games/ffow/protocol.rs +++ b/crates/lib/src/games/ffow/protocol.rs @@ -40,7 +40,7 @@ pub fn query_with_timeout( let environment_type = Environment::from_gldsrc(buffer.read::()?)?; let has_password = buffer.read::()? == 1; let vac_secured = buffer.read::()? == 1; - buffer.move_cursor(1)?; //average fps + buffer.move_cursor(1)?; // average fps let round = buffer.read::()?; let rounds_maximum = buffer.read::()?; let time_left = buffer.read::()?; diff --git a/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs b/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs index 1609a29..6e40320 100644 --- a/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs +++ b/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs @@ -165,7 +165,7 @@ impl GameSpy3 { let id = buf.read::()?; let is_last = (id & 0x80) > 0; let packet_id = (id & 0x7f) as usize; - buf.move_cursor(1)?; //unknown byte regarding packet no. + buf.move_cursor(1)?; // unknown byte regarding packet no. if is_last && packet_id + 1 != values.len() { reached_expected_packets_size = true; diff --git a/crates/lib/src/protocols/valve/protocol.rs b/crates/lib/src/protocols/valve/protocol.rs index 042079c..04a83ea 100644 --- a/crates/lib/src/protocols/valve/protocol.rs +++ b/crates/lib/src/protocols/valve/protocol.rs @@ -33,7 +33,7 @@ use std::collections::HashMap; use std::net::SocketAddr; #[derive(Debug)] -#[allow(dead_code)] //remove this later on +#[allow(dead_code)] // remove this later on struct SplitPacket { pub header: u32, pub id: u32, @@ -48,7 +48,7 @@ struct SplitPacket { impl SplitPacket { fn new(engine: &Engine, protocol: u8, buffer: &mut Buffer) -> GDResult { - let header = buffer.read()?; //buffer.get_u32()?; + let header = buffer.read()?; // buffer.get_u32()?; let id = buffer.read()?; let (total, number, size, decompressed) = match engine { Engine::GoldSrc(_) => { @@ -218,8 +218,8 @@ impl ValveProtocol { } fn get_goldsrc_server_info(buffer: &mut Buffer) -> GDResult { - let _header: u8 = buffer.read()?; //get the header (useless info) - let _address: String = buffer.read_string::(None)?; //get the server address (useless info) + let _header: u8 = buffer.read()?; // get the header (useless info) + let _address: String = buffer.read_string::(None)?; // get the server address (useless info) let name = buffer.read_string::(None)?; let map = buffer.read_string::(None)?; let folder = buffer.read_string::(None)?; @@ -381,7 +381,7 @@ impl ValveProtocol { let mut players: Vec = Vec::with_capacity(count); for _ in 0 .. count { - buffer.move_cursor(1)?; //skip the index byte + buffer.move_cursor(1)?; // skip the index byte players.push(ServerPlayer { name: buffer.read_string::(None)?, diff --git a/crates/lib/src/services/valve_master_server/service.rs b/crates/lib/src/services/valve_master_server/service.rs index f9e992c..7a43090 100644 --- a/crates/lib/src/services/valve_master_server/service.rs +++ b/crates/lib/src/services/valve_master_server/service.rs @@ -30,7 +30,7 @@ fn construct_payload(region: Region, filters: &Option, last_ip: & // The last fetched ip as a string last_ip.as_bytes(), // Followed by an ':' - &[b':'], + b":", // And the port, as a string last_port.to_string().as_bytes(), // Which needs to end with a NULL byte