prevent ! commands from getting send to chat if no handler was found

This commit is contained in:
Resaec 2025-06-11 00:11:49 +02:00
parent 66362b38d7
commit b63e402003
2 changed files with 13 additions and 2 deletions

View file

@ -236,7 +236,7 @@ class ChatLogic(val ops: ChatOperations, implicit val context: ActorContext) ext
message.note
)
)
false
true
}
} else {
false

View file

@ -143,7 +143,18 @@ class ChatLogic(val ops: ChatOperations, implicit val context: ActorContext) ext
case "list" => ops.customCommandList(session, params, message)
case "nearby" => ops.customCommandNearby(session)
case "loc" => ops.customCommandLoc(session, message)
case _ => false
case _ =>
// command was not handled
sendResponse(
ChatMsg(
ChatMessageType.CMT_GMOPEN, // CMT_GMTELL
message.wideContents,
"Server",
s"Unknown command !$command",
message.note
)
)
true
}
} else {
false