diff options
Diffstat (limited to 'server/src/commands.rs')
-rw-r--r-- | server/src/commands.rs | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs index 5daedda9..64fa50f6 100644 --- a/server/src/commands.rs +++ b/server/src/commands.rs @@ -65,35 +65,34 @@ enum Command { /// List all recipes and maps List, /// Send an effect - Effect { - name: String, - }, + Effect { name: String }, /// Send an item - Item { - name: String, - }, + Item { name: String }, /// Reload the resource index ReloadIndex, #[clap(alias = "summon", alias = "bot")] - CreateBot { - algo: String, - name: Option<String>, - }, + CreateBot { algo: String, name: Option<String> }, /// Reload the current map #[clap(alias = "r")] Reload, /// Shows the recipe book Book, + /// Start an interactive tutorial for some item #[clap(alias = "tutorial")] - StartTutorial { - item: String, - }, + StartTutorial { item: String }, + /// End the tutorial unfinished EndTutorial, #[clap(alias = "tr")] + /// Manually send a translated message TranslateMessage { message_id: String, arguments: Vec<String>, }, + /// Return to the map editor + #[clap(alias = "e", alias = "editor")] + Edit, + #[clap(hide = true)] + SetEditorAddress { url: String }, } #[derive(ValueEnum, Clone)] @@ -365,6 +364,16 @@ impl Server { timeout: None, }); } + Command::Edit => { + let addr = self + .editor_address + .clone() + .ok_or(tre!("s.error.not_editor_session"))?; + replies.push(PacketC::Redirect { uri: vec![addr] }); + } + Command::SetEditorAddress { url } => { + self.editor_address = Some(url); + } } Ok(()) } |