|
|
|
@ -7,6 +7,7 @@ use crate::command::{CommandSetPlayer, CommandSetRoom, CommandSetZone, Parse, Pa
|
|
|
|
|
use crate::database::Db;
|
|
|
|
|
use crate::queue::SendQueue;
|
|
|
|
|
use crate::result::RudeResult;
|
|
|
|
|
use crate::try_log;
|
|
|
|
|
|
|
|
|
|
/// Set various options
|
|
|
|
|
#[derive(Clone, Debug, Display, EnumIter, Eq, Ord, PartialEq, PartialOrd)]
|
|
|
|
@ -42,15 +43,20 @@ impl Parse for CommandSet {
|
|
|
|
|
fn parse_subcommand(&self, s: String) -> RudeResult<(Self, String)> {
|
|
|
|
|
match self {
|
|
|
|
|
Self::Player(_) => {
|
|
|
|
|
let (command, args) = CommandSetPlayer::parse(s)?;
|
|
|
|
|
let (command, args) = try_log!(
|
|
|
|
|
CommandSetPlayer::parse(s),
|
|
|
|
|
"Unable to parse player subcommand",
|
|
|
|
|
);
|
|
|
|
|
Ok((Self::Player(command), args))
|
|
|
|
|
}
|
|
|
|
|
Self::Room(_) => {
|
|
|
|
|
let (command, args) = CommandSetRoom::parse(s)?;
|
|
|
|
|
let (command, args) =
|
|
|
|
|
try_log!(CommandSetRoom::parse(s), "Unable to parse room subcommand",);
|
|
|
|
|
Ok((Self::Room(command), args))
|
|
|
|
|
}
|
|
|
|
|
Self::Zone(_) => {
|
|
|
|
|
let (command, args) = CommandSetZone::parse(s)?;
|
|
|
|
|
let (command, args) =
|
|
|
|
|
try_log!(CommandSetZone::parse(s), "Unable to parse zone subcommand",);
|
|
|
|
|
Ok((Self::Zone(command), args))
|
|
|
|
|
}
|
|
|
|
|
Self::Default => Err(ParserError::Default.into()),
|
|
|
|
|