diff --git a/conf/mod-bg-auto-queue.conf.dist b/conf/mod-bg-auto-queue.conf.dist index 8c3ed38..a0b1ab0 100644 --- a/conf/mod-bg-auto-queue.conf.dist +++ b/conf/mod-bg-auto-queue.conf.dist @@ -130,4 +130,18 @@ BgAutoQueue.CrossFaction = 1 BgAutoQueue.SkipGameMasters = 1 +# +# BgAutoQueue.SkipAuras +# Description: Comma-separated list of aura (spell) IDs. A player who has +# any of these auras is skipped for the pass, in both the +# warning and the queueing. Useful to let other systems flag +# a character as temporarily exempt from auto-queue. Invalid +# entries are rejected at load with a warning. +# Example: "2000100, 2000101, 2000102" skips any player who +# has aura 2000100, 2000101 or 2000102. +# Default: "" - empty, the aura check is disabled +# + +BgAutoQueue.SkipAuras = "" + ################################################################################################### diff --git a/docs/how-it-works.md b/docs/how-it-works.md index fed4a9c..85e628d 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -83,7 +83,8 @@ You're skipped for an event (this event only) if you're: - under a **Deserter** penalty, - **using the Dungeon Finder (LFG)**, - a **Death Knight still in the Ebon Hold starting zone**, -- a **Game Master** (skipped by default; this can be turned off). +- a **Game Master** (skipped by default; this can be turned off), +- carrying one of the **configured skip auras** (a server setting). Once whatever's blocking you clears, you'll be considered again at the next event. diff --git a/src/BgAutoQueue.cpp b/src/BgAutoQueue.cpp index a697f6a..411c6b9 100644 --- a/src/BgAutoQueue.cpp +++ b/src/BgAutoQueue.cpp @@ -19,6 +19,7 @@ #include "Player.h" #include "ScriptMgr.h" #include "StringConvert.h" +#include "StringFormat.h" #include "Tokenize.h" #include "World.h" #include "WorldPacket.h" @@ -111,13 +112,27 @@ void BgAutoQueue::LoadConfig() _skipGameMasters = sConfigMgr->GetOption("BgAutoQueue.SkipGameMasters", true); _broadcastMessage = sConfigMgr->GetOption("BgAutoQueue.BroadcastMessage", BG_AUTO_QUEUE_DEFAULT_BROADCAST); + _skipAuras.clear(); + std::string const skipAurasStr = sConfigMgr->GetOption("BgAutoQueue.SkipAuras", ""); + for (std::string_view token : Acore::Tokenize(skipAurasStr, ',', false)) + { + Optional value = Acore::StringTo(Acore::String::Trim(std::string(token))); + if (!value) + { + LOG_WARN("module", "BgAutoQueue.SkipAuras entry '{}' is not a valid number, ignoring.", token); + continue; + } + + _skipAuras.push_back(*value); + } + // Reset timing on (re)load. Reload re-applies InitialDelay — accepted. _elapsedMs = 0; _warningSent = false; _firstPass = true; - LOG_INFO("module", "mod-bg-auto-queue: enabled={}, levels=[{}-{}], pool size={}, interval={} min, initialDelay={} s, warningLead={} s, crossFaction={}, skipGM={}.", - _enabled, _levelMin, _levelMax, _poolRaw.size(), intervalMin, initialDelaySec, warningLeadSec, _crossFaction, _skipGameMasters); + LOG_INFO("module", "mod-bg-auto-queue: enabled={}, levels=[{}-{}], pool size={}, interval={} min, initialDelay={} s, warningLead={} s, crossFaction={}, skipGM={}, skipAuras={}.", + _enabled, _levelMin, _levelMax, _poolRaw.size(), intervalMin, initialDelaySec, warningLeadSec, _crossFaction, _skipGameMasters, _skipAuras.size()); // Opt-out is stored via the core PlayerSettings system, which only persists // across logins when EnablePlayerSettings is on. Without it, .bgevents @@ -184,6 +199,7 @@ char const* BgAutoQueue::GetSkipReasonLabel(SkipReason reason) case SkipReason::Lfg: return "using the LFG system"; case SkipReason::DeathKnightEbonHold: return "Death Knight locked to Ebon Hold"; case SkipReason::GameMaster: return "game master"; + case SkipReason::Aura: return "has a configured skip aura"; case SkipReason::NoBracket: return "no PvP bracket for level"; default: return "unknown"; } @@ -268,6 +284,15 @@ bool BgAutoQueue::IsEligible(Player* player, SkipReason* reason) const return fail(SkipReason::GameMaster); } + for (uint32 auraId : _skipAuras) + { + if (player->HasAura(auraId)) + { + LOG_DEBUG("module", "mod-bg-auto-queue: skip {}: has skip aura {}.", name, auraId); + return fail(SkipReason::Aura); + } + } + return true; } diff --git a/src/BgAutoQueue.h b/src/BgAutoQueue.h index 8261c47..cbcf8db 100644 --- a/src/BgAutoQueue.h +++ b/src/BgAutoQueue.h @@ -54,6 +54,7 @@ class BgAutoQueue Lfg, DeathKnightEbonHold, GameMaster, + Aura, // carries one of the configured skip auras NoBracket, // no PvP bracket for the level on the reference map Count }; @@ -153,6 +154,7 @@ class BgAutoQueue uint32 _warningLeadMs = 60u * 1000u; bool _crossFaction = true; bool _skipGameMasters = true; + std::vector _skipAuras; // aura ids that exclude a player from a pass std::string _broadcastMessage; uint32 _elapsedMs = 0;