[DiscordArchive] did u try without specifying clang 14 ?
[DiscordArchive] did u try without specifying clang 14 ?
Archived author: Archer • Posted: 2024-04-15T22:04:08.102000+00:00
Original source
Hi. I was wondering if anyone could help me out with a script that would do a precheck of a group to ensure that everyone is the same faction before allowed into a BG Queue? I have tired a few things but nothing seems to work.
Archived author: Anchy • Posted: 2024-04-15T22:08:35.787000+00:00
Original source
are you using Eluna
Archived author: Archer • Posted: 2024-04-15T22:12:32.795000+00:00
Original source
I am.
Archived author: Anchy • Posted: 2024-04-15T22:14:12.022000+00:00
Original source
actually, I am looking at the Eluna docs and I do not see the `CanJoinInBattlegroundQueue` hook/event implemented so you would need to write a module
Archived author: Anchy • Posted: 2024-04-15T22:15:09.209000+00:00
Original source
otherwise you can submit a PR to the mod-eluna fork of Eluna to get the hook implemented
Archived author: Anchy • Posted: 2024-04-15T22:26:27.384000+00:00
Original source
```cpp
bool CanJoinInBattlegroundQueue(Player* player, ObjectGuid /*BattlemasterGuid*/, BattlegroundTypeId /*BGTypeID*/, uint8 joinAsGroup, GroupJoinBattlegroundResult& err)
{
if (!joinAsGroup || !player)
{
return true;
}
auto group = player->GetGroup();
if (!group)
{
return true;
}
bool sameFaction = true;
uint32 leaderFaction = player->GetFaction();
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* member = itr->GetSource();
if (!member)
{
continue;
}
if (member->GetFaction() != leaderFaction)
{
sameFaction = false;
}
}
if (!sameFaction)
{
err = GroupJoinBattlegroundResult::ERR_BATTLEGROUND_JOIN_FAILED;
}
return sameFaction;
}```
Archived author: Anchy • Posted: 2024-04-15T22:26:30.352000+00:00
Original source
something like this might work
Archived author: Anchy • Posted: 2024-04-15T22:26:45.989000+00:00
Original source
i havent tested it
Archived author: Anchy • Posted: 2024-04-15T22:27:23.984000+00:00
Original source
it might be a good idea to send the leader a system message as well telling them why the join failed
Archived author: Archer • Posted: 2024-04-15T22:35:27.031000+00:00
Original source
I'll give it a shot. I will let you know! Thanks!