From: Ian Jackson Date: Thu, 13 May 2021 08:52:46 +0000 (+0100) Subject: Game updates: Provide ClearGame insn X-Git-Tag: otter-0.6.0~317 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=64c9bd2ed2b3865d4373742967035d9c01caa159;p=otter.git Game updates: Provide ClearGame insn Signed-off-by: Ian Jackson --- diff --git a/daemon/cmdlistener.rs b/daemon/cmdlistener.rs index 1eb5e218..4436a8d5 100644 --- a/daemon/cmdlistener.rs +++ b/daemon/cmdlistener.rs @@ -570,6 +570,12 @@ fn execute_game_insn<'cs, 'igr, 'ig: 'igr>( no_updates(ig, MGR::Fine) }, + MGI::ClearGame { } => { + reset_game(cs,ag,ig, Box::new(|_ig, _insns|{ + let html = hformat!("{} cleared out the game", &who); + Ok(LogEntry { html }) + }))? + } MGI::ResetFromGameSpec { spec_toml: spec } => { let spec: toml::Value = spec.parse() .map_err(|e: toml::de::Error| ME::TomlSyntaxError(e.to_string()))?; diff --git a/src/commands.rs b/src/commands.rs index bd95a34e..e18a4bad 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -116,6 +116,7 @@ pub enum MgmtGameInstruction { DeletePieceAlias(String), DefinePieceAlias { alias: String, target: Box }, + ClearGame { }, ResetFromGameSpec { spec_toml: String }, ResetPlayerAccess(PlayerId),