Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions conf/mod-bg-auto-queue.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

###################################################################################################
3 changes: 2 additions & 1 deletion docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 27 additions & 2 deletions src/BgAutoQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -111,13 +112,27 @@ void BgAutoQueue::LoadConfig()
_skipGameMasters = sConfigMgr->GetOption<bool>("BgAutoQueue.SkipGameMasters", true);
_broadcastMessage = sConfigMgr->GetOption<std::string>("BgAutoQueue.BroadcastMessage", BG_AUTO_QUEUE_DEFAULT_BROADCAST);

_skipAuras.clear();
std::string const skipAurasStr = sConfigMgr->GetOption<std::string>("BgAutoQueue.SkipAuras", "");
for (std::string_view token : Acore::Tokenize(skipAurasStr, ',', false))
{
Optional<uint32> value = Acore::StringTo<uint32>(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
Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -268,6 +284,15 @@ bool BgAutoQueue::IsEligible(Player* player, SkipReason* reason) const
return fail(SkipReason::GameMaster);
}

for (uint32 auraId : _skipAuras)
{
if (player->HasAura(auraId))
Comment thread
FrancescoBorzi marked this conversation as resolved.
{
LOG_DEBUG("module", "mod-bg-auto-queue: skip {}: has skip aura {}.", name, auraId);
return fail(SkipReason::Aura);
}
}

return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/BgAutoQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -153,6 +154,7 @@ class BgAutoQueue
uint32 _warningLeadMs = 60u * 1000u;
bool _crossFaction = true;
bool _skipGameMasters = true;
std::vector<uint32> _skipAuras; // aura ids that exclude a player from a pass
std::string _broadcastMessage;

uint32 _elapsedMs = 0;
Expand Down
Loading