本文整理汇总了C++中LfgUpdateData函数的典型用法代码示例。如果您正苦于以下问题:C++ LfgUpdateData函数的具体用法?C++ LfgUpdateData怎么用?C++ LfgUpdateData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LfgUpdateData函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LfgUpdateData
void LFGScripts::OnAddMember(Group* group, uint64 guid)
{
uint64 gguid = group->GetGUID();
if (!gguid)
return;
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "]", gguid, guid);
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_CLEAR_LOCK_LIST);
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
if (Player* plrg = itr->getSource())
{
plrg->GetSession()->SendLfgUpdatePlayer(updateData);
plrg->GetSession()->SendLfgUpdateParty(updateData);
}
}
// TODO - if group is queued and new player is added convert to rolecheck without notify the current players queued
if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED)
sLFGMgr->Leave(NULL, group);
if (sLFGMgr->GetState(guid) == LFG_STATE_QUEUED)
if (Player* player = ObjectAccessor::FindPlayer(guid))
sLFGMgr->Leave(player);
}
示例2: OnRemoveMember
void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason)
{
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;
uint64 gguid = group->GetGUID();
;//sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : ""));
bool isLFG = group->isLFGGroup();
LfgState state = sLFGMgr->GetState(gguid);
// If group is being formed after proposal success do nothing more
if (state == LFG_STATE_PROPOSAL && method == GROUP_REMOVEMETHOD_DEFAULT)
{
// LfgData: Remove player from group
sLFGMgr->SetGroup(guid, 0);
sLFGMgr->RemovePlayerFromGroup(gguid, guid);
return;
}
sLFGMgr->LeaveLfg(guid);
sLFGMgr->LeaveAllLfgQueues(guid, true, gguid);
sLFGMgr->SetGroup(guid, 0);
uint8 players = sLFGMgr->RemovePlayerFromGroup(gguid, guid);
// pussywizard: after all necessary actions handle raid browser
// pussywizard: already done above
//if (sLFGMgr->GetState(guid) == LFG_STATE_RAIDBROWSER)
// sLFGMgr->LeaveLfg(guid);
// Xinef: only LFG groups can go below
if (!isLFG)
return;
if (Player* player = ObjectAccessor::FindPlayerInOrOutOfWorld(guid))
{
// xinef: fixed dungeon deserter
if (method != GROUP_REMOVEMETHOD_KICK_LFG && state != LFG_STATE_FINISHED_DUNGEON &&
player->HasAura(LFG_SPELL_DUNGEON_COOLDOWN) && players >= LFG_GROUP_KICK_VOTES_NEEDED)
{
player->AddAura(LFG_SPELL_DUNGEON_DESERTER, player);
}
//else if (state == LFG_STATE_BOOT)
// Update internal kick cooldown of kicked
player->GetSession()->SendLfgUpdateParty(LfgUpdateData(LFG_UPDATETYPE_LEADER_UNK1));
if (player->GetMap()->IsDungeon()) // Teleport player out the dungeon
{
// Xinef: no longer valid sLFGMgr->TeleportPlayer(player, true);
if (!player->IsBeingTeleportedFar() && player->GetMapId() == sLFGMgr->GetDungeonMapId(gguid))
player->TeleportToEntryPoint();
}
}
if (state != LFG_STATE_FINISHED_DUNGEON) // Need more players to finish the dungeon
if (Player* leader = ObjectAccessor::FindPlayerInOrOutOfWorld(sLFGMgr->GetLeader(gguid)))
leader->GetSession()->SendLfgOfferContinue(sLFGMgr->GetDungeon(gguid, false));
}
示例3: TC_LOG_DEBUG
void LFGGroupScript::OnRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, char const* reason)
{
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;
ObjectGuid gguid = group->GetGUID();
TC_LOG_DEBUG("lfg", "LFGScripts::OnRemoveMember [%s]: remove [%s] Method: %d Kicker: [%s] Reason: %s",
gguid.ToString().c_str(), guid.ToString().c_str(), method, kicker.ToString().c_str(), (reason ? reason : ""));
bool isLFG = group->isLFGGroup();
if (isLFG && method == GROUP_REMOVEMETHOD_KICK) // Player have been kicked
{
/// @todo - Update internal kick cooldown of kicker
std::string str_reason = "";
if (reason)
str_reason = std::string(reason);
sLFGMgr->InitBoot(gguid, kicker, guid, str_reason);
return;
}
LfgState state = sLFGMgr->GetState(gguid);
// If group is being formed after proposal success do nothing more
if (state == LFG_STATE_PROPOSAL && method == GROUP_REMOVEMETHOD_DEFAULT)
{
// LfgData: Remove player from group
sLFGMgr->SetGroup(guid, ObjectGuid::Empty);
sLFGMgr->RemovePlayerFromGroup(gguid, guid);
return;
}
sLFGMgr->LeaveLfg(guid);
sLFGMgr->SetGroup(guid, ObjectGuid::Empty);
uint8 players = sLFGMgr->RemovePlayerFromGroup(gguid, guid);
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
if (method == GROUP_REMOVEMETHOD_LEAVE && state == LFG_STATE_DUNGEON &&
players >= LFG_GROUP_KICK_VOTES_NEEDED)
player->CastSpell(player, LFG_SPELL_DUNGEON_DESERTER, true);
//else if (state == LFG_STATE_BOOT)
// Update internal kick cooldown of kicked
player->GetSession()->SendLfgUpdateStatus(LfgUpdateData(LFG_UPDATETYPE_LEADER_UNK1), true);
if (isLFG && player->GetMap()->IsDungeon()) // Teleport player out the dungeon
sLFGMgr->TeleportPlayer(player, true);
}
if (isLFG && state != LFG_STATE_FINISHED_DUNGEON) // Need more players to finish the dungeon
if (Player* leader = ObjectAccessor::FindConnectedPlayer(sLFGMgr->GetLeader(gguid)))
leader->GetSession()->SendLfgOfferContinue(sLFGMgr->GetDungeon(gguid, false));
}
示例4: LfgUpdateData
void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, const char* reason)
{
uint64 gguid = group->GetGUID();
if (!gguid || method == GROUP_REMOVEMETHOD_DEFAULT)
return;
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : ""));
if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED)
{
// TODO - Do not remove, just remove the one leaving and rejoin queue with all other data
sLFGMgr->Leave(NULL, group);
}
if (!group->isLFGGroup())
return;
if (method == GROUP_REMOVEMETHOD_KICK) // Player have been kicked
{
// TODO - Update internal kick cooldown of kicker
std::string str_reason = "";
if (reason)
str_reason = std::string(reason);
sLFGMgr->InitBoot(group, kicker, guid, str_reason);
return;
}
uint8 did = 0;
sLFGMgr->ClearState(guid);
sLFGMgr->SetState(guid, LFG_STATE_NONE);
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
LfgState state = sLFGMgr->GetState(gguid);
if (state == LFG_STATE_DUNGEON)
if (player->HasAura(91084)){
player->CastSpell(player, 71041, true);
player->RemoveAurasDueToSpell(91084);
} else {
player->RemoveAurasDueToSpell(91084);
}
// Add deserter flag
//else if (group->isLfgKickActive())
// Update internal kick cooldown of kicked
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER);
player->GetSession()->SendLfgUpdateParty(updateData);
//if (player->GetMap()->IsDungeon()) // Teleport player out the dungeon
sLFGMgr->TeleportPlayer(player, true);
}
if (sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon
sLFGMgr->OfferContinue(group);
}
示例5: if
void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, uint64 kicker, const char* reason)
{
uint64 gguid = group->GetGUID();
if (!gguid || method == GROUP_REMOVEMETHOD_DEFAULT)
return;
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : ""));
if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED)
{
// TODO - Do not remove, just remove the one leaving and rejoin queue with all other data
sLFGMgr->Leave(NULL, group);
}
if (!group->isLFGGroup())
return;
if (method == GROUP_REMOVEMETHOD_KICK) // Player have been kicked
{
// TODO - Update internal kick cooldown of kicker
std::string str_reason = "";
if (reason)
str_reason = std::string(reason);
sLFGMgr->InitBoot(group, kicker, guid, str_reason);
return;
}
sLFGMgr->ClearState(guid);
if (Player *plr = sObjectMgr->GetPlayer(guid))
{
// Add deserter flag
if (sLFGMgr->GetState(guid) != LFG_STATE_FINISHED_DUNGEON && method == GROUP_REMOVEMETHOD_LEAVE && plr)
plr->CastSpell(plr, LFG_SPELL_DUNGEON_DESERTER, true);
if (sLFGMgr->GetState(guid) == LFG_TYPE_DUNGEON && method == GROUP_REMOVEMETHOD_LEAVE && plr)
plr->RemoveAura(LFG_SPELL_LUCK_OF_THE_DRAW);// Remove Luck of the Draw aura.
/*
else if (group->isLfgKickActive())
// Update internal kick cooldown of kicked
*/
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER);
plr->GetSession()->SendLfgUpdateParty(updateData);
if (plr->GetMap()->IsDungeon()) // Teleport player out the dungeon
sLFGMgr->TeleportPlayer(plr, true);
}
if (sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon
sLFGMgr->OfferContinue(group);
}
示例6: LfgUpdateData
void LFGGroupScript::OnAddMember(Group* group, uint64 guid)
{
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;
uint64 gguid = group->GetGUID();
uint64 leader = group->GetLeaderGUID();
if (leader == guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "]", gguid, guid, leader);
sLFGMgr->SetLeader(gguid, guid);
}
else
{
LfgState gstate = sLFGMgr->GetState(gguid);
LfgState state = sLFGMgr->GetState(guid);
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "] gstate: %u, state: %u", gguid, guid, leader, gstate, state);
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_UPDATE_STATUS);
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
if (Player* plrg = itr->getSource())
{
plrg->GetSession()->SendLfgUpdatePlayer(updateData);
plrg->GetSession()->SendLfgUpdateParty(updateData);
}
}
if (state == LFG_STATE_QUEUED)
sLFGMgr->LeaveLfg(guid);
// TODO - if group is queued and new player is added convert to rolecheck without notify the current players queued
if (gstate == LFG_STATE_QUEUED)
sLFGMgr->LeaveLfg(gguid);
}
sLFGMgr->SetGroup(guid, gguid);
sLFGMgr->AddPlayerToGroup(gguid, guid);
}