diff options
author | Katharina Fey <kookie@spacekookie.de> | 2021-02-14 00:06:14 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2021-02-14 00:06:14 +0100 |
commit | effbdeed66e8de8e769b8ac069926ad1a9110e62 (patch) | |
tree | e4522354e53266204aa9962caccde55d8c815092 /games/rstnode/rst-core/src/wire/resp.rs | |
parent | 5dab336049dbc6817e9ff212998690f59f6bbfa8 (diff) |
* Add an inbox/ outbox system to server components
* Define a data flow from Request -> computation -> Update
* Create simple handlers to call server or client code for requests
Diffstat (limited to 'games/rstnode/rst-core/src/wire/resp.rs')
-rw-r--r-- | games/rstnode/rst-core/src/wire/resp.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/games/rstnode/rst-core/src/wire/resp.rs b/games/rstnode/rst-core/src/wire/resp.rs index ef2e192a6044..99598cceb9e6 100644 --- a/games/rstnode/rst-core/src/wire/resp.rs +++ b/games/rstnode/rst-core/src/wire/resp.rs @@ -27,9 +27,11 @@ pub enum Response { GameUpdate(UpdateState), /// Leave the match (forfeit) LeaveGame(Result<(), MatchErr>), + /// The given request was entirely invalid + Invalid, } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub enum RegErr { /// The password is way too bad BadPassword, @@ -39,7 +41,7 @@ pub enum RegErr { OtherError, } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub enum AuthErr { /// Wrong password for the user WrongPassword, @@ -51,7 +53,7 @@ pub enum AuthErr { OtherError, } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub enum LobbyErr { /// The requested room is already full RoomFull, @@ -85,7 +87,7 @@ pub enum UpdateState { } /// An error that can occur in a match -#[derive(Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub enum MatchErr { /// The provided player wasn't in the match (anymore?) NotInMatch, |