mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
[Games] Add Quake 3 support and change players frags from u16 to i16
This commit is contained in:
parent
af5e0d1fbf
commit
06a2ceeda9
6 changed files with 16 additions and 2 deletions
|
|
@ -98,3 +98,5 @@ pub mod cw;
|
|||
pub mod quake2;
|
||||
/// Quake 1
|
||||
pub mod quake1;
|
||||
/// Quake 3: Arena
|
||||
pub mod quake3a;
|
||||
|
|
|
|||
9
src/games/quake3a.rs
Normal file
9
src/games/quake3a.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use std::net::IpAddr;
|
||||
use crate::GDResult;
|
||||
use crate::protocols::quake;
|
||||
use crate::protocols::quake::Response;
|
||||
use crate::protocols::quake::two::Player;
|
||||
|
||||
pub fn query(address: &IpAddr, port: Option<u16>) -> GDResult<Response<Player>> {
|
||||
quake::three::query(address, port.unwrap_or(27960), None)
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
|
|||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub struct Player {
|
||||
pub frags: u16,
|
||||
pub frags: i16,
|
||||
pub ping: u16,
|
||||
pub name: String
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue