diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e79fe8..48eda6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Generic query: Games: - [Halo: Combat Evolved](https://en.wikipedia.org/wiki/Halo:_Combat_Evolved) support. - [Just Cause 2: Multiplayer](https://store.steampowered.com/app/259080/Just_Cause_2_Multiplayer_Mod/) support. +- [Warsow](https://warsow.net/) support. ### Breaking... Protocols: diff --git a/GAMES.md b/GAMES.md index 833c279..3cf8a4b 100644 --- a/GAMES.md +++ b/GAMES.md @@ -58,6 +58,7 @@ Beware of the `Notes` column, as it contains information about query port offset | Soldier of Fortune 2 | SOF2 | Quake 3 | | | Halo: Combat Evolved | HALOCE | GameSpy 2 | | | Just Cause 2: Multiplayer | JC2MP | GameSpy 3 (*Altered) | | +| Warsow | WARSOW | Quake 3 | | ## Planned to add support: _ diff --git a/examples/master_querant.rs b/examples/master_querant.rs index f10ff4e..901e973 100644 --- a/examples/master_querant.rs +++ b/examples/master_querant.rs @@ -57,6 +57,7 @@ use gamedig::{ unturned, ut, vr, + warsow, GDResult, }; use std::env; @@ -191,6 +192,7 @@ fn main() -> GDResult<()> { "_gamespy2" => println!("{:#?}", gamespy::two::query(address, None)), "haloce" => println!("{:#?}", haloce::query(ip, port)?), "jc2mp" => println!("{:#?}", jc2mp::query(ip, port)?), + "warsow" => println!("{:#?}", warsow::query(ip, port)?), _ => panic!("Undefined game: {}", args[1]), }; diff --git a/src/games/definitions.rs b/src/games/definitions.rs index daa4571..81ea4ae 100644 --- a/src/games/definitions.rs +++ b/src/games/definitions.rs @@ -83,4 +83,5 @@ pub static GAMES: Map<&'static str, Game> = phf_map! { "ut" => game!("Unreal Tournament", 7778, Protocol::Gamespy(GameSpyVersion::One)), "vr" => game!("V Rising", 27016, Protocol::Valve(SteamApp::VR)), "jc2mp" => game!("Just Cause 2: Multiplayer", 7777, Protocol::PROPRIETARY(ProprietaryProtocol::JC2MP)), + "warsow" => game!("Warsow", 44400, Protocol::Quake(QuakeVersion::Three)), }; diff --git a/src/games/mod.rs b/src/games/mod.rs index 7447f23..4c406b4 100644 --- a/src/games/mod.rs +++ b/src/games/mod.rs @@ -111,6 +111,8 @@ pub mod unturned; pub mod ut; /// V Rising pub mod vr; +/// Warsow +pub mod warsow; use crate::protocols::gamespy::GameSpyVersion; use crate::protocols::quake::QuakeVersion; diff --git a/src/games/warsow.rs b/src/games/warsow.rs new file mode 100644 index 0000000..84a5796 --- /dev/null +++ b/src/games/warsow.rs @@ -0,0 +1,9 @@ +use crate::protocols::quake; +use crate::protocols::quake::two::Player; +use crate::protocols::quake::Response; +use crate::GDResult; +use std::net::{IpAddr, SocketAddr}; + +pub fn query(address: &IpAddr, port: Option) -> GDResult> { + quake::three::query(&SocketAddr::new(*address, port.unwrap_or(44400)), None) +}