aboutsummaryrefslogtreecommitdiff
path: root/src/wire/mod.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-03-19 09:56:18 +0100
committerKatharina Fey <kookie@spacekookie.de>2020-03-19 09:56:18 +0100
commita55c5bded047e1e2c54f6e3f25c9b8e36e605110 (patch)
treeb388b829655f975cdc23130680ee4c4108ae0325 /src/wire/mod.rs
parent885fcaf2f272d898a265f1b7416ede5801240867 (diff)
Updating server and map interfaces
Diffstat (limited to 'src/wire/mod.rs')
-rw-r--r--src/wire/mod.rs17
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