use super::{action::Action, LobbyId, MatchId, User}; 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), }