Fix some broken shite (builtin commands args)

This commit is contained in:
illegitimate-egg 2025-03-03 01:09:56 +00:00
parent 35fa7cc6c9
commit bc13af5972

View File

@ -18,6 +18,13 @@ pub fn handle_command(
let vectorized_command = command_string.trim().split(" ").collect::<Vec<&str>>();
match vectorized_command[0] {
"kick" => {
if (vectorized_command.len()) == 1 {
let _ = &mut stream.write(&send_chat_message(
SpecialPlayers::SelfPlayer as u8,
"".to_string(),
"&cUsage: kick [player]".to_string(),
));
} else {
let mut players = players_arc_clone
.lock()
.map_err(|e| AppError::MutexPoisoned(e.to_string()))?;
@ -33,7 +40,15 @@ pub fn handle_command(
}
}
}
}
"tp" => {
if (vectorized_command.len()) == 1 {
let _ = &mut stream.write(&send_chat_message(
SpecialPlayers::SelfPlayer as u8,
"".to_string(),
"&cUsage: kick [player]".to_string(),
));
} else {
let players = players_arc_clone
.lock()
.map_err(|e| AppError::MutexPoisoned(e.to_string()))?;
@ -53,6 +68,7 @@ pub fn handle_command(
}
}
}
}
_ => {
let mut vectorized_command_object: Vec<String> = Vec::new();