mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 07:17:27 +00:00
Games: Age of Chivalry support.
This commit is contained in:
parent
9c9a096b16
commit
e2f42008b2
6 changed files with 20 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ Games:
|
|||
- [Battalion 1944](https://store.steampowered.com/app/489940/BATTALION_Legacy/) support.
|
||||
- [Black Mesa](https://store.steampowered.com/app/362890/Black_Mesa/) support.
|
||||
- [Project Zomboid](https://store.steampowered.com/app/108600/Project_Zomboid/) support.
|
||||
- [Age of Chivalry](https://store.steampowered.com/app/17510/Age_of_Chivalry/) support.
|
||||
|
||||
Protocols:
|
||||
- Valve: Players with no name are no more added to the `players_details` field.
|
||||
|
|
|
|||
1
GAMES.md
1
GAMES.md
|
|
@ -34,6 +34,7 @@ A supported game is defined as a game that has been successfully tested, other g
|
|||
| Battalion 1944 | BAT1944 | Valve Protocol | Query port offset: 3. It is strongly recommended to also query the rules, as the game sends server information's in them. |
|
||||
| Black Mesa | BM | Valve Protocol | |
|
||||
| Project Zomboid | PZ | Valve Protocol | |
|
||||
| Age of Chivalry | AOC | Valve Protocol | |
|
||||
|
||||
## Planned to add support:
|
||||
_
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
use std::env;
|
||||
use gamedig::{aliens, arma2oa, ase, asrd, bat1944, bm, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, pz, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
|
||||
use gamedig::{aliens, aoc, arma2oa, ase, asrd, bat1944, bm, cs, cscz, csgo, css, dod, dods, doi, GDResult, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, pz, ror2, rust, sc, sdtd, tf, tf2, tfc, ts, unturned};
|
||||
use gamedig::protocols::minecraft::LegacyGroup;
|
||||
use gamedig::protocols::valve;
|
||||
use gamedig::protocols::valve::App;
|
||||
|
|
@ -73,6 +73,7 @@ fn main() -> GDResult<()> {
|
|||
"bat1944" => println!("{:#?}", bat1944::query(ip, port)?),
|
||||
"bm" => println!("{:#?}", bm::query(ip, port)?),
|
||||
"pz" => println!("{:#?}", pz::query(ip, port)?),
|
||||
"aoc" => println!("{:#?}", aoc::query(ip, port)?),
|
||||
_ => panic!("Undefined game: {}", args[1])
|
||||
};
|
||||
|
||||
|
|
|
|||
12
src/games/aoc.rs
Normal file
12
src/games/aoc.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::AOC.as_app(), None, None)?;
|
||||
|
||||
Ok(game::Response::new_from_valve_response(valve_response))
|
||||
}
|
||||
|
|
@ -65,3 +65,5 @@ pub mod bat1944;
|
|||
pub mod bm;
|
||||
/// Project Zomboid
|
||||
pub mod pz;
|
||||
/// Age of Chivalry
|
||||
pub mod aoc;
|
||||
|
|
|
|||
|
|
@ -169,6 +169,8 @@ pub enum SteamID {
|
|||
TS = 2400,
|
||||
/// Garry's Mod
|
||||
GM = 4000,
|
||||
/// Age of Chivalry
|
||||
AOC = 17510,
|
||||
/// Insurgency: Modern Infantry Combat
|
||||
INSMIC = 17700,
|
||||
/// ARMA 2: Operation Arrowhead
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue