mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Protocol] GameSpy 1 support with the games Unreal Tournament and Battlefield 1942. (#9)
* Initial files + unreal tournament * Fix master_querant * Split by delimiter and collect into hashmap * Furter port to accept more packets * Improve getting the server's values * Some initial players parsing * Players parsing * Add error handling * Add some more fields * Add Battlefield 1942 support. * Add query_vars and some docs
This commit is contained in:
parent
5604436553
commit
950c08c18e
12 changed files with 276 additions and 5 deletions
|
|
@ -1,9 +1,10 @@
|
|||
|
||||
use std::env;
|
||||
use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, 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, 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, tf, tf2, tfc, ts, unturned, ut, vr};
|
||||
use gamedig::protocols::minecraft::LegacyGroup;
|
||||
use gamedig::protocols::valve;
|
||||
use gamedig::protocols::valve::Engine;
|
||||
use gamedig::protocols::gamespy;
|
||||
|
||||
fn main() -> GDResult<()> {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
|
|
@ -83,6 +84,10 @@ fn main() -> GDResult<()> {
|
|||
"avorion" => println!("{:#?}", avorion::query(ip, port)?),
|
||||
"ohd" => println!("{:#?}", ohd::query(ip, port)?),
|
||||
"vr" => println!("{:#?}", vr::query(ip, port)?),
|
||||
"_gamespy1" => println!("{:#?}", gamespy::one::query(ip, port.unwrap(), None)),
|
||||
"_gamespy1_vars" => println!("{:#?}", gamespy::one::query_vars(ip, port.unwrap(), None)),
|
||||
"ut" => println!("{:#?}", ut::query(ip, port)),
|
||||
"bf1942" => println!("{:#?}", bf1942::query(ip, port)),
|
||||
_ => panic!("Undefined game: {}", args[1])
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue