aboutsummaryrefslogtreecommitdiff
path: root/src/wire/resp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wire/resp.rs')
-rw-r--r--src/wire/resp.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/wire/resp.rs b/src/wire/resp.rs
index b9f41fbe93e4..4812baf13e39 100644
--- a/src/wire/resp.rs
+++ b/src/wire/resp.rs
@@ -16,18 +16,17 @@ pub enum Response {
/// Get a list of available <name-room> pairs
Rooms(Vec<(String, LobbyId)>),
/// A user joins a game lobby
- Join(Result<Lobby, RoomErr>),
+ Join(Result<Lobby, LobbyErr>),
/// A user leaves a game lobby
- Leave(Result<(), RoomErr>),
+ Leave(Result<(), LobbyErr>),
/// Get the new set of ready states
- Ready(RoomUpdate),
+ Ready(LobbyUpdate),
/// Receiving a start request time
StartReq(DateTime<Utc>),
/// Response to the action with the state update
GameUpdate(UpdateState),
/// Leave the match (forfeit)
LeaveGame(Result<(), MatchErr>),
-
}
#[derive(Serialize, Deserialize)]
@@ -53,17 +52,23 @@ pub enum AuthErr {
}
#[derive(Serialize, Deserialize)]
-pub enum RoomErr {
+pub enum LobbyErr {
/// The requested room is already full
RoomFull,
/// The room id is unknown
NoSuchRoom,
/// Previously not in room
NotInRoom,
+ /// Not everybody was ready
+ NotAllReady,
+ /// A request was sent by someone who isn't authorised
+ NotAuthorized,
+ /// Other internal error, try again?
+ OtherError,
}
#[derive(Serialize, Deserialize)]
-pub enum RoomUpdate {
+pub enum LobbyUpdate {
/// The set of ready users
Ready(Vec<UserId>),
}