Can someone explain the battleground query context to me better? This is what I found out so far:
Corresponding campaigns:
Code:
Player in AvA Zone (Home)
BGQUERY_UNKNOWN: -
BGQUERY_LOCAL: Home
BGQUERY_ASSIGNED_CAMPAIGN: Home
BGQUERY_ASSIGNED_AND_LOCAL: Home
GetCurrentCampaignId(): Home
Player in AvA Zone (Guest)
BGQUERY_UNKNOWN: -
BGQUERY_LOCAL: Guest
BGQUERY_ASSIGNED_CAMPAIGN: Guest
BGQUERY_ASSIGNED_AND_LOCAL: Guest
GetCurrentCampaignId(): Guest
Player in PvE Zone (Map displaying Home)
BGQUERY_UNKNOWN: -
BGQUERY_LOCAL: -
BGQUERY_ASSIGNED_CAMPAIGN: Home
BGQUERY_ASSIGNED_AND_LOCAL: -
GetCurrentCampaignId(): -
Player in PvE Zone (All keeps white on map)
BGQUERY_UNKNOWN: -
BGQUERY_LOCAL: -
BGQUERY_ASSIGNED_CAMPAIGN: -
BGQUERY_ASSIGNED_AND_LOCAL: -
GetCurrentCampaignId(): -
Player in PvE Zone (Map displaying no keeps because no home/guest campaign set yet)
BGQUERY_UNKNOWN: -
BGQUERY_LOCAL: -
BGQUERY_ASSIGNED_CAMPAIGN: -
BGQUERY_ASSIGNED_AND_LOCAL: -
GetCurrentCampaignId(): -
(Tested with GetKeepAlliance(keepId, bgContext) in API 100013; keepId being a keep that belongs to a different alliance in home/guest campaign, bgContext being the listed BattlegroundQueryContextType number)
So I have 2 (actually 3) concrete questions:
- What is BGQUERY_ASSIGNED_AND_LOCAL? It doesn't seem to be different from BGQUERY_LOCAL
- When does the map display white keeps (instead of the home campaign), and how can I detect it in lua?
With question 2 I'd like to complete this function:
Lua Code:
-- Get the battleground context that matches the displayed AvA map
local function GetDisplayedBattlegroundContext()
local bgQuery = BGQUERY_UNKNOWN
if IsPlayerInAvAWorld() then
bgQuery = BGQUERY_LOCAL
elseif false then -- TODO: Is map displaying white keeps
bgQuery = BGQUERY_UNKNOWN
elseif GetAssignedCampaignId() ~= NONE then
bgQuery = BGQUERY_ASSIGNED_CAMPAIGN
end
return bgQuery
end