diff options
Diffstat (limited to 'src/wire/mod.rs')
-rw-r--r-- | src/wire/mod.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/wire/mod.rs b/src/wire/mod.rs index 78d618627d34..bf8dea0e8131 100644 --- a/src/wire/mod.rs +++ b/src/wire/mod.rs @@ -15,6 +15,7 @@ pub use update::*; use crate::{ data::{Color, Player}, map::Map, + Id, }; use serde::{Deserialize, Serialize}; @@ -22,27 +23,27 @@ use serde::{Deserialize, Serialize}; pub type UserId = usize; /// Represents a user payload -#[derive(Serialize, Deserialize)] +#[derive(Clone, Serialize, Deserialize)] pub struct User { /// The internal user ID - id: UserId, + pub id: UserId, /// The auth token provided by the client - token: String, + pub token: Id, /// Whether the scores will be tracked - registered: bool, + pub registered: bool, } /// A more lobby specific abstraction for a user #[derive(Serialize, Deserialize)] pub struct LobbyUser { /// The user ID - id: UserId, + pub id: UserId, /// Their nick name - name: String, + pub name: String, /// Are they ready? - ready: bool, + pub ready: bool, /// The colour they will be in the match - color: Color, + pub color: Color, } /// An alias for a Room ID |