mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-09 15:11:07 +00:00
[Games] Programmatic games by storing information as data (#45)
* Define games as structs * Create table of response types * Ensure serde is always included * Remove server_ prefix in GenericResponse * Make players online/max non-optional in generic response * Use already existing minecraft server enum * Implement ExtraResponses to prevent cloning when creating generic * Add game definitions * Add doc comments to generic types * Include players in gamespy extra responses * Add custom response types for TheShip and FFOW * Cargo format differing files * Final cleanup
This commit is contained in:
parent
26ad1f5d19
commit
d853189e06
16 changed files with 806 additions and 102 deletions
|
|
@ -1,5 +1,22 @@
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
mod common;
|
||||
/// The implementations.
|
||||
pub mod protocols;
|
||||
|
||||
pub use protocols::*;
|
||||
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum GameSpyVersion {
|
||||
One,
|
||||
Three,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum VersionedExtraResponse {
|
||||
One(protocols::one::ExtraResponse),
|
||||
Three(protocols::three::ExtraResponse),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue