mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Initial valve setup and tf2 game setup
This commit is contained in:
parent
e2be20ee53
commit
8098136d09
10 changed files with 234 additions and 12 deletions
4
src/games/mod.rs
Normal file
4
src/games/mod.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
pub mod tf2;
|
||||
|
||||
pub use tf2::*;
|
||||
14
src/games/tf2.rs
Normal file
14
src/games/tf2.rs
Normal 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
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue