|
|
@ -7,6 +7,7 @@ use crate::command::{CommandSetPlayer, CommandSetRoom, CommandSetZone, Parse, Pa
|
|
|
|
use crate::database::Db;
|
|
|
|
use crate::database::Db;
|
|
|
|
use crate::queue::SendQueue;
|
|
|
|
use crate::queue::SendQueue;
|
|
|
|
use crate::result::RudeResult;
|
|
|
|
use crate::result::RudeResult;
|
|
|
|
|
|
|
|
use crate::try_log;
|
|
|
|
|
|
|
|
|
|
|
|
/// Set various options
|
|
|
|
/// Set various options
|
|
|
|
#[derive(Clone, Debug, Display, EnumIter, Eq, Ord, PartialEq, PartialOrd)]
|
|
|
|
#[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)> {
|
|
|
|
fn parse_subcommand(&self, s: String) -> RudeResult<(Self, String)> {
|
|
|
|
match self {
|
|
|
|
match self {
|
|
|
|
Self::Player(_) => {
|
|
|
|
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))
|
|
|
|
Ok((Self::Player(command), args))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Self::Room(_) => {
|
|
|
|
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))
|
|
|
|
Ok((Self::Room(command), args))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Self::Zone(_) => {
|
|
|
|
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))
|
|
|
|
Ok((Self::Zone(command), args))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Self::Default => Err(ParserError::Default.into()),
|
|
|
|
Self::Default => Err(ParserError::Default.into()),
|
|
|
|