aboutsummaryrefslogtreecommitdiff
path: root/games/rstnode/src/wire/req.rs
diff options
context:
space:
mode:
Diffstat (limited to 'games/rstnode/src/wire/req.rs')
-rw-r--r--games/rstnode/src/wire/req.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/games/rstnode/src/wire/req.rs b/games/rstnode/src/wire/req.rs
new file mode 100644
index 000000000000..fba64287006b
--- /dev/null
+++ b/games/rstnode/src/wire/req.rs
@@ -0,0 +1,39 @@
+
+use super::{action::Action, User, LobbyId, MatchId};
+use serde::{Deserialize, Serialize};
+
+/// A message sent from the game client to the server
+#[derive(Serialize, Deserialize)]
+pub enum Request {
+ /// Register yourself with the game server
+ Register(String, String),
+
+ /// Login to your user session
+ ///
+ /// This user can't log into the system from another computer
+ Login(String, String),
+
+ /// Close your user session
+ Logout(User),
+
+ /// Start an anonymous session
+ Anonymous(String),
+
+ /// A user joins a game lobby
+ Join(User, LobbyId),
+
+ /// A user leaves a game lobby
+ Leave(User, LobbyId),
+
+ /// Mark a user as ready
+ Ready(User, LobbyId, bool),
+
+ /// Try to start the match
+ StartReq(User, LobbyId),
+
+ /// Send a move in the game
+ GameAction(User, MatchId, Action),
+
+ /// Leave the match (forfeit)
+ LeaveGame(User, MatchId),
+}