Documentation update

This commit is contained in:
CosminPerRam 2022-10-20 12:49:22 +03:00
parent 40912bb192
commit 00ead6d946
13 changed files with 117 additions and 58 deletions

View file

@ -1,16 +1,12 @@
use crate::errors::GDError;
use crate::valve::{ValveProtocol, App, GatheringSettings, Response};
pub struct CSGO;
impl CSGO {
pub fn query(address: &str, port: Option<u16>) -> Result<Response, GDError> {
ValveProtocol::query(App::CSGO, address, match port {
None => 27015,
Some(port) => port
}, GatheringSettings {
players: true,
rules: true
})
}
pub fn query(address: &str, port: Option<u16>) -> Result<Response, GDError> {
ValveProtocol::query(App::CSGO, address, match port {
None => 27015,
Some(port) => port
}, GatheringSettings {
players: true,
rules: true
})
}

View file

@ -1,8 +1,6 @@
//! Currently supported games.
pub mod tf2;
pub mod the_ship;
pub mod csgo;
pub use tf2::*;
pub use the_ship::*;
pub use csgo::*;

View file

@ -1,16 +1,12 @@
use crate::errors::GDError;
use crate::valve::{ValveProtocol, App, GatheringSettings, Response};
pub struct TF2;
impl TF2 {
pub fn query(address: &str, port: Option<u16>) -> Result<Response, GDError> {
ValveProtocol::query(App::TF2, address, match port {
None => 27015,
Some(port) => port
}, GatheringSettings {
players: true,
rules: true
})
}
pub fn query(address: &str, port: Option<u16>) -> Result<Response, GDError> {
ValveProtocol::query(App::TF2, address, match port {
None => 27015,
Some(port) => port
}, GatheringSettings {
players: true,
rules: true
})
}

View file

@ -1,16 +1,12 @@
use crate::errors::GDError;
use crate::valve::{ValveProtocol, App, GatheringSettings, Response};
pub struct TheShip;
impl TheShip {
pub fn query(address: &str, port: Option<u16>) -> Result<Response, GDError> {
ValveProtocol::query(App::TheShip, address, match port {
None => 27015,
Some(port) => port
}, GatheringSettings {
players: true,
rules: true
})
}
pub fn query(address: &str, port: Option<u16>) -> Result<Response, GDError> {
ValveProtocol::query(App::TheShip, address, match port {
None => 27015,
Some(port) => port
}, GatheringSettings {
players: true,
rules: true
})
}