mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Game] Add Creativerse support.
This commit is contained in:
parent
89d69c1176
commit
76a3ac2f78
7 changed files with 84 additions and 56 deletions
16
src/games/creativerse.rs
Normal file
16
src/games/creativerse.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use crate::{
|
||||
protocols::valve::{self, game, SteamApp},
|
||||
GDResult,
|
||||
};
|
||||
use std::net::{IpAddr, SocketAddr};
|
||||
|
||||
pub fn query(address: &IpAddr, port: Option<u16>) -> GDResult<game::Response> {
|
||||
let valve_response = valve::query(
|
||||
&SocketAddr::new(*address, port.unwrap_or(26901)),
|
||||
SteamApp::CREATIVERSE.as_engine(),
|
||||
None,
|
||||
None,
|
||||
)?;
|
||||
|
||||
Ok(game::Response::new_from_valve_response(valve_response))
|
||||
}
|
||||
|
|
@ -47,6 +47,7 @@ pub static GAMES: Map<&'static str, Game> = phf_map! {
|
|||
"cscz" => game!("Counter Strike: Condition Zero", 27015, Protocol::Valve(SteamApp::CSCZ)),
|
||||
"csgo" => game!("Counter-Strike: Global Offensive", 27015, Protocol::Valve(SteamApp::CSGO)),
|
||||
"css" => game!("Counter-Strike: Source", 27015, Protocol::Valve(SteamApp::CSS)),
|
||||
"creativerse" => game!("Creativerse", 26901, Protocol::Valve(SteamApp::CREATIVERSE)),
|
||||
"cw" => game!("Crysis Wars", 64100, Protocol::Gamespy(GameSpyVersion::Three)),
|
||||
"dod" => game!("Day of Defeat", 27015, Protocol::Valve(SteamApp::DOD)),
|
||||
"dods" => game!("Day of Defeat: Source", 27015, Protocol::Valve(SteamApp::DODS)),
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ pub mod bo;
|
|||
pub mod ccure;
|
||||
/// Colony Survival
|
||||
pub mod cosu;
|
||||
/// Creativerse
|
||||
pub mod creativerse;
|
||||
/// Counter-Strike
|
||||
pub mod cs;
|
||||
/// Counter Strike: Condition Zero
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue