tokio: Support RCON
This commit is contained in:
1 parent
2287564973
commit
75e7b0a8e8
15 files changed
+166
-152
No files matched your search
@@ -1,3 +1,5 @@
|
||||
use pumpkin_core::text::TextComponent;
|
||||
|
||||
use crate::commands::dispatcher::InvalidTreeError::{
|
||||
InvalidConsumptionError, InvalidRequirementError,
|
||||
};
|
||||
@@ -24,11 +26,14 @@ pub struct CommandDispatcher<'a> {
|
||||
|
||||
/// Stores registered [CommandTree]s and dispatches commands to them.
|
||||
impl<'a> CommandDispatcher<'a> {
|
||||
pub fn handle_command(&self, sender: &mut CommandSender, server: &Server, cmd: &str) {
|
||||
pub async fn handle_command(&self, sender: &mut CommandSender<'a>, server: &Server, cmd: &str) {
|
||||
if let Err(err) = self.dispatch(sender, server, cmd) {
|
||||
// sender.send_message(
|
||||
// TextComponent::text(&err).color_named(pumpkin_core::text::color::NamedColor::Red),
|
||||
// )
|
||||
sender
|
||||
.send_message(
|
||||
TextComponent::text_string(err)
|
||||
.color_named(pumpkin_core::text::color::NamedColor::Red),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user