1
Fork 0
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:
Joshua Goins 2025-06-18 20:58:32 -04:00
parent 9770497fe5
commit ed08fc2fdc

View file

@ -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" => {