Skip to content

Instantly share code, notes, and snippets.

@Aokromes
Created March 17, 2025 23:44
Show Gist options
  • Save Aokromes/55d3d2b401dc0a3d93f855fe1c74e98d to your computer and use it in GitHub Desktop.
Save Aokromes/55d3d2b401dc0a3d93f855fe1c74e98d to your computer and use it in GitHub Desktop.
void LFGPlayerScript::OnLogin(Player* player, bool /*loginFirst*/)
{
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;
// Temporal: Trying to determine when group data and LFG data gets desynched
ObjectGuid guid = player->GetGUID();
ObjectGuid gguid = sLFGMgr->GetGroup(guid);
if (Group const* group = player->GetGroup())
{
ObjectGuid gguid2 = group->GetGUID();
if (gguid != gguid2)
{
TC_LOG_ERROR("lfg", "{} on group {} but LFG has group {} saved... Fixing.",
player->GetSession()->GetPlayerInfo(), gguid2.ToString(), gguid.ToString());
sLFGMgr->SetupGroupMember(guid, group->GetGUID());
}
}
sLFGMgr->SetTeam(player->GetGUID(), player->GetTeam());
/// @todo - Restore LfgPlayerData and send proper status to player if it was in a group
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment