本文整理匯總了C++中ArenaTeamInfoType函數的典型用法代碼示例。如果您正苦於以下問題:C++ ArenaTeamInfoType函數的具體用法?C++ ArenaTeamInfoType怎麽用?C++ ArenaTeamInfoType使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ArenaTeamInfoType函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: while
bool ArenaTeam::DisbandNoSave(Player* player)
{
bool destroy = true;
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
Player *pl = sObjectMgr.GetPlayer(m_members.front().guid);
if (!pl)
continue;
if (!pl->IsBot())
{
destroy = false;
break;
}
}
if (destroy)
{
while (!m_members.empty())
{
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
if (itr->guid == m_members.front().guid)
{
m_members.erase(itr);
break;
}
}
if (Player *pl = sObjectMgr.GetPlayer(m_members.front().guid))
{
pl->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
pl->SetInArenaTeam(0, GetSlot(), ARENA_TYPE_NONE);
for(int i = 0; i < ARENA_TEAM_END; ++i)
pl->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
}
}
sObjectMgr.RemoveArenaTeam(m_TeamId);
}
else
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
player->SetInArenaTeam(0, GetSlot(), ARENA_TYPE_NONE);
for(int i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
}
return destroy;
}
示例2: GetName
void ArenaTeam::DelMember(uint64 guid, bool cleanDb)
{
// Remove member from team
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
if (itr->Guid == guid)
{
Members.erase(itr);
break;
}
// Inform player and remove arena team info from player data
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
sLog->outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
if (cleanDb)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHARACTER_DELETE_ARENA_TEAM_MEMBER);
stmt->setUInt32(0, GetId());
stmt->setUInt32(1, GUID_LOPART(guid));
CharacterDatabase.Execute(stmt);
}
}
示例3: ArenaTeamInfoType
void ArenaTeam::DelMember(ObjectGuid guid, bool cleanDb)
{
// Remove member from team
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
if (itr->Guid == guid)
{
Members.erase(itr);
break;
}
// Remove arena team info from player data
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
TC_LOG_DEBUG("bg.arena", "Player: %s [%s] left arena team type: %u [Id: %u, Name: %s].", player->GetName().c_str(), player->GetGUID().ToString().c_str(), GetType(), GetId(), GetName().c_str());
}
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
if (cleanDb)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBER);
stmt->setUInt32(0, GetId());
stmt->setUInt64(1, guid.GetCounter());
CharacterDatabase.Execute(stmt);
}
}
示例4: GetSlot
void ArenaTeam::DelMember(ObjectGuid guid, bool cleanDb)
{
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
Group* group = (player && player->GetGroup()) ? player->GetGroup() : nullptr;
// Remove member from team
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
// Remove queues of members
if (Player* playerMember = ObjectAccessor::FindConnectedPlayer(itr->Guid))
{
if (group && playerMember->GetGroup() && group->GetGUID() == playerMember->GetGroup()->GetGUID())
{
if (BattlegroundQueueTypeId bgQueue = BattlegroundMgr::BGQueueTypeId(BATTLEGROUND_AA, GetType()))
{
GroupQueueInfo ginfo;
BattlegroundQueue& queue = sBattlegroundMgr->GetBattlegroundQueue(bgQueue);
if (queue.GetPlayerGroupInfoData(playerMember->GetGUID(), &ginfo))
if (!ginfo.IsInvitedToBGInstanceGUID)
{
WorldPacket data;
playerMember->RemoveBattlegroundQueueId(bgQueue);
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, nullptr, playerMember->GetBattlegroundQueueIndex(bgQueue), STATUS_NONE, 0, 0, 0, 0);
queue.RemovePlayer(playerMember->GetGUID(), true);
playerMember->GetSession()->SendPacket(&data);
}
}
}
}
if (itr->Guid == guid)
{
Members.erase(itr);
sCharacterCache->UpdateCharacterArenaTeamId(guid, GetSlot(), 0);
break;
}
}
// Inform player and remove arena team info from player data
if (player)
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
TC_LOG_DEBUG("bg.arena", "Player: %s [GUID: %u] left arena team type: %u [Id: %u, Name: %s].", player->GetName().c_str(), player->GetGUID().GetCounter(), GetType(), GetId(), GetName().c_str());
}
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
if (cleanDb)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBER);
stmt->setUInt32(0, GetId());
stmt->setUInt32(1, guid.GetCounter());
CharacterDatabase.Execute(stmt);
}
}
示例5: GetName
void ArenaTeam::DelMember(uint64 guid)
{
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->guid == guid)
{
m_members.erase(itr);
break;
}
if (Player *player = sObjectMgr.GetPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
}
示例6: GetName
void ArenaTeam::DelMember(ObjectGuid guid)
{
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
if (itr->guid == guid)
{
m_members.erase(itr);
break;
}
}
if(Player *player = sObjectMgr.GetPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for(int i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), guid.GetCounter());
}
示例7: GetSlot
void ArenaTeam::DelMember(uint64 guid)
{
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->guid == guid)
{
m_members.erase(itr);
break;
}
if (Player* player = sObjectMgr.GetPlayer(guid))
{
// remove from arena queue, if queued
for (uint8 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
{
if (uint32 bgQueueType = player->GetBattlegroundQueueId(i))
{
Battleground* bg = sBattlegroundMgr.GetBattlegroundTemplate(bgQueueType);
if (!bg || !bg->isArena())
break;
WorldPacket data;
sBattlegroundMgr.BuildBattlegroundStatusPacket(&data, bg, player->GetTeam(), player->GetBattlegroundQueueIndex(bgQueueType), STATUS_NONE, 0, 0);
player->GetSession()->SendPacket(&data);
sBattlegroundMgr.m_BattlegroundQueues[bgQueueType].RemovePlayer(player->GetGUID(), false);
}
}
player->SetInArenaTeam(0, GetSlot());
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
}