From a55c5bded047e1e2c54f6e3f25c9b8e36e605110 Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Thu, 19 Mar 2020 09:56:18 +0100 Subject: Updating server and map interfaces --- src/wire/mod.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/wire/mod.rs') 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 -- cgit v1.2.3