mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Half-Life Deathmatch: Source support.
This commit is contained in:
parent
663fb6a66e
commit
d671bb0310
6 changed files with 20 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ Who knows what the future holds...
|
||||||
[Counter-Strike](https://store.steampowered.com/app/10/CounterStrike/) support.
|
[Counter-Strike](https://store.steampowered.com/app/10/CounterStrike/) support.
|
||||||
[Arma 2: Operation Arrowhead](https://store.steampowered.com/app/33930/Arma_2_Operation_Arrowhead/) support.
|
[Arma 2: Operation Arrowhead](https://store.steampowered.com/app/33930/Arma_2_Operation_Arrowhead/) support.
|
||||||
[Day of Infamy](https://store.steampowered.com/app/447820/Day_of_Infamy/) support.
|
[Day of Infamy](https://store.steampowered.com/app/447820/Day_of_Infamy/) support.
|
||||||
|
[Half-Life Deathmatch: Source](https://store.steampowered.com/app/360/HalfLife_Deathmatch_Source/) support.
|
||||||
Successfully tested `Alien Swarm` and `Insurgency: Modern Infantry Combat`.
|
Successfully tested `Alien Swarm` and `Insurgency: Modern Infantry Combat`.
|
||||||
Restored rules response for `Counter-Strike: Global Offensive` (note: for a full player list response, the cvar `host_players_show` must be set to `2`).
|
Restored rules response for `Counter-Strike: Global Offensive` (note: for a full player list response, the cvar `host_players_show` must be set to `2`).
|
||||||
Increased Valve Protocol `PACKET_SIZE` from 1400 to 6144 (because some games send larger packets than the specified protocol size).
|
Increased Valve Protocol `PACKET_SIZE` from 1400 to 6144 (because some games send larger packets than the specified protocol size).
|
||||||
|
|
|
||||||
1
GAMES.md
1
GAMES.md
|
|
@ -29,6 +29,7 @@ A supported game is defined as a game that has been successfully tested, other g
|
||||||
| Counter-Strike | CS | Valve Protocol (GoldSrc) | |
|
| Counter-Strike | CS | Valve Protocol (GoldSrc) | |
|
||||||
| Arma 2: Operation Arrowhead | ARMA2OA | Valve Protocol | Use the query port. |
|
| Arma 2: Operation Arrowhead | ARMA2OA | Valve Protocol | Use the query port. |
|
||||||
| Day of Infamy | DOI | Valve Protocol | |
|
| Day of Infamy | DOI | Valve Protocol | |
|
||||||
|
| Half-Life Deathmatch: Source | HLDMS | Valve Protocol | |
|
||||||
|
|
||||||
## Planned to add support:
|
## Planned to add support:
|
||||||
_
|
_
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use gamedig::{aliens, arma2oa, ase, asrd, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, ins, insmic, inss, l4d, l4d2, mc, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
|
use gamedig::{aliens, arma2oa, ase, asrd, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
|
||||||
use gamedig::protocols::minecraft::{LegacyGroup, Server};
|
use gamedig::protocols::minecraft::{LegacyGroup, Server};
|
||||||
use gamedig::protocols::valve;
|
use gamedig::protocols::valve;
|
||||||
use gamedig::protocols::valve::App;
|
use gamedig::protocols::valve::App;
|
||||||
|
|
@ -63,6 +63,7 @@ fn main() -> GDResult<()> {
|
||||||
"cs" => println!("{:#?}", cs::query(ip, port)?),
|
"cs" => println!("{:#?}", cs::query(ip, port)?),
|
||||||
"arma2oa" => println!("{:#?}", arma2oa::query(ip, port)?),
|
"arma2oa" => println!("{:#?}", arma2oa::query(ip, port)?),
|
||||||
"doi" => println!("{:#?}", doi::query(ip, port)?),
|
"doi" => println!("{:#?}", doi::query(ip, port)?),
|
||||||
|
"hldms" => println!("{:#?}", hldms::query(ip, port)?),
|
||||||
"_src" => println!("{:#?}", valve::query(ip, port.unwrap(), App::Source(None), None, None)?),
|
"_src" => println!("{:#?}", valve::query(ip, port.unwrap(), App::Source(None), None, None)?),
|
||||||
"_gld" => println!("{:#?}", valve::query(ip, port.unwrap(), App::GoldSrc(false), None, None)?),
|
"_gld" => println!("{:#?}", valve::query(ip, port.unwrap(), App::GoldSrc(false), None, None)?),
|
||||||
"_gld_f" => println!("{:#?}", valve::query(ip, port.unwrap(), App::GoldSrc(true), None, None)?),
|
"_gld_f" => println!("{:#?}", valve::query(ip, port.unwrap(), App::GoldSrc(true), None, None)?),
|
||||||
|
|
|
||||||
12
src/games/hldms.rs
Normal file
12
src/games/hldms.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
use crate::GDResult;
|
||||||
|
use crate::protocols::valve;
|
||||||
|
use crate::protocols::valve::{game, SteamID};
|
||||||
|
|
||||||
|
pub fn query(address: &str, port: Option<u16>) -> GDResult<game::Response> {
|
||||||
|
let valve_response = valve::query(address, match port {
|
||||||
|
None => 27015,
|
||||||
|
Some(port) => port
|
||||||
|
}, SteamID::HLDMS.as_app(), None, None)?;
|
||||||
|
|
||||||
|
Ok(game::Response::new_from_valve_response(valve_response))
|
||||||
|
}
|
||||||
|
|
@ -55,3 +55,5 @@ pub mod cs;
|
||||||
pub mod arma2oa;
|
pub mod arma2oa;
|
||||||
/// Day of Infamy
|
/// Day of Infamy
|
||||||
pub mod doi;
|
pub mod doi;
|
||||||
|
/// Half-Life Deathmatch: Source
|
||||||
|
pub mod hldms;
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,8 @@ pub enum SteamID {
|
||||||
DODS = 300,
|
DODS = 300,
|
||||||
/// Half-Life 2 Deathmatch
|
/// Half-Life 2 Deathmatch
|
||||||
HL2DM = 320,
|
HL2DM = 320,
|
||||||
|
/// Half-Life Deathmatch: Source
|
||||||
|
HLDMS = 360,
|
||||||
/// Team Fortress 2
|
/// Team Fortress 2
|
||||||
TF2 = 440,
|
TF2 = 440,
|
||||||
/// Left 4 Dead
|
/// Left 4 Dead
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue