aboutsummaryrefslogtreecommitdiff
path: root/src/wire/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wire/mod.rs')
-rw-r--r--src/wire/mod.rs23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/wire/mod.rs b/src/wire/mod.rs
index bf8dea0e8131..b1c231b44580 100644
--- a/src/wire/mod.rs
+++ b/src/wire/mod.rs
@@ -23,7 +23,7 @@ use serde::{Deserialize, Serialize};
pub type UserId = usize;
/// Represents a user payload
-#[derive(Clone, Serialize, Deserialize)]
+#[derive(Copy, Clone, Serialize, Deserialize)]
pub struct User {
/// The internal user ID
pub id: UserId,
@@ -34,7 +34,7 @@ pub struct User {
}
/// A more lobby specific abstraction for a user
-#[derive(Serialize, Deserialize)]
+#[derive(Clone, Serialize, Deserialize)]
pub struct LobbyUser {
/// The user ID
pub id: UserId,
@@ -42,6 +42,8 @@ pub struct LobbyUser {
pub name: String,
/// Are they ready?
pub ready: bool,
+ /// Are they the lobby admin?
+ pub admin: bool,
/// The colour they will be in the match
pub color: Color,
}
@@ -50,7 +52,7 @@ pub struct LobbyUser {
pub type LobbyId = usize;
/// Represent a lobby
-#[derive(Serialize, Deserialize)]
+#[derive(Clone, Serialize, Deserialize)]
pub struct Lobby {
/// The ID of the lobby
pub id: LobbyId,
@@ -65,19 +67,4 @@ pub struct Lobby {
/// An alias for a match ID
pub type MatchId = usize;
-/// Mapping users to a player in game
-#[derive(Serialize, Deserialize)]
-pub struct MatchUser {
- pub user: User,
- pub player: Player,
-}
-#[derive(Serialize, Deserialize)]
-pub struct Match {
- /// The match id
- pub id: MatchId,
- /// The list of active players
- pub players: Vec<MatchUser>,
- /// The active game map
- pub map: Map,
-}