diff --git a/common/ruletypes.h b/common/ruletypes.h index f611d02bd..b523c5de4 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -1073,6 +1073,7 @@ RULE_CATEGORY(Logging) RULE_BOOL(Logging, PrintFileFunctionAndLine, false, "Ex: [World Server] [net.cpp::main:309] Loading variables...") RULE_BOOL(Logging, WorldGMSayLogging, true, "Relay worldserver logging to zone processes via GM say output") RULE_BOOL(Logging, PlayerEventsQSProcess, false, "Have query server process player events instead of world. Useful when wanting to use a dedicated server and database for processing player events on separate disk") +RULE_STRING(Logging, PlayerEventsIgnoreGMCommands, "help,show", "This is a comma delimited list of commands to ignore when recording GM command player events.") RULE_INT(Logging, BatchPlayerEventProcessIntervalSeconds, 5, "This is the interval in which player events are processed in world or qs") RULE_INT(Logging, BatchPlayerEventProcessChunkSize, 10000, "This is the cap of events that can be inserted into the queue before a force flush. This is to keep from hitting MySQL max_allowed_packet and killing the connection") RULE_CATEGORY_END() diff --git a/zone/command.cpp b/zone/command.cpp index ada2bdf6f..d74d0bd4d 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -514,7 +514,15 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status) parse->EventPlayer(EVENT_GM_COMMAND, c, message, 0); } - if (player_event_logs.IsEventEnabled(PlayerEvent::GM_COMMAND) && message != "#help") { + bool log_command = true; + for (auto &cmd: Strings::Split(RuleS(Logging, PlayerEventsIgnoreGMCommands), ",")) { + if (Strings::Contains(command, Strings::ToLower(cmd))) { + log_command = false; + break; + } + } + + if (player_event_logs.IsEventEnabled(PlayerEvent::GM_COMMAND) && log_command) { auto e = PlayerEvent::GMCommandEvent{ .message = message, .target = c->GetTarget() ? c->GetTarget()->GetName() : "NONE"