mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-18 01:34:33 +00:00
converted all tabs to 4 spaces
This commit is contained in:
@@ -167,9 +167,9 @@ bool Group::LoadGroupFromDB(Field* fields)
|
||||
|
||||
// group leader not exist
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(fields[0].GetUInt32(), m_leaderName))
|
||||
{
|
||||
uint32 groupLowGuid = fields[16].GetUInt32();
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
{
|
||||
uint32 groupLowGuid = fields[16].GetUInt32();
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP);
|
||||
stmt->setUInt32(0, groupLowGuid);
|
||||
trans->Append(stmt);
|
||||
@@ -181,7 +181,7 @@ bool Group::LoadGroupFromDB(Field* fields)
|
||||
stmt->setUInt32(0, groupLowGuid);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_lootMethod = LootMethod(fields[1].GetUInt8());
|
||||
m_looterGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
@@ -211,7 +211,7 @@ bool Group::LoadGroupFromDB(Field* fields)
|
||||
if (m_groupType & GROUPTYPE_LFG)
|
||||
sLFGMgr->_LoadFromDB(fields, GetGUID());
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles)
|
||||
@@ -224,7 +224,7 @@ void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup,
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
stmt->setUInt32(0, guidLow);
|
||||
stmt->setUInt32(1, GetLowGUID());
|
||||
stmt->setUInt32(1, GetLowGUID());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return;
|
||||
}
|
||||
@@ -234,8 +234,8 @@ void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup,
|
||||
member.roles = roles;
|
||||
|
||||
m_memberSlots.push_back(member);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
sWorld->UpdateGlobalPlayerGroup(guidLow, GetLowGUID());
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
sWorld->UpdateGlobalPlayerGroup(guidLow, GetLowGUID());
|
||||
|
||||
SubGroupCounterIncrease(subgroup);
|
||||
|
||||
@@ -282,9 +282,9 @@ void Group::ConvertToRaid()
|
||||
if (Player* player = ObjectAccessor::FindPlayer(citr->guid))
|
||||
player->UpdateForQuestWorldObjects();
|
||||
|
||||
// pussywizard: client automatically clears df "eye" near minimap, so remove from raid browser
|
||||
if (sLFGMgr->GetState(GetLeaderGUID()) == lfg::LFG_STATE_RAIDBROWSER)
|
||||
sLFGMgr->LeaveLfg(GetLeaderGUID());
|
||||
// pussywizard: client automatically clears df "eye" near minimap, so remove from raid browser
|
||||
if (sLFGMgr->GetState(GetLeaderGUID()) == lfg::LFG_STATE_RAIDBROWSER)
|
||||
sLFGMgr->LeaveLfg(GetLeaderGUID());
|
||||
}
|
||||
|
||||
bool Group::AddInvite(Player* player)
|
||||
@@ -322,8 +322,8 @@ void Group::RemoveInvite(Player* player)
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
if (!m_invitees.empty())
|
||||
m_invitees.erase(player);
|
||||
if (!m_invitees.empty())
|
||||
m_invitees.erase(player);
|
||||
player->SetGroupInvite(NULL);
|
||||
}
|
||||
}
|
||||
@@ -385,7 +385,7 @@ bool Group::AddMember(Player* player)
|
||||
member.roles = 0;
|
||||
m_memberSlots.push_back(member);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
sWorld->UpdateGlobalPlayerGroup(player->GetGUIDLow(), GetLowGUID());
|
||||
sWorld->UpdateGlobalPlayerGroup(player->GetGUIDLow(), GetLowGUID());
|
||||
|
||||
SubGroupCounterIncrease(subGroup);
|
||||
|
||||
@@ -403,7 +403,7 @@ bool Group::AddMember(Player* player)
|
||||
player->SetGroup(this, subGroup);
|
||||
|
||||
// if the same group invites the player back, cancel the homebind timer
|
||||
_cancelHomebindIfInstance(player);
|
||||
_cancelHomebindIfInstance(player);
|
||||
}
|
||||
|
||||
if (!isRaidGroup()) // reset targetIcons for non-raid-groups
|
||||
@@ -430,7 +430,7 @@ bool Group::AddMember(Player* player)
|
||||
{
|
||||
if (!IsLeader(player->GetGUID()) && !isBGGroup() && !isBFGroup())
|
||||
{
|
||||
Player::ResetInstances(player->GetGUIDLow(), INSTANCE_RESET_GROUP_JOIN, false);
|
||||
Player::ResetInstances(player->GetGUIDLow(), INSTANCE_RESET_GROUP_JOIN, false);
|
||||
|
||||
if (player->GetDungeonDifficulty() != GetDungeonDifficulty())
|
||||
{
|
||||
@@ -443,10 +443,10 @@ bool Group::AddMember(Player* player)
|
||||
player->SendRaidDifficulty(true);
|
||||
}
|
||||
}
|
||||
else if (IsLeader(player->GetGUID()) && isLFGGroup()) // pussywizard
|
||||
{
|
||||
Player::ResetInstances(player->GetGUIDLow(), INSTANCE_RESET_GROUP_JOIN, false);
|
||||
}
|
||||
else if (IsLeader(player->GetGUID()) && isLFGGroup()) // pussywizard
|
||||
{
|
||||
Player::ResetInstances(player->GetGUIDLow(), INSTANCE_RESET_GROUP_JOIN, false);
|
||||
}
|
||||
|
||||
player->SetGroupUpdateFlag(GROUP_UPDATE_FULL);
|
||||
UpdatePlayerOutOfRange(player);
|
||||
@@ -513,10 +513,10 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
|
||||
// LFG group vote kick handled in scripts
|
||||
if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK)
|
||||
{
|
||||
{
|
||||
sLFGMgr->InitBoot(GetGUID(), kicker, guid, std::string(reason ? reason : ""));
|
||||
return m_memberSlots.size() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group)
|
||||
if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1u : 2u))
|
||||
@@ -559,7 +559,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
stmt->setUInt32(0, GUID_LOPART(guid));
|
||||
stmt->setUInt32(1, GetLowGUID());
|
||||
stmt->setUInt32(1, GetLowGUID());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -573,10 +573,10 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
Roll* roll = *it;
|
||||
Roll::PlayerVote::iterator itr2 = roll->playerVote.find(guid);
|
||||
if (itr2 == roll->playerVote.end())
|
||||
{
|
||||
++it;
|
||||
{
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (itr2->second == GREED || itr2->second == DISENCHANT)
|
||||
--roll->totalGreed;
|
||||
@@ -590,12 +590,12 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
|
||||
roll->playerVote.erase(itr2);
|
||||
|
||||
// Xinef: itr can be erased inside
|
||||
// Xinef: player is removed from all vote lists so it will not pass above playerVote == playerVote.end statement during second iteration
|
||||
// Xinef: itr can be erased inside
|
||||
// Xinef: player is removed from all vote lists so it will not pass above playerVote == playerVote.end statement during second iteration
|
||||
if (CountRollVote(guid, roll->itemGUID, MAX_ROLL_TYPE))
|
||||
it = RollId.begin();
|
||||
else
|
||||
++it;
|
||||
it = RollId.begin();
|
||||
else
|
||||
++it;
|
||||
}
|
||||
|
||||
// Update subgroups
|
||||
@@ -604,46 +604,46 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
{
|
||||
SubGroupCounterDecrease(slot->group);
|
||||
m_memberSlots.erase(slot);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
sWorld->UpdateGlobalPlayerGroup(GUID_LOPART(guid), 0);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
sWorld->UpdateGlobalPlayerGroup(GUID_LOPART(guid), 0);
|
||||
}
|
||||
|
||||
// Pick new leader if necessary
|
||||
bool validLeader = true;
|
||||
bool validLeader = true;
|
||||
if (m_leaderGuid == guid)
|
||||
{
|
||||
validLeader = false;
|
||||
validLeader = false;
|
||||
for (member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if (ObjectAccessor::FindPlayerInOrOutOfWorld(itr->guid))
|
||||
{
|
||||
ChangeLeader(itr->guid);
|
||||
validLeader = true;
|
||||
validLeader = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_homebindIfInstance(player);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
Player::ResetInstances(guid, INSTANCE_RESET_GROUP_LEAVE, false);
|
||||
_homebindIfInstance(player);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
Player::ResetInstances(guid, INSTANCE_RESET_GROUP_LEAVE, false);
|
||||
|
||||
sScriptMgr->OnGroupRemoveMember(this, guid, method, kicker, reason);
|
||||
sScriptMgr->OnGroupRemoveMember(this, guid, method, kicker, reason);
|
||||
|
||||
SendUpdate();
|
||||
|
||||
if (!validLeader)
|
||||
{
|
||||
// pussywizard: temp do nothing, something causes crashes in MakeNewGroup
|
||||
//Disband();
|
||||
//return false;
|
||||
}
|
||||
if (!validLeader)
|
||||
{
|
||||
// pussywizard: temp do nothing, something causes crashes in MakeNewGroup
|
||||
//Disband();
|
||||
//return false;
|
||||
}
|
||||
|
||||
if (isLFGGroup() && GetMembersCount() == 1)
|
||||
{
|
||||
Player* leader = ObjectAccessor::FindPlayerInOrOutOfWorld(GetLeaderGUID());
|
||||
uint32 mapId = sLFGMgr->GetDungeonMapId(GetGUID());
|
||||
lfg::LfgState state = sLFGMgr->GetState(GetGUID());
|
||||
lfg::LfgState state = sLFGMgr->GetState(GetGUID());
|
||||
if (!mapId || !leader || (leader->IsAlive() && leader->GetMapId() != mapId) || state == lfg::LFG_STATE_NONE)
|
||||
{
|
||||
Disband();
|
||||
@@ -652,17 +652,17 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
}
|
||||
|
||||
if (m_memberMgr.getSize() < ((isLFGGroup() || isBGGroup() || isBFGroup()) ? 1u : 2u))
|
||||
{
|
||||
{
|
||||
Disband();
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
// If group size before player removal <= 2 then disband it
|
||||
else
|
||||
{
|
||||
sScriptMgr->OnGroupRemoveMember(this, guid, method, kicker, reason);
|
||||
sScriptMgr->OnGroupRemoveMember(this, guid, method, kicker, reason);
|
||||
Disband();
|
||||
return false;
|
||||
}
|
||||
@@ -693,7 +693,7 @@ void Group::ChangeLeader(uint64 newLeaderGuid)
|
||||
trans->Append(stmt);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
sInstanceSaveMgr->CopyBinds(m_leaderGuid, newLeaderGuid, newLeader);
|
||||
sInstanceSaveMgr->CopyBinds(m_leaderGuid, newLeaderGuid, newLeader);
|
||||
}
|
||||
|
||||
if (Player* oldLeader = ObjectAccessor::FindPlayerInOrOutOfWorld(m_leaderGuid))
|
||||
@@ -716,14 +716,14 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
Player* player;
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
sWorld->UpdateGlobalPlayerGroup(GUID_LOPART(citr->guid), 0);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
sWorld->UpdateGlobalPlayerGroup(GUID_LOPART(citr->guid), 0);
|
||||
|
||||
player = ObjectAccessor::FindPlayerInOrOutOfWorld(citr->guid);
|
||||
|
||||
_homebindIfInstance(player);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
Player::ResetInstances(citr->guid, INSTANCE_RESET_GROUP_LEAVE, false);
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
Player::ResetInstances(citr->guid, INSTANCE_RESET_GROUP_LEAVE, false);
|
||||
|
||||
if (!player)
|
||||
continue;
|
||||
@@ -1282,8 +1282,8 @@ bool Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choice)
|
||||
|
||||
Roll::PlayerVote::iterator itr = roll->playerVote.find(playerGUID);
|
||||
// this condition means that player joins to the party after roll begins
|
||||
// Xinef: if choice == MAX_ROLL_TYPE, player was removed from the map in removefromgroup
|
||||
// Xinef: itr can be invalid as it is not used below
|
||||
// Xinef: if choice == MAX_ROLL_TYPE, player was removed from the map in removefromgroup
|
||||
// Xinef: itr can be invalid as it is not used below
|
||||
if (Choice < MAX_ROLL_TYPE && itr == roll->playerVote.end())
|
||||
return false;
|
||||
|
||||
@@ -1316,11 +1316,11 @@ bool Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choice)
|
||||
}
|
||||
|
||||
if (roll->totalPass + roll->totalNeed + roll->totalGreed >= roll->totalPlayersRolling)
|
||||
{
|
||||
{
|
||||
CountTheRoll(rollI, NULL);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//called when roll timer expires
|
||||
@@ -1361,12 +1361,12 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
if (itr->second != NEED)
|
||||
continue;
|
||||
|
||||
player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!player || allowedMap != NULL && player->FindMap() != allowedMap)
|
||||
{
|
||||
--roll->totalNeed;
|
||||
continue;
|
||||
}
|
||||
player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!player || allowedMap != NULL && player->FindMap() != allowedMap)
|
||||
{
|
||||
--roll->totalNeed;
|
||||
continue;
|
||||
}
|
||||
|
||||
uint8 randomN = urand(1, 100);
|
||||
SendLootRoll(0, itr->first, randomN, ROLL_NEED, *roll);
|
||||
@@ -1377,37 +1377,37 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
}
|
||||
}
|
||||
|
||||
if (maxguid) // pussywizard: added condition
|
||||
{
|
||||
SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll);
|
||||
player = ObjectAccessor::FindPlayer(maxguid);
|
||||
if (maxguid) // pussywizard: added condition
|
||||
{
|
||||
SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll);
|
||||
player = ObjectAccessor::FindPlayer(maxguid);
|
||||
|
||||
if (player)
|
||||
{
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul);
|
||||
if (player)
|
||||
{
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul);
|
||||
|
||||
ItemPosCountVec dest;
|
||||
LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
item->is_looted = true;
|
||||
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
|
||||
roll->getLoot()->unlootedCount--;
|
||||
AllowedLooterSet looters = item->GetAllowedLooters();
|
||||
player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
||||
player->UpdateLootAchievements(item, roll->getLoot());
|
||||
}
|
||||
else
|
||||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
roll->totalNeed = 0;
|
||||
ItemPosCountVec dest;
|
||||
LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
item->is_looted = true;
|
||||
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
|
||||
roll->getLoot()->unlootedCount--;
|
||||
AllowedLooterSet looters = item->GetAllowedLooters();
|
||||
player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
||||
player->UpdateLootAchievements(item, roll->getLoot());
|
||||
}
|
||||
else
|
||||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
roll->totalNeed = 0;
|
||||
}
|
||||
}
|
||||
if (roll->totalNeed == 0 && roll->totalGreed > 0) // pussywizard: if (roll->totalNeed == 0 && ...), not else if, because numbers can be modified above if player is on a different map
|
||||
@@ -1425,12 +1425,12 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
if (itr->second != GREED && itr->second != DISENCHANT)
|
||||
continue;
|
||||
|
||||
player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!player || allowedMap != NULL && player->FindMap() != allowedMap)
|
||||
{
|
||||
--roll->totalGreed;
|
||||
continue;
|
||||
}
|
||||
player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!player || allowedMap != NULL && player->FindMap() != allowedMap)
|
||||
{
|
||||
--roll->totalGreed;
|
||||
continue;
|
||||
}
|
||||
|
||||
uint8 randomN = urand(1, 100);
|
||||
SendLootRoll(0, itr->first, randomN, itr->second, *roll);
|
||||
@@ -1442,50 +1442,50 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
}
|
||||
}
|
||||
|
||||
if (maxguid) // pussywizard: added condition
|
||||
{
|
||||
SendLootRollWon(0, maxguid, maxresul, rollvote, *roll);
|
||||
player = ObjectAccessor::FindPlayer(maxguid);
|
||||
if (maxguid) // pussywizard: added condition
|
||||
{
|
||||
SendLootRollWon(0, maxguid, maxresul, rollvote, *roll);
|
||||
player = ObjectAccessor::FindPlayer(maxguid);
|
||||
|
||||
if (player)
|
||||
{
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul);
|
||||
if (player)
|
||||
{
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul);
|
||||
|
||||
LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
|
||||
LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
|
||||
|
||||
if (rollvote == GREED)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
item->is_looted = true;
|
||||
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
|
||||
roll->getLoot()->unlootedCount--;
|
||||
AllowedLooterSet looters = item->GetAllowedLooters();
|
||||
player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
||||
player->UpdateLootAchievements(item, roll->getLoot());
|
||||
}
|
||||
else
|
||||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
}
|
||||
}
|
||||
else if (rollvote == DISENCHANT)
|
||||
{
|
||||
item->is_looted = true;
|
||||
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
|
||||
roll->getLoot()->unlootedCount--;
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(roll->itemid);
|
||||
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, 13262); // Disenchant
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
roll->totalGreed = 0;
|
||||
if (rollvote == GREED)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
item->is_looted = true;
|
||||
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
|
||||
roll->getLoot()->unlootedCount--;
|
||||
AllowedLooterSet looters = item->GetAllowedLooters();
|
||||
player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
|
||||
player->UpdateLootAchievements(item, roll->getLoot());
|
||||
}
|
||||
else
|
||||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
}
|
||||
}
|
||||
else if (rollvote == DISENCHANT)
|
||||
{
|
||||
item->is_looted = true;
|
||||
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
|
||||
roll->getLoot()->unlootedCount--;
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(roll->itemid);
|
||||
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, 13262); // Disenchant
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
roll->totalGreed = 0;
|
||||
}
|
||||
}
|
||||
if (roll->totalNeed == 0 && roll->totalGreed == 0) // pussywizard: if, not else, because numbers can be modified above if player is on a different map
|
||||
@@ -1574,7 +1574,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
|
||||
data << uint8(slot->roles);
|
||||
if (isLFGGroup())
|
||||
{
|
||||
data << uint8(sLFGMgr->GetState(m_guid) == lfg::LFG_STATE_FINISHED_DUNGEON ? 2 : 0); // FIXME - Dungeon save status? 2 = done
|
||||
data << uint8(sLFGMgr->GetState(m_guid) == lfg::LFG_STATE_FINISHED_DUNGEON ? 2 : 0); // FIXME - Dungeon save status? 2 = done
|
||||
data << uint32(sLFGMgr->GetDungeon(m_guid));
|
||||
}
|
||||
|
||||
@@ -1819,7 +1819,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
if (!bgEntry)
|
||||
return ERR_GROUP_JOIN_BATTLEGROUND_FAIL;
|
||||
|
||||
// too many players in the group
|
||||
// too many players in the group
|
||||
if (GetMembersCount() > bgEntry->maxGroupSize)
|
||||
return ERR_BATTLEGROUND_NONE;
|
||||
|
||||
@@ -1866,13 +1866,13 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
if (member->isUsingLfg())
|
||||
return ERR_LFG_CANT_USE_BATTLEGROUND;
|
||||
|
||||
// pussywizard: prevent joining when any member is in bg/arena
|
||||
if (member->InBattleground())
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
// pussywizard: prevent joining when any member is in bg/arena
|
||||
if (member->InBattleground())
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
|
||||
// pussywizard: check for free slot, this is actually ensured before calling this function, but just in case
|
||||
if (!member->HasFreeBattlegroundQueueId())
|
||||
return ERR_BATTLEGROUND_TOO_MANY_QUEUES;
|
||||
// pussywizard: check for free slot, this is actually ensured before calling this function, but just in case
|
||||
if (!member->HasFreeBattlegroundQueueId())
|
||||
return ERR_BATTLEGROUND_TOO_MANY_QUEUES;
|
||||
}
|
||||
|
||||
// for arenas: check party size is proper
|
||||
@@ -1936,62 +1936,62 @@ void Group::SetRaidDifficulty(Difficulty difficulty)
|
||||
|
||||
void Group::ResetInstances(uint8 method, bool isRaid, Player* leader)
|
||||
{
|
||||
if (isBGGroup() || isBFGroup() || isLFGGroup())
|
||||
if (isBGGroup() || isBFGroup() || isLFGGroup())
|
||||
return;
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case INSTANCE_RESET_ALL:
|
||||
{
|
||||
if (leader->GetDifficulty(false) != DUNGEON_DIFFICULTY_NORMAL)
|
||||
break;
|
||||
std::vector<InstanceSave*> toUnbind;
|
||||
BoundInstancesMap const& m_boundInstances = sInstanceSaveMgr->PlayerGetBoundInstances(leader->GetGUIDLow(), Difficulty(DUNGEON_DIFFICULTY_NORMAL));
|
||||
for (BoundInstancesMap::const_iterator itr = m_boundInstances.begin(); itr != m_boundInstances.end(); ++itr)
|
||||
{
|
||||
InstanceSave* instanceSave = itr->second.save;
|
||||
const MapEntry* entry = sMapStore.LookupEntry(itr->first);
|
||||
if (!entry || entry->IsRaid() || !instanceSave->CanReset())
|
||||
continue;
|
||||
switch (method)
|
||||
{
|
||||
case INSTANCE_RESET_ALL:
|
||||
{
|
||||
if (leader->GetDifficulty(false) != DUNGEON_DIFFICULTY_NORMAL)
|
||||
break;
|
||||
std::vector<InstanceSave*> toUnbind;
|
||||
BoundInstancesMap const& m_boundInstances = sInstanceSaveMgr->PlayerGetBoundInstances(leader->GetGUIDLow(), Difficulty(DUNGEON_DIFFICULTY_NORMAL));
|
||||
for (BoundInstancesMap::const_iterator itr = m_boundInstances.begin(); itr != m_boundInstances.end(); ++itr)
|
||||
{
|
||||
InstanceSave* instanceSave = itr->second.save;
|
||||
const MapEntry* entry = sMapStore.LookupEntry(itr->first);
|
||||
if (!entry || entry->IsRaid() || !instanceSave->CanReset())
|
||||
continue;
|
||||
|
||||
Map* map = sMapMgr->FindMap(instanceSave->GetMapId(), instanceSave->GetInstanceId());
|
||||
if (!map || map->ToInstanceMap()->Reset(method))
|
||||
{
|
||||
leader->SendResetInstanceSuccess(instanceSave->GetMapId());
|
||||
toUnbind.push_back(instanceSave);
|
||||
}
|
||||
else
|
||||
leader->SendResetInstanceFailed(0, instanceSave->GetMapId());
|
||||
}
|
||||
for (std::vector<InstanceSave*>::const_iterator itr = toUnbind.begin(); itr != toUnbind.end(); ++itr)
|
||||
sInstanceSaveMgr->UnbindAllFor(*itr);
|
||||
}
|
||||
break;
|
||||
case INSTANCE_RESET_CHANGE_DIFFICULTY:
|
||||
{
|
||||
std::vector<InstanceSave*> toUnbind;
|
||||
BoundInstancesMap const& m_boundInstances = sInstanceSaveMgr->PlayerGetBoundInstances(leader->GetGUIDLow(), leader->GetDifficulty(isRaid));
|
||||
for (BoundInstancesMap::const_iterator itr = m_boundInstances.begin(); itr != m_boundInstances.end(); ++itr)
|
||||
{
|
||||
InstanceSave* instanceSave = itr->second.save;
|
||||
const MapEntry* entry = sMapStore.LookupEntry(itr->first);
|
||||
if (!entry || entry->IsRaid() != isRaid || !instanceSave->CanReset())
|
||||
continue;
|
||||
Map* map = sMapMgr->FindMap(instanceSave->GetMapId(), instanceSave->GetInstanceId());
|
||||
if (!map || map->ToInstanceMap()->Reset(method))
|
||||
{
|
||||
leader->SendResetInstanceSuccess(instanceSave->GetMapId());
|
||||
toUnbind.push_back(instanceSave);
|
||||
}
|
||||
else
|
||||
leader->SendResetInstanceFailed(0, instanceSave->GetMapId());
|
||||
}
|
||||
for (std::vector<InstanceSave*>::const_iterator itr = toUnbind.begin(); itr != toUnbind.end(); ++itr)
|
||||
sInstanceSaveMgr->UnbindAllFor(*itr);
|
||||
}
|
||||
break;
|
||||
case INSTANCE_RESET_CHANGE_DIFFICULTY:
|
||||
{
|
||||
std::vector<InstanceSave*> toUnbind;
|
||||
BoundInstancesMap const& m_boundInstances = sInstanceSaveMgr->PlayerGetBoundInstances(leader->GetGUIDLow(), leader->GetDifficulty(isRaid));
|
||||
for (BoundInstancesMap::const_iterator itr = m_boundInstances.begin(); itr != m_boundInstances.end(); ++itr)
|
||||
{
|
||||
InstanceSave* instanceSave = itr->second.save;
|
||||
const MapEntry* entry = sMapStore.LookupEntry(itr->first);
|
||||
if (!entry || entry->IsRaid() != isRaid || !instanceSave->CanReset())
|
||||
continue;
|
||||
|
||||
Map* map = sMapMgr->FindMap(instanceSave->GetMapId(), instanceSave->GetInstanceId());
|
||||
if (!map || map->ToInstanceMap()->Reset(method))
|
||||
{
|
||||
leader->SendResetInstanceSuccess(instanceSave->GetMapId());
|
||||
toUnbind.push_back(instanceSave);
|
||||
}
|
||||
else
|
||||
leader->SendResetInstanceFailed(0, instanceSave->GetMapId());
|
||||
}
|
||||
for (std::vector<InstanceSave*>::const_iterator itr = toUnbind.begin(); itr != toUnbind.end(); ++itr)
|
||||
sInstanceSaveMgr->UnbindAllFor(*itr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
Map* map = sMapMgr->FindMap(instanceSave->GetMapId(), instanceSave->GetInstanceId());
|
||||
if (!map || map->ToInstanceMap()->Reset(method))
|
||||
{
|
||||
leader->SendResetInstanceSuccess(instanceSave->GetMapId());
|
||||
toUnbind.push_back(instanceSave);
|
||||
}
|
||||
else
|
||||
leader->SendResetInstanceFailed(0, instanceSave->GetMapId());
|
||||
}
|
||||
for (std::vector<InstanceSave*>::const_iterator itr = toUnbind.begin(); itr != toUnbind.end(); ++itr)
|
||||
sInstanceSaveMgr->UnbindAllFor(*itr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Group::_homebindIfInstance(Player* player)
|
||||
@@ -2002,10 +2002,10 @@ void Group::_homebindIfInstance(Player* player)
|
||||
|
||||
void Group::_cancelHomebindIfInstance(Player* player)
|
||||
{
|
||||
// if player is reinvited to group and in the instance - cancel homebind timer
|
||||
if (!player->FindMap() || !player->FindMap()->IsDungeon())
|
||||
return;
|
||||
InstancePlayerBind* bind = sInstanceSaveMgr->PlayerGetBoundInstance(player->GetGUIDLow(), player->FindMap()->GetId(), player->GetDifficulty(player->FindMap()->IsRaid()));
|
||||
// if player is reinvited to group and in the instance - cancel homebind timer
|
||||
if (!player->FindMap() || !player->FindMap()->IsDungeon())
|
||||
return;
|
||||
InstancePlayerBind* bind = sInstanceSaveMgr->PlayerGetBoundInstance(player->GetGUIDLow(), player->FindMap()->GetId(), player->GetDifficulty(player->FindMap()->IsRaid()));
|
||||
if (bind && bind->save->GetInstanceId() == player->GetInstanceId())
|
||||
player->m_InstanceValid = true;
|
||||
}
|
||||
|
||||
@@ -122,16 +122,16 @@ enum GroupUpdateFlags
|
||||
|
||||
enum lfgGroupFlags
|
||||
{
|
||||
GROUP_LFG_FLAG_APPLY_RANDOM_BUFF = 0x001,
|
||||
GROUP_LFG_FLAG_IS_RANDOM_INSTANCE = 0x002,
|
||||
GROUP_LFG_FLAG_IS_HEROIC = 0x004
|
||||
GROUP_LFG_FLAG_APPLY_RANDOM_BUFF = 0x001,
|
||||
GROUP_LFG_FLAG_IS_RANDOM_INSTANCE = 0x002,
|
||||
GROUP_LFG_FLAG_IS_HEROIC = 0x004
|
||||
};
|
||||
|
||||
enum DifficultyPreventionChangeType
|
||||
{
|
||||
DIFFICULTY_PREVENTION_CHANGE_NONE = 0,
|
||||
DIFFICULTY_PREVENTION_CHANGE_RECENTLY_CHANGED = 1,
|
||||
DIFFICULTY_PREVENTION_CHANGE_BOSS_KILLED = 2
|
||||
DIFFICULTY_PREVENTION_CHANGE_NONE = 0,
|
||||
DIFFICULTY_PREVENTION_CHANGE_RECENTLY_CHANGED = 1,
|
||||
DIFFICULTY_PREVENTION_CHANGE_BOSS_KILLED = 2
|
||||
};
|
||||
|
||||
#define GROUP_UPDATE_FLAGS_COUNT 20
|
||||
@@ -302,22 +302,22 @@ class Group
|
||||
// FG: evil hacks
|
||||
void BroadcastGroupUpdate(void);
|
||||
|
||||
// LFG
|
||||
void AddLfgBuffFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_APPLY_RANDOM_BUFF; }
|
||||
void AddLfgRandomInstanceFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_RANDOM_INSTANCE; }
|
||||
void AddLfgHeroicFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_HEROIC; }
|
||||
bool IsLfgWithBuff() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_APPLY_RANDOM_BUFF); }
|
||||
bool IsLfgRandomInstance() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_RANDOM_INSTANCE); }
|
||||
bool IsLfgHeroic() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_HEROIC); }
|
||||
// LFG
|
||||
void AddLfgBuffFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_APPLY_RANDOM_BUFF; }
|
||||
void AddLfgRandomInstanceFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_RANDOM_INSTANCE; }
|
||||
void AddLfgHeroicFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_HEROIC; }
|
||||
bool IsLfgWithBuff() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_APPLY_RANDOM_BUFF); }
|
||||
bool IsLfgRandomInstance() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_RANDOM_INSTANCE); }
|
||||
bool IsLfgHeroic() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_HEROIC); }
|
||||
|
||||
// Difficulty Change
|
||||
uint32 GetDifficultyChangePreventionTime() const { return _difficultyChangePreventionTime > time(NULL) ? _difficultyChangePreventionTime - time(NULL) : 0; }
|
||||
DifficultyPreventionChangeType GetDifficultyChangePreventionReason() const { return _difficultyChangePreventionType; }
|
||||
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
|
||||
{
|
||||
_difficultyChangePreventionTime = time(NULL) + MINUTE;
|
||||
_difficultyChangePreventionType = type;
|
||||
}
|
||||
// Difficulty Change
|
||||
uint32 GetDifficultyChangePreventionTime() const { return _difficultyChangePreventionTime > time(NULL) ? _difficultyChangePreventionTime - time(NULL) : 0; }
|
||||
DifficultyPreventionChangeType GetDifficultyChangePreventionReason() const { return _difficultyChangePreventionType; }
|
||||
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
|
||||
{
|
||||
_difficultyChangePreventionTime = time(NULL) + MINUTE;
|
||||
_difficultyChangePreventionType = type;
|
||||
}
|
||||
|
||||
protected:
|
||||
void _homebindIfInstance(Player* player);
|
||||
@@ -352,8 +352,8 @@ class Group
|
||||
uint32 m_maxEnchantingLevel;
|
||||
uint8 m_lfgGroupFlags;
|
||||
|
||||
// Xinef: change difficulty prevention
|
||||
uint32 _difficultyChangePreventionTime;
|
||||
DifficultyPreventionChangeType _difficultyChangePreventionType;
|
||||
// Xinef: change difficulty prevention
|
||||
uint32 _difficultyChangePreventionTime;
|
||||
DifficultyPreventionChangeType _difficultyChangePreventionType;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -49,10 +49,10 @@ void GroupMgr::RegisterGroupId(uint32 groupId)
|
||||
// Allocation was done in InitGroupIds()
|
||||
_groupIds[groupId] = true;
|
||||
|
||||
// Groups are pulled in ascending order from db and _nextGroupId is initialized with 1,
|
||||
// Groups are pulled in ascending order from db and _nextGroupId is initialized with 1,
|
||||
// so if the instance id is used, increment
|
||||
if (_nextGroupId == groupId)
|
||||
++_nextGroupId;
|
||||
if (_nextGroupId == groupId)
|
||||
++_nextGroupId;
|
||||
}
|
||||
|
||||
uint32 GroupMgr::GenerateGroupId()
|
||||
@@ -60,7 +60,7 @@ uint32 GroupMgr::GenerateGroupId()
|
||||
uint32 newGroupId = _nextGroupId;
|
||||
|
||||
// find the lowest available id starting from the current _nextGroupId
|
||||
while (_nextGroupId < 0xFFFFFFFF && ++_nextGroupId < _groupIds.size() && _groupIds[_nextGroupId]);
|
||||
while (_nextGroupId < 0xFFFFFFFF && ++_nextGroupId < _groupIds.size() && _groupIds[_nextGroupId]);
|
||||
|
||||
if (_nextGroupId == 0xFFFFFFFF)
|
||||
{
|
||||
@@ -99,45 +99,45 @@ void GroupMgr::LoadGroups()
|
||||
CharacterDatabase.DirectExecute("DELETE FROM groups WHERE leaderGuid NOT IN (SELECT guid FROM characters)");
|
||||
// Delete all groups with less than 2 members (or less than 1 for lfg groups)
|
||||
CharacterDatabase.DirectExecute("DELETE groups FROM groups LEFT JOIN ((SELECT guid, count(*) as cnt FROM group_member GROUP BY guid) t) ON groups.guid = t.guid WHERE t.guid IS NULL OR (t.cnt<=1 AND groups.groupType <> 12)");
|
||||
// Delete invalid lfg_data
|
||||
CharacterDatabase.DirectExecute("DELETE lfg_data FROM lfg_data LEFT JOIN groups ON lfg_data.guid = groups.guid WHERE groups.guid IS NULL OR groups.groupType <> 12");
|
||||
// CharacterDatabase.DirectExecute("DELETE groups FROM groups LEFT JOIN lfg_data ON groups.guid = lfg_data.guid WHERE groups.groupType=12 AND lfg_data.guid IS NULL"); // group should be left so binds are cleared when disbanded
|
||||
// Delete invalid lfg_data
|
||||
CharacterDatabase.DirectExecute("DELETE lfg_data FROM lfg_data LEFT JOIN groups ON lfg_data.guid = groups.guid WHERE groups.guid IS NULL OR groups.groupType <> 12");
|
||||
// CharacterDatabase.DirectExecute("DELETE groups FROM groups LEFT JOIN lfg_data ON groups.guid = lfg_data.guid WHERE groups.groupType=12 AND lfg_data.guid IS NULL"); // group should be left so binds are cleared when disbanded
|
||||
|
||||
InitGroupIds();
|
||||
InitGroupIds();
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult result = CharacterDatabase.Query("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6"
|
||||
// 10 11 12 13 14 15 16 17 18
|
||||
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.masterLooterGuid, g.guid, lfg.dungeon, lfg.state FROM groups g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
|
||||
|
||||
if (!result)
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 group definitions. DB table `groups` is empty!");
|
||||
sLog->outString();
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
Group* group = new Group;
|
||||
if (!group->LoadGroupFromDB(fields))
|
||||
{
|
||||
delete group;
|
||||
continue;
|
||||
}
|
||||
AddGroup(group);
|
||||
else
|
||||
{
|
||||
uint32 count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
Group* group = new Group;
|
||||
if (!group->LoadGroupFromDB(fields))
|
||||
{
|
||||
delete group;
|
||||
continue;
|
||||
}
|
||||
AddGroup(group);
|
||||
|
||||
RegisterGroupId(group->GetLowGUID());
|
||||
RegisterGroupId(group->GetLowGUID());
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
sLog->outString(">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
}
|
||||
|
||||
sLog->outString("Loading Group members...");
|
||||
@@ -156,25 +156,25 @@ void GroupMgr::LoadGroups()
|
||||
sLog->outString(">> Loaded 0 group members. DB table `group_member` is empty!");
|
||||
sLog->outString();
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
Group* group = GetGroupByGUID(fields[0].GetUInt32());
|
||||
else
|
||||
{
|
||||
uint32 count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
Group* group = GetGroupByGUID(fields[0].GetUInt32());
|
||||
|
||||
if (group)
|
||||
group->LoadMemberFromDB(fields[1].GetUInt32(), fields[2].GetUInt8(), fields[3].GetUInt8(), fields[4].GetUInt8());
|
||||
//else
|
||||
// sLog->outError("GroupMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32());
|
||||
if (group)
|
||||
group->LoadMemberFromDB(fields[1].GetUInt32(), fields[2].GetUInt8(), fields[3].GetUInt8(), fields[4].GetUInt8());
|
||||
//else
|
||||
// sLog->outError("GroupMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32());
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
sLog->outString(">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
|
||||
Group* GetGroupByGUID(uint32 guid) const;
|
||||
|
||||
void InitGroupIds();
|
||||
void InitGroupIds();
|
||||
void RegisterGroupId(uint32 groupId);
|
||||
uint32 GenerateGroupId();
|
||||
|
||||
@@ -42,8 +42,8 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
typedef std::vector<bool> GroupIds;
|
||||
GroupIds _groupIds;
|
||||
typedef std::vector<bool> GroupIds;
|
||||
GroupIds _groupIds;
|
||||
uint32 _nextGroupId;
|
||||
GroupContainer GroupStore;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user