Initial valve setup and tf2 game setup

This commit is contained in:
CosminPerRam 2022-10-15 22:20:01 +03:00
parent e2be20ee53
commit 8098136d09
10 changed files with 234 additions and 12 deletions

4
src/games/mod.rs Normal file
View file

@ -0,0 +1,4 @@
pub mod tf2;
pub use tf2::*;

14
src/games/tf2.rs Normal file
View file

@ -0,0 +1,14 @@
use crate::errors::GDError;
use crate::protocol::Protocol;
use crate::protocols::valve::{Response, ValveProtocol};
pub struct TF2;
impl TF2 {
pub fn query(address: &str, port: Option<u16>) -> Result<Response, GDError> {
ValveProtocol::query(address, match port {
None => 27015,
Some(port) => port
})
}
}