From ed08fc2fdc091de2778ae222d8c34214a412f36a Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 18 Jun 2025 20:58:32 -0400 Subject: [PATCH] Reject certain debug commands based on GM rank This only affects the commands implemented in Rust for now. --- src/world/chat_handler.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/world/chat_handler.rs b/src/world/chat_handler.rs index 3460b06..ec34e10 100644 --- a/src/world/chat_handler.rs +++ b/src/world/chat_handler.rs @@ -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" => {