diff options
Diffstat (limited to 'src/wire/mod.rs')
-rw-r--r-- | src/wire/mod.rs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/wire/mod.rs b/src/wire/mod.rs index 257333ee118c..78d618627d34 100644 --- a/src/wire/mod.rs +++ b/src/wire/mod.rs @@ -1,9 +1,16 @@ //! Network formats and container messages mod action; +pub use action::*; + mod req; +pub use req::*; + mod resp; +pub use resp::*; + mod update; +pub use update::*; use crate::{ data::{Color, Player}, @@ -27,7 +34,7 @@ pub struct User { /// A more lobby specific abstraction for a user #[derive(Serialize, Deserialize)] -struct LobbyUser { +pub struct LobbyUser { /// The user ID id: UserId, /// Their nick name @@ -45,13 +52,13 @@ pub type LobbyId = usize; #[derive(Serialize, Deserialize)] pub struct Lobby { /// The ID of the lobby - id: LobbyId, + pub id: LobbyId, /// A set of user IDs - players: Vec<LobbyUser>, + pub players: Vec<LobbyUser>, /// The name of the map - map: String, + pub map: String, /// Settings - settings: Vec<String>, + pub settings: Vec<String>, } /// An alias for a match ID @@ -60,16 +67,16 @@ pub type MatchId = usize; /// Mapping users to a player in game #[derive(Serialize, Deserialize)] pub struct MatchUser { - user: User, - player: Player, + pub user: User, + pub player: Player, } #[derive(Serialize, Deserialize)] pub struct Match { /// The match id - id: MatchId, + pub id: MatchId, /// The list of active players - players: Vec<MatchUser>, + pub players: Vec<MatchUser>, /// The active game map - map: Map, + pub map: Map, } |