diff --git a/CHANGELOG.md b/CHANGELOG.md index 6991e02..2a36444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,11 @@ Who knows what the future holds... # 0.X.Y - DD/MM/2023 ### Changes: -Nothing... yet. +Protocols: +- GameSpy 1: Add key `admin` as a possible variable for `admin_name`. + +Games: +- [Serious Sam](https://www.gog.com/game/serious_sam_the_first_encounter) support. ### Breaking: None. @@ -23,7 +27,6 @@ Protocols: - Valve: 1. Reversed (from `0.1.0`) "Players with no name are no more added to the `players_details` field.", also added a note in the [protocols](PROTOCOLS.md) file regarding this. 2. Fixed querying while multiple challenge responses might happen. - - GameSpy 1 support. ### Breaking: diff --git a/GAMES.md b/GAMES.md index f0e9723..5b0105c 100644 --- a/GAMES.md +++ b/GAMES.md @@ -47,6 +47,7 @@ Beware of the `Notes` column, as it contains information about query port offset | V Rising | VR | Valve Protocol | Query port is 27016. | | Unreal Tournament | UT | GameSpy 1 | Query Port offset: 1. | | Battlefield 1942 | BF1942 | GameSpy 1 | Query port is 23000. | +| Serious Sam | SS | GameSpy 1 | Query Port offset: 1 | ## Planned to add support: _ diff --git a/examples/master_querant.rs b/examples/master_querant.rs index 9e85693..501c584 100644 --- a/examples/master_querant.rs +++ b/examples/master_querant.rs @@ -1,6 +1,6 @@ use std::env; -use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, bf1942, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ohd, onset, pz, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned, ut, vr}; +use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, bf1942, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ohd, onset, pz, ror2, rust, sc, sdtd, ss, tf, tf2, tfc, ts, unturned, ut, vr}; use gamedig::protocols::minecraft::LegacyGroup; use gamedig::protocols::valve; use gamedig::protocols::valve::Engine; @@ -88,6 +88,7 @@ fn main() -> GDResult<()> { "_gamespy1_vars" => println!("{:#?}", gamespy::one::query_vars(ip, port.unwrap(), None)), "ut" => println!("{:#?}", ut::query(ip, port)), "bf1942" => println!("{:#?}", bf1942::query(ip, port)), + "ss" => println!("{:#?}", ss::query(ip, port)), _ => panic!("Undefined game: {}", args[1]) }; diff --git a/src/games/mod.rs b/src/games/mod.rs index 225cfab..6530c83 100644 --- a/src/games/mod.rs +++ b/src/games/mod.rs @@ -89,3 +89,5 @@ pub mod vr; pub mod ut; /// Battlefield 1942 pub mod bf1942; +/// Serious Sam +pub mod ss; diff --git a/src/games/ss.rs b/src/games/ss.rs new file mode 100644 index 0000000..40e132f --- /dev/null +++ b/src/games/ss.rs @@ -0,0 +1,7 @@ +use crate::GDResult; +use crate::protocols::gamespy; +use crate::protocols::gamespy::Response; + +pub fn query(address: &str, port: Option) -> GDResult { + gamespy::one::query(address, port.unwrap_or(25601), None) +} diff --git a/src/protocols/gamespy/protocol/one.rs b/src/protocols/gamespy/protocol/one.rs index 97d42f0..6acf458 100644 --- a/src/protocols/gamespy/protocol/one.rs +++ b/src/protocols/gamespy/protocol/one.rs @@ -172,7 +172,7 @@ pub fn query(address: &str, port: u16, timeout_settings: Option map: server_vars.remove("mapname").ok_or(GDError::PacketBad)?, map_title: server_vars.remove("maptitle"), admin_contact: server_vars.remove("AdminEMail"), - admin_name: server_vars.remove("AdminName"), + admin_name: server_vars.remove("AdminName").or(server_vars.remove("admin")), has_password: has_password(&mut server_vars)?, game_type: server_vars.remove("gametype").ok_or(GDError::PacketBad)?, game_version: server_vars.remove("gamever").ok_or(GDError::PacketBad)?,