aboutsummaryrefslogtreecommitdiff
path: root/planetwars-rules/src/protocol.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-09-15 21:59:03 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-09-15 21:59:03 +0200
commit36c16aa8c780e3ff9e2e08b7c98891fab59692c7 (patch)
tree0e47b87b8c861c6af4f275b2698587110cf88f18 /planetwars-rules/src/protocol.rs
parentecd378f0d988c2139d08d3426e8549d09d930f9d (diff)
downloadplanetwars.dev-36c16aa8c780e3ff9e2e08b7c98891fab59692c7.tar.xz
planetwars.dev-36c16aa8c780e3ff9e2e08b7c98891fab59692c7.zip
log bad commands
Diffstat (limited to 'planetwars-rules/src/protocol.rs')
-rw-r--r--planetwars-rules/src/protocol.rs28
1 files changed, 0 insertions, 28 deletions
diff --git a/planetwars-rules/src/protocol.rs b/planetwars-rules/src/protocol.rs
index 23612d0..d93d088 100644
--- a/planetwars-rules/src/protocol.rs
+++ b/planetwars-rules/src/protocol.rs
@@ -49,31 +49,3 @@ pub enum CommandError {
OriginDoesNotExist,
DestinationDoesNotExist,
}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct PlayerCommand {
- pub command: Command,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub error: Option<CommandError>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "snake_case")]
-#[serde(tag = "type", content = "value")]
-pub enum PlayerAction {
- Timeout,
- ParseError(String),
- Commands(Vec<PlayerCommand>),
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "snake_case")]
-#[serde(tag = "type", content = "content")]
-pub enum ServerMessage {
- /// Game state in current turn
- GameState(State),
- /// The action that was performed
- PlayerAction(PlayerAction),
- /// The game is over, and this is the concluding state.
- FinalState(State),
-}