[Games] Add Crysis Wars support.

This commit is contained in:
CosminPerRam 2023-04-30 01:26:12 +03:00
parent 3ef599056a
commit 33e8f43cb8
5 changed files with 13 additions and 49 deletions

View file

@ -14,6 +14,7 @@ Protocols:
Games:
- [Serious Sam](https://www.gog.com/game/serious_sam_the_first_encounter) support.
- [Frontlines: Fuel of War](https://store.steampowered.com/app/9460/Frontlines_Fuel_of_War/) support.
- [Crysis Wars](https://steamcommunity.com/app/17340) support.
Services:
- [Valve Master Server Query](https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol) support.

View file

@ -49,6 +49,7 @@ Beware of the `Notes` column, as it contains information about query port offset
| Battlefield 1942 | BF1942 | GameSpy 1 | Query port is 23000. |
| Serious Sam | SS | GameSpy 1 | Query Port offset: 1. |
| Frontlines: Fuel of War | FFOW | Valve Protocol (Proprietary) | Query Port offset: 2. |
| Crysis Wars | CW | GameSpy 3 | |
## Planned to add support:
_

View file

@ -2,55 +2,7 @@ use gamedig::protocols::gamespy;
use gamedig::protocols::minecraft::LegacyGroup;
use gamedig::protocols::valve;
use gamedig::protocols::valve::Engine;
use gamedig::{
aliens,
aoc,
arma2oa,
ase,
asrd,
avorion,
bat1944,
bb2,
bf1942,
bm,
bo,
ccure,
cosu,
cs,
cscz,
csgo,
css,
dod,
dods,
doi,
dst,
ffow,
gm,
hl2dm,
hldms,
ins,
insmic,
inss,
l4d,
l4d2,
mc,
ohd,
onset,
pz,
ror2,
rust,
sc,
sdtd,
ss,
tf,
tf2,
tfc,
ts,
unturned,
ut,
vr,
GDResult,
};
use gamedig::{aliens, aoc, arma2oa, ase, asrd, avorion, bat1944, bb2, bf1942, bm, bo, ccure, cosu, cs, cscz, csgo, css, dod, dods, doi, dst, ffow, gm, hl2dm, hldms, ins, insmic, inss, l4d, l4d2, mc, ohd, onset, pz, ror2, rust, sc, sdtd, ss, tf, tf2, tfc, ts, unturned, ut, vr, GDResult, cw};
use std::env;
fn main() -> GDResult<()> {
@ -169,6 +121,7 @@ fn main() -> GDResult<()> {
"_gamespy3" => println!("{:#?}", gamespy::three::query(ip, port.unwrap(), None)),
"_gamespy3_vars" => println!("{:#?}", gamespy::three::query_vars(ip, port.unwrap(), None)),
"ffow" => println!("{:#?}", ffow::query(ip, port)),
"cw" => println!("{:#?}", cw::query(ip, port)),
_ => panic!("Undefined game: {}", args[1]),
};

7
src/games/cw.rs Normal file
View file

@ -0,0 +1,7 @@
use crate::protocols::gamespy;
use crate::protocols::gamespy::three::Response;
use crate::GDResult;
pub fn query(address: &str, port: Option<u16>) -> GDResult<Response> {
gamespy::three::query(address, port.unwrap_or(64100), None)
}

View file

@ -92,3 +92,5 @@ pub mod unturned;
pub mod ut;
/// V Rising
pub mod vr;
/// Crysis Wars
pub mod cw;