mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Games] V Rising support.
This commit is contained in:
parent
e26f0f871a
commit
cd4cbc09db
6 changed files with 24 additions and 2 deletions
|
|
@ -7,6 +7,9 @@ Crate:
|
||||||
- Added feature `no_games` which disables the supported games (useful when you are only using
|
- Added feature `no_games` which disables the supported games (useful when you are only using
|
||||||
the protocols/services, also saves storage space).
|
the protocols/services, also saves storage space).
|
||||||
|
|
||||||
|
Games:
|
||||||
|
- [V Rising](https://store.steampowered.com/app/1604030/V_Rising/) support.
|
||||||
|
|
||||||
Protocols:
|
Protocols:
|
||||||
- Valve:
|
- Valve:
|
||||||
1. Reversed (from `0.1.0`) "Players with no name are no more added to the `players_details` field.", also added a note in the [protocols](PROTOCOLS.md) file regarding this.
|
1. Reversed (from `0.1.0`) "Players with no name are no more added to the `players_details` field.", also added a note in the [protocols](PROTOCOLS.md) file regarding this.
|
||||||
|
|
|
||||||
1
GAMES.md
1
GAMES.md
|
|
@ -44,6 +44,7 @@ Beware of the `Notes` column, as it contains information about query port offset
|
||||||
| BrainBread 2 | BB2 | Valve Protocol | |
|
| BrainBread 2 | BB2 | Valve Protocol | |
|
||||||
| Avorion | AVORION | Valve Protocol | Query port is 27020. |
|
| Avorion | AVORION | Valve Protocol | Query port is 27020. |
|
||||||
| Operation: Harsh Doorstop | OHD | Valve Protocol | Query port is 27005. |
|
| Operation: Harsh Doorstop | OHD | Valve Protocol | Query port is 27005. |
|
||||||
|
| V Rising | VR | Valve Protocol | Query port is 27016. |
|
||||||
|
|
||||||
## Planned to add support:
|
## Planned to add support:
|
||||||
_
|
_
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
use std::env;
|
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};
|
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::protocols::minecraft::LegacyGroup;
|
use gamedig::protocols::minecraft::LegacyGroup;
|
||||||
use gamedig::protocols::valve;
|
use gamedig::protocols::valve;
|
||||||
use gamedig::protocols::valve::Engine;
|
use gamedig::protocols::valve::Engine;
|
||||||
|
|
@ -82,6 +82,7 @@ fn main() -> GDResult<()> {
|
||||||
"bb2" => println!("{:#?}", bb2::query(ip, port)?),
|
"bb2" => println!("{:#?}", bb2::query(ip, port)?),
|
||||||
"avorion" => println!("{:#?}", avorion::query(ip, port)?),
|
"avorion" => println!("{:#?}", avorion::query(ip, port)?),
|
||||||
"ohd" => println!("{:#?}", ohd::query(ip, port)?),
|
"ohd" => println!("{:#?}", ohd::query(ip, port)?),
|
||||||
|
"vr" => println!("{:#?}", vr::query(ip, port)?),
|
||||||
_ => panic!("Undefined game: {}", args[1])
|
_ => panic!("Undefined game: {}", args[1])
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,3 +83,5 @@ pub mod bb2;
|
||||||
pub mod avorion;
|
pub mod avorion;
|
||||||
/// Operation: Harsh Doorstop
|
/// Operation: Harsh Doorstop
|
||||||
pub mod ohd;
|
pub mod ohd;
|
||||||
|
/// V Rising
|
||||||
|
pub mod vr;
|
||||||
|
|
|
||||||
12
src/games/vr.rs
Normal file
12
src/games/vr.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
use crate::GDResult;
|
||||||
|
use crate::protocols::valve;
|
||||||
|
use crate::protocols::valve::{game, SteamApp};
|
||||||
|
|
||||||
|
pub fn query(address: &str, port: Option<u16>) -> GDResult<game::Response> {
|
||||||
|
let valve_response = valve::query(address, match port {
|
||||||
|
None => 27016,
|
||||||
|
Some(port) => port
|
||||||
|
}, SteamApp::VR.as_engine(), None, None)?;
|
||||||
|
|
||||||
|
Ok(game::Response::new_from_valve_response(valve_response))
|
||||||
|
}
|
||||||
|
|
@ -218,6 +218,8 @@ pub enum SteamApp {
|
||||||
OHD,
|
OHD,
|
||||||
/// Onset
|
/// Onset
|
||||||
ONSET,
|
ONSET,
|
||||||
|
/// V Rising
|
||||||
|
VR,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SteamApp {
|
impl SteamApp {
|
||||||
|
|
@ -263,7 +265,8 @@ impl SteamApp {
|
||||||
SteamApp::ASRD => Engine::new_source(563560),
|
SteamApp::ASRD => Engine::new_source(563560),
|
||||||
SteamApp::ROR2 => Engine::new_source(632360),
|
SteamApp::ROR2 => Engine::new_source(632360),
|
||||||
SteamApp::OHD => Engine::new_source_with_dedicated(736590, 950900),
|
SteamApp::OHD => Engine::new_source_with_dedicated(736590, 950900),
|
||||||
SteamApp::ONSET => Engine::new_source(1105810)
|
SteamApp::ONSET => Engine::new_source(1105810),
|
||||||
|
SteamApp::VR => Engine::new_source(1604030),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue