mirror of
https://github.com/redstrate/Kawari.git
synced 2025-06-20 23:17:45 +00:00
Reject certain debug commands based on GM rank
This only affects the commands implemented in Rust for now.
This commit is contained in:
parent
9770497fe5
commit
ed08fc2fdc
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::{
|
||||
inventory::Storage,
|
||||
ipc::zone::{ActorControlCategory, ActorControlSelf, ChatMessage},
|
||||
ipc::zone::{ActorControlCategory, ActorControlSelf, ChatMessage, GameMasterRank},
|
||||
world::ToServer,
|
||||
};
|
||||
|
||||
|
@ -10,6 +10,11 @@ pub struct ChatHandler {}
|
|||
|
||||
impl ChatHandler {
|
||||
pub async fn handle_chat_message(connection: &mut ZoneConnection, chat_message: &ChatMessage) {
|
||||
if connection.player_data.gm_rank == GameMasterRank::NormalUser {
|
||||
tracing::info!("Rejecting debug command because the user is not GM!");
|
||||
return;
|
||||
}
|
||||
|
||||
let parts: Vec<&str> = chat_message.message.split(' ').collect();
|
||||
match parts[0] {
|
||||
"!spawnnpc" => {
|
||||
|
|
Loading…
Add table
Reference in a new issue