debug: log outgoing heartbeat coords and chat, fix BG filter for SAY type

Heartbeat: log canonical + wire coords every 30th heartbeat to detect
if we're sending wrong position (causing server to teleport us).

Chat: log outgoing messages at WARNING level to confirm packets are sent.

BG filter: announcer uses SAY (type=0) with color codes, not SYSTEM.
Match "BG Queue Announcer" in message body regardless of chat type.
This commit is contained in:
Kelsi 2026-03-28 16:02:36 -07:00
parent 91c6eef967
commit f74b79f1f8
2 changed files with 12 additions and 6 deletions

View file

@ -120,7 +120,7 @@ void ChatHandler::sendChatMessage(ChatType type, const std::string& message, con
return;
}
LOG_INFO("Sending chat message: [", getChatTypeString(type), "] ", message);
LOG_WARNING("OUTGOING CHAT: type=", static_cast<int>(type), " msg='", message.substr(0, 60), "'");
// Use the player's faction language. AzerothCore rejects wrong language.
// Alliance races: Human(1), Dwarf(3), NightElf(4), Gnome(7), Draenei(11) → COMMON (7)
@ -205,12 +205,11 @@ void ChatHandler::handleMessageChat(network::Packet& packet) {
}
// Filter BG queue announcer spam (server-side module on ChromieCraft/AzerothCore).
// Only filter SYSTEM messages to avoid suppressing player chat.
if (data.type == ChatType::SYSTEM) {
// Arrives as SAY (type=0) with color codes: |cffff0000[BG Queue Announcer]:|r ...
{
const auto& msg = data.message;
if (msg.find("Queue status") != std::string::npos ||
msg.find("BG Queue") != std::string::npos ||
msg.find("BGAnnouncer") != std::string::npos) {
if (msg.find("BG Queue Announcer") != std::string::npos ||
msg.find("Queue status") != std::string::npos) {
return;
}
}