[11590] Cleanups for barGoLink

* Rename barGoLink -> BarGoLink as expected by mangos code style
* Add uint32/uint6 constructor versions for BarGoLink,
  and remove lot casts required before for BarGoLink use
This commit is contained in:
VladimirMangos 2011-06-03 11:46:48 +04:00
parent 6b8f9fe03d
commit c870ef324d
26 changed files with 430 additions and 410 deletions

View file

@ -2217,7 +2217,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
{
if (sAchievementCriteriaStore.GetNumRows()==0)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2225,7 +2225,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
return;
}
barGoLink bar( sAchievementCriteriaStore.GetNumRows() );
BarGoLink bar(sAchievementCriteriaStore.GetNumRows());
for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId)
{
bar.step();
@ -2248,7 +2248,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
{
if(sAchievementStore.GetNumRows()==0)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2257,7 +2257,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
}
uint32 count = 0;
barGoLink bar( sAchievementStore.GetNumRows() );
BarGoLink bar(sAchievementStore.GetNumRows());
for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId)
{
bar.step();
@ -2282,7 +2282,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2292,7 +2292,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
uint32 count = 0;
uint32 disabled_count = 0;
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
bar.step();
@ -2411,7 +2411,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2419,7 +2419,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
bar.step();
@ -2452,7 +2452,7 @@ void AchievementGlobalMgr::LoadRewards()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -2462,7 +2462,7 @@ void AchievementGlobalMgr::LoadRewards()
}
uint32 count = 0;
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -2583,7 +2583,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -2592,7 +2592,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -291,14 +291,14 @@ void AuctionHouseMgr::LoadAuctionItems()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 auction items");
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
@ -342,7 +342,7 @@ void AuctionHouseMgr::LoadAuctions()
QueryResult *result = CharacterDatabase.Query("SELECT COUNT(*) FROM auction");
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 auctions. DB table `auction` is empty.");
@ -355,7 +355,7 @@ void AuctionHouseMgr::LoadAuctions()
if (!AuctionCount)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 auctions. DB table `auction` is empty.");
@ -365,14 +365,14 @@ void AuctionHouseMgr::LoadAuctions()
result = CharacterDatabase.Query("SELECT id,houseid,itemguid,item_template,itemowner,buyoutprice,time,moneyTime,buyguid,lastbid,startbid,deposit FROM auction");
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 auctions. DB table `auction` is empty.");
return;
}
barGoLink bar(AuctionCount);
BarGoLink bar(AuctionCount);
typedef std::map<uint32, std::wstring> PlayerNames;
PlayerNames playerNames; // caching for load time

View file

@ -1612,7 +1612,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -1621,7 +1621,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -2025,7 +2025,7 @@ void BattleGroundMgr::LoadBattleMastersEntry()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2033,7 +2033,7 @@ void BattleGroundMgr::LoadBattleMastersEntry()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -2137,7 +2137,7 @@ void BattleGroundMgr::LoadBattleEventIndexes()
"ORDER BY m, ev1, ev2" );
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2145,7 +2145,7 @@ void BattleGroundMgr::LoadBattleEventIndexes()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -61,7 +61,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
bool found = false;
std::ostringstream ss;
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
bar.step();

View file

@ -44,7 +44,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
sLog.outString("Loading EventAI Texts additional data...");
if (result)
{
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
do
@ -105,7 +105,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
}
else
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty.");
@ -159,7 +159,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use)
QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons");
if (result)
{
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
uint32 Count = 0;
do
@ -196,7 +196,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use)
sLog.outString(">> Loaded %u CreatureEventAI summon definitions", Count);
}else
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
@ -253,7 +253,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
"FROM creature_ai_scripts");
if (result)
{
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
uint32 Count = 0;
do
@ -822,7 +822,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
sLog.outString(">> Loaded %u CreatureEventAI scripts", Count);
}else
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");

View file

@ -283,7 +283,7 @@ struct LocalData
};
template<class T>
inline void LoadDBC(LocalData& localeData,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
{
// compatibility format and C++ structure sizes
MANGOS_ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
@ -364,7 +364,7 @@ void LoadDBCStores(const std::string& dataPath)
const uint32 DBCFilesCount = 92;
barGoLink bar( (int)DBCFilesCount );
BarGoLink bar(DBCFilesCount);
StoreProblemList bad_dbc_files;

View file

@ -38,7 +38,7 @@ void GMTicketMgr::LoadGMTickets()
if( !result )
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -47,7 +47,7 @@ void GMTicketMgr::LoadGMTickets()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -121,7 +121,7 @@ void GameEventMgr::LoadFromDB()
uint32 count = 0;
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
++count;
@ -185,7 +185,7 @@ void GameEventMgr::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -194,7 +194,7 @@ void GameEventMgr::LoadFromDB()
else
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -263,7 +263,7 @@ void GameEventMgr::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -272,7 +272,7 @@ void GameEventMgr::LoadFromDB()
else
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -354,7 +354,7 @@ void GameEventMgr::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -363,7 +363,7 @@ void GameEventMgr::LoadFromDB()
else
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -434,7 +434,7 @@ void GameEventMgr::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -443,7 +443,7 @@ void GameEventMgr::LoadFromDB()
else
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -494,7 +494,7 @@ void GameEventMgr::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -503,7 +503,7 @@ void GameEventMgr::LoadFromDB()
else
{
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();

View file

@ -95,7 +95,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -123,7 +123,7 @@ void GuildMgr::LoadGuilds()
// 0 1 2 3 4
QueryResult* guildBankTabRightsResult = CharacterDatabase.Query("SELECT guildid,TabId,rid,gbright,SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC");
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -57,7 +57,7 @@ void LoadRandomEnchantmentsTable()
if (result)
{
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -102,7 +102,7 @@ void LootStore::LoadLootTable()
if (result)
{
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -702,7 +702,7 @@ void MapPersistentStateManager::_DelHelper(DatabaseType &db, const char *fields,
void MapPersistentStateManager::CleanupInstances()
{
barGoLink bar(2);
BarGoLink bar(2);
bar.step();
// load reset times and clean expired instances
@ -754,7 +754,7 @@ void MapPersistentStateManager::PackInstances()
delete result;
}
barGoLink bar( InstanceSet.size() + 1);
BarGoLink bar(InstanceSet.size() + 1);
bar.step();
uint32 InstanceNumber = 1;
@ -919,7 +919,7 @@ void MapPersistentStateManager::LoadCreatureRespawnTimes()
QueryResult *result = CharacterDatabase.Query("SELECT guid, respawntime, map, instance, difficulty, resettime FROM creature_respawn LEFT JOIN instance ON instance = id");
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -928,7 +928,7 @@ void MapPersistentStateManager::LoadCreatureRespawnTimes()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -984,7 +984,7 @@ void MapPersistentStateManager::LoadGameobjectRespawnTimes()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -993,7 +993,7 @@ void MapPersistentStateManager::LoadGameobjectRespawnTimes()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -236,7 +236,7 @@ void ObjectMgr::LoadCreatureLocales()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -245,7 +245,7 @@ void ObjectMgr::LoadCreatureLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -310,7 +310,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -319,7 +319,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -395,7 +395,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -404,7 +404,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -1067,7 +1067,7 @@ void ObjectMgr::LoadCreatureModelRace()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -1076,7 +1076,7 @@ void ObjectMgr::LoadCreatureModelRace()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
@ -1196,7 +1196,7 @@ void ObjectMgr::LoadCreatures()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -1221,7 +1221,7 @@ void ObjectMgr::LoadCreatures()
if (GetMapDifficultyData(i,Difficulty(k)))
spawnMasks[i] |= (1 << k);
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -1415,7 +1415,7 @@ void ObjectMgr::LoadGameobjects()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -1432,7 +1432,7 @@ void ObjectMgr::LoadGameobjects()
if (GetMapDifficultyData(i,Difficulty(k)))
spawnMasks[i] |= (1 << k);
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -1695,7 +1695,7 @@ void ObjectMgr::LoadItemLocales()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -1704,7 +1704,7 @@ void ObjectMgr::LoadItemLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -2354,7 +2354,7 @@ void ObjectMgr::LoadItemConverts()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -2363,7 +2363,7 @@ void ObjectMgr::LoadItemConverts()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -2419,7 +2419,7 @@ void ObjectMgr::LoadItemRequiredTarget()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -2428,7 +2428,7 @@ void ObjectMgr::LoadItemRequiredTarget()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -2523,7 +2523,7 @@ void ObjectMgr::LoadPetLevelInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2532,7 +2532,7 @@ void ObjectMgr::LoadPetLevelInfo()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -2639,7 +2639,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
sLog.outString();
sLog.outString( ">> Loaded %u player create definitions", count );
@ -2648,7 +2648,7 @@ void ObjectMgr::LoadPlayerInfo()
exit(1);
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -2722,7 +2722,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -2731,7 +2731,7 @@ void ObjectMgr::LoadPlayerInfo()
}
else
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -2795,7 +2795,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
sLog.outString();
sLog.outString( ">> Loaded %u player create spells", count );
@ -2803,7 +2803,7 @@ void ObjectMgr::LoadPlayerInfo()
}
else
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -2857,7 +2857,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
sLog.outString();
sLog.outString(">> Loaded %u player create actions", count);
@ -2865,7 +2865,7 @@ void ObjectMgr::LoadPlayerInfo()
}
else
{
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -2919,7 +2919,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
sLog.outString();
sLog.outString( ">> Loaded %u level health/mana definitions", count );
@ -2928,7 +2928,7 @@ void ObjectMgr::LoadPlayerInfo()
exit(1);
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -3017,7 +3017,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
sLog.outString();
sLog.outString(">> Loaded %u level stats definitions", count);
@ -3026,7 +3026,7 @@ void ObjectMgr::LoadPlayerInfo()
exit(1);
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -3069,10 +3069,8 @@ void ObjectMgr::LoadPlayerInfo()
PlayerLevelInfo* pLevelInfo = &pInfo->levelInfo[current_level-1];
for (int i = 0; i < MAX_STATS; i++)
{
for (int i = 0; i < MAX_STATS; ++i)
pLevelInfo->stats[i] = fields[i+3].GetUInt8();
}
bar.step();
++count;
@ -3145,7 +3143,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
sLog.outString();
sLog.outString(">> Loaded %u xp for level definitions", count);
@ -3154,7 +3152,7 @@ void ObjectMgr::LoadPlayerInfo()
exit(1);
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -3314,7 +3312,7 @@ void ObjectMgr::LoadArenaTeams()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -3329,7 +3327,7 @@ void ObjectMgr::LoadArenaTeams()
"SELECT arenateamid,member.guid,played_week,wons_week,played_season,wons_season,personal_rating,name,class "
"FROM arena_team_member member LEFT JOIN characters chars on member.guid = chars.guid ORDER BY member.arenateamid ASC");
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -3364,7 +3362,7 @@ void ObjectMgr::LoadGroups()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -3373,7 +3371,7 @@ void ObjectMgr::LoadGroups()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -3401,14 +3399,14 @@ void ObjectMgr::LoadGroups()
result = CharacterDatabase.Query("SELECT memberGuid, assistant, subgroup, groupId FROM group_member ORDER BY groupId");
if (!result)
{
barGoLink bar2( 1 );
BarGoLink bar2(1);
bar2.step();
}
else
{
Group* group = NULL; // used as cached pointer for avoid relookup group for each member
barGoLink bar2( (int)result->GetRowCount() );
BarGoLink bar2(result->GetRowCount());
do
{
bar2.step();
@ -3470,14 +3468,14 @@ void ObjectMgr::LoadGroups()
if (!result)
{
barGoLink bar2( 1 );
BarGoLink bar2(1);
bar2.step();
}
else
{
Group* group = NULL; // used as cached pointer for avoid relookup group for each member
barGoLink bar2( (int)result->GetRowCount() );
BarGoLink bar2(result->GetRowCount());
do
{
bar2.step();
@ -3579,9 +3577,9 @@ void ObjectMgr::LoadQuests()
// 139 140
"StartScript, CompleteScript"
" FROM quest_template");
if (result == NULL)
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -3593,7 +3591,7 @@ void ObjectMgr::LoadQuests()
// create multimap previous quest for each existing quest
// some quests can have many previous maps set by NextQuestId in previous quest
// for example set of race quests can lead to single not race specific quest
barGoLink bar((int) result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
bar.step();
@ -4238,7 +4236,7 @@ void ObjectMgr::LoadQuestLocales()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -4247,7 +4245,7 @@ void ObjectMgr::LoadQuestLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -4426,7 +4424,7 @@ void ObjectMgr::LoadPageTextLocales()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -4435,7 +4433,7 @@ void ObjectMgr::LoadPageTextLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -4592,7 +4590,7 @@ void ObjectMgr::LoadGossipText()
int count = 0;
if( !result )
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -4602,7 +4600,7 @@ void ObjectMgr::LoadGossipText()
int cic;
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -4622,7 +4620,7 @@ void ObjectMgr::LoadGossipText()
GossipText& gText = mGossipText[Text_ID];
for (int i=0; i< 8; i++)
for (int i = 0; i < 8; ++i)
{
gText.Options[i].Text_0 = fields[cic++].GetCppString();
gText.Options[i].Text_1 = fields[cic++].GetCppString();
@ -4660,7 +4658,7 @@ void ObjectMgr::LoadGossipTextLocales()
if(!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -4669,7 +4667,7 @@ void ObjectMgr::LoadGossipTextLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -4736,7 +4734,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
QueryResult* result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,has_items,expire_time,cod,checked,mailTemplateId FROM mail WHERE expire_time < '" UI64FMTD "'", (uint64)basetime);
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Only expired mails (need to be return or delete) or DB table `mail` is empty.");
@ -4748,7 +4746,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
//delitems << "DELETE FROM item_instance WHERE guid IN ( ";
//delmails << "DELETE FROM mail WHERE id IN ( "
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
Field *fields;
@ -4842,7 +4840,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -4850,7 +4848,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
return;
}
barGoLink bar((int) result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -4906,7 +4904,7 @@ void ObjectMgr::LoadTavernAreaTriggers()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -4914,7 +4912,7 @@ void ObjectMgr::LoadTavernAreaTriggers()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -5052,7 +5050,7 @@ void ObjectMgr::LoadGraveyardZones()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -5060,7 +5058,7 @@ void ObjectMgr::LoadGraveyardZones()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -5268,7 +5266,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -5277,7 +5275,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -5467,7 +5465,7 @@ void ObjectMgr::PackGroupIds()
delete result;
}
barGoLink bar( groupIds.size() + 1);
BarGoLink bar(groupIds.size() + 1);
bar.step();
uint32 groupId = 1;
@ -5604,7 +5602,7 @@ void ObjectMgr::LoadGameObjectLocales()
if(!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -5613,7 +5611,7 @@ void ObjectMgr::LoadGameObjectLocales()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -5922,7 +5920,7 @@ void ObjectMgr::LoadExplorationBaseXP()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -5931,7 +5929,7 @@ void ObjectMgr::LoadExplorationBaseXP()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -5971,7 +5969,7 @@ void ObjectMgr::LoadPetNames()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -5980,7 +5978,7 @@ void ObjectMgr::LoadPetNames()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -6013,7 +6011,7 @@ void ObjectMgr::LoadPetNumber()
delete result;
}
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -6049,7 +6047,7 @@ void ObjectMgr::LoadCorpses()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -6058,7 +6056,7 @@ void ObjectMgr::LoadCorpses()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -6095,7 +6093,7 @@ void ObjectMgr::LoadReputationRewardRate()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6104,7 +6102,7 @@ void ObjectMgr::LoadReputationRewardRate()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6169,7 +6167,7 @@ void ObjectMgr::LoadReputationOnKill()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6178,7 +6176,7 @@ void ObjectMgr::LoadReputationOnKill()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6244,7 +6242,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6253,7 +6251,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6366,7 +6364,7 @@ void ObjectMgr::LoadPointsOfInterest()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6375,7 +6373,7 @@ void ObjectMgr::LoadPointsOfInterest()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6420,7 +6418,7 @@ void ObjectMgr::LoadQuestPOI()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6429,7 +6427,7 @@ void ObjectMgr::LoadQuestPOI()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6497,7 +6495,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6506,7 +6504,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6586,7 +6584,7 @@ void ObjectMgr::LoadWeatherZoneChances()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6595,7 +6593,7 @@ void ObjectMgr::LoadWeatherZoneChances()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6684,7 +6682,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelationsMap& map, char const* tab
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -6693,7 +6691,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelationsMap& map, char const* tab
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -6786,7 +6784,7 @@ void ObjectMgr::LoadReservedPlayersNames()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -6794,7 +6792,7 @@ void ObjectMgr::LoadReservedPlayersNames()
return;
}
barGoLink bar((int) result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
Field* fields;
do
@ -7003,14 +7001,14 @@ void ObjectMgr::LoadGameObjectForQuests()
if (!sGOStorage.MaxEntry)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded 0 GameObjects for quests");
return;
}
barGoLink bar(sGOStorage.MaxEntry - 1);
BarGoLink bar(sGOStorage.MaxEntry - 1);
uint32 count = 0;
// collect GO entries for GO that must activated
@ -7123,7 +7121,7 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -7137,7 +7135,7 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min
uint32 count = 0;
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -7232,7 +7230,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -7241,7 +7239,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
return;
}
barGoLink bar((int) result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -7815,7 +7813,7 @@ void ObjectMgr::LoadGameTele()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -7824,7 +7822,7 @@ void ObjectMgr::LoadGameTele()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -7943,7 +7941,7 @@ void ObjectMgr::LoadMailLevelRewards()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -7952,7 +7950,7 @@ void ObjectMgr::LoadMailLevelRewards()
return;
}
barGoLink bar((int) result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -8015,7 +8013,7 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -8024,7 +8022,7 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
std::set<uint32> talentIds;
@ -8197,7 +8195,7 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM %s", tableName);
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -8206,7 +8204,7 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
do
@ -8272,7 +8270,7 @@ void ObjectMgr::LoadNpcGossips()
QueryResult* result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip");
if( !result )
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -8281,7 +8279,7 @@ void ObjectMgr::LoadNpcGossips()
return;
}
barGoLink bar((int) result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
uint32 guid,textid;
@ -8324,7 +8322,7 @@ void ObjectMgr::LoadGossipMenu()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -8333,7 +8331,7 @@ void ObjectMgr::LoadGossipMenu()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
@ -8415,7 +8413,7 @@ void ObjectMgr::LoadGossipMenuItems()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -8439,7 +8437,7 @@ void ObjectMgr::LoadGossipMenuItems()
}
// loading
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
uint32 count = 0;

View file

@ -595,7 +595,7 @@ void PoolManager::LoadFromDB()
uint32 count = 0;
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
++count;
@ -628,7 +628,7 @@ void PoolManager::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar2(1);
BarGoLink bar2(1);
bar2.step();
sLog.outString();
@ -637,7 +637,7 @@ void PoolManager::LoadFromDB()
else
{
barGoLink bar2((int)result->GetRowCount());
BarGoLink bar2(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -690,7 +690,7 @@ void PoolManager::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar2(1);
BarGoLink bar2(1);
bar2.step();
sLog.outString();
@ -698,7 +698,7 @@ void PoolManager::LoadFromDB()
}
else
{
barGoLink bar2((int)result->GetRowCount());
BarGoLink bar2(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -767,7 +767,7 @@ void PoolManager::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar2(1);
BarGoLink bar2(1);
bar2.step();
sLog.outString();
@ -776,7 +776,7 @@ void PoolManager::LoadFromDB()
else
{
barGoLink bar2((int)result->GetRowCount());
BarGoLink bar2(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -838,7 +838,7 @@ void PoolManager::LoadFromDB()
count = 0;
if (!result)
{
barGoLink bar2(1);
BarGoLink bar2(1);
bar2.step();
sLog.outString();
@ -847,7 +847,7 @@ void PoolManager::LoadFromDB()
else
{
barGoLink bar2((int)result->GetRowCount());
BarGoLink bar2(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -922,7 +922,7 @@ void PoolManager::LoadFromDB()
count = 0;
if( !result )
{
barGoLink bar2(1);
BarGoLink bar2(1);
bar2.step();
sLog.outString();
@ -931,7 +931,7 @@ void PoolManager::LoadFromDB()
else
{
barGoLink bar2( (int)result->GetRowCount() );
BarGoLink bar2(result->GetRowCount());
do
{
Field *fields = result->Fetch();

View file

@ -92,7 +92,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename)
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -100,7 +100,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename)
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -804,7 +804,7 @@ void ScriptMgr::LoadAreaTriggerScripts()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -812,7 +812,7 @@ void ScriptMgr::LoadAreaTriggerScripts()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -848,7 +848,7 @@ void ScriptMgr::LoadEventIdScripts()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -856,7 +856,7 @@ void ScriptMgr::LoadEventIdScripts()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
// TODO: remove duplicate code below, same way to collect event id's used in LoadEventScripts()
std::set<uint32> evt_scripts;
@ -959,14 +959,14 @@ void ScriptMgr::LoadScriptNames()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outErrorDb(">> Loaded empty set of Script Names!");
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
uint32 count = 0;
do

View file

@ -62,7 +62,7 @@ void LoadSkillDiscoveryTable()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
std::ostringstream ssNonDiscoverableEntries;
std::set<uint32> reportedReqSpells;

View file

@ -61,7 +61,7 @@ void LoadSkillExtraItemTable()
if (result)
{
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -996,7 +996,7 @@ void SpellMgr::LoadSpellTargetPositions()
QueryResult *result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position");
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -1005,7 +1005,7 @@ void SpellMgr::LoadSpellTargetPositions()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -1276,7 +1276,7 @@ void SpellMgr::LoadSpellProcEvents()
QueryResult *result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMaskA0, SpellFamilyMaskA1, SpellFamilyMaskA2, SpellFamilyMaskB0, SpellFamilyMaskB1, SpellFamilyMaskB2, SpellFamilyMaskC0, SpellFamilyMaskC1, SpellFamilyMaskC2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> No spell proc event conditions loaded");
@ -1285,7 +1285,7 @@ void SpellMgr::LoadSpellProcEvents()
SpellRankHelper<SpellProcEventEntry, DoSpellProcEvent, SpellProcEventMap> rankHelper(*this, mSpellProcEventMap);
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -1342,7 +1342,7 @@ void SpellMgr::LoadSpellProcItemEnchant()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -1351,7 +1351,7 @@ void SpellMgr::LoadSpellProcItemEnchant()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -1411,14 +1411,14 @@ void SpellMgr::LoadSpellBonuses()
QueryResult *result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> Loaded %u spell bonus data", count);
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@ -1631,7 +1631,7 @@ void SpellMgr::LoadSpellElixirs()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -1640,7 +1640,7 @@ void SpellMgr::LoadSpellElixirs()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -1732,7 +1732,7 @@ void SpellMgr::LoadSpellThreats()
QueryResult *result = WorldDatabase.Query("SELECT entry, Threat, multiplier, ap_bonus FROM spell_threat");
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString(">> No spell threat entries loaded.");
@ -1741,7 +1741,7 @@ void SpellMgr::LoadSpellThreats()
SpellRankHelper<SpellThreatEntry, DoSpellThreat, SpellThreatMap> rankHelper(*this, mSpellThreatMap);
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -2716,7 +2716,7 @@ void SpellMgr::LoadSpellChains()
QueryResult *result = WorldDatabase.Query("SELECT spell_id, prev_spell, first_spell, rank, req_spell FROM spell_chain");
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -2729,7 +2729,7 @@ void SpellMgr::LoadSpellChains()
uint32 new_count = 0;
uint32 req_count = 0;
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
bar.step();
@ -2973,7 +2973,7 @@ void SpellMgr::LoadSpellLearnSkills()
// search auto-learned skills and add its to map also for use in unlearn spells/talents
uint32 dbc_count = 0;
barGoLink bar( sSpellStore.GetNumRows() );
BarGoLink bar(sSpellStore.GetNumRows());
for (uint32 spell = 0; spell < sSpellStore.GetNumRows(); ++spell)
{
bar.step();
@ -3014,7 +3014,7 @@ void SpellMgr::LoadSpellLearnSpells()
QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -3025,7 +3025,7 @@ void SpellMgr::LoadSpellLearnSpells()
uint32 count = 0;
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
bar.step();
@ -3126,7 +3126,7 @@ void SpellMgr::LoadSpellScriptTarget()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
@ -3135,7 +3135,7 @@ void SpellMgr::LoadSpellScriptTarget()
return;
}
barGoLink bar((int)result->GetRowCount());
BarGoLink bar(result->GetRowCount());
do
{
@ -3270,7 +3270,7 @@ void SpellMgr::LoadSpellPetAuras()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -3279,7 +3279,7 @@ void SpellMgr::LoadSpellPetAuras()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -3614,7 +3614,7 @@ void SpellMgr::LoadSpellAreas()
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -3623,7 +3623,7 @@ void SpellMgr::LoadSpellAreas()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{
@ -3949,7 +3949,7 @@ void SpellMgr::LoadSkillLineAbilityMap()
{
mSkillLineAbilityMap.clear();
barGoLink bar( (int)sSkillLineAbilityStore.GetNumRows() );
BarGoLink bar(sSkillLineAbilityStore.GetNumRows());
uint32 count = 0;
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
@ -3971,7 +3971,7 @@ void SpellMgr::LoadSkillRaceClassInfoMap()
{
mSkillRaceClassInfoMap.clear();
barGoLink bar( (int)sSkillRaceClassInfoStore.GetNumRows() );
BarGoLink bar(sSkillRaceClassInfoStore.GetNumRows());
uint32 count = 0;
for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i)
@ -4004,7 +4004,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
if (!result)
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
@ -4013,7 +4013,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -37,7 +37,7 @@ void MapManager::LoadTransports()
if( !result )
{
barGoLink bar( 1 );
BarGoLink bar(1);
bar.step();
sLog.outString();
@ -45,7 +45,7 @@ void MapManager::LoadTransports()
return;
}
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -67,7 +67,7 @@ void WaypointManager::Load()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString( ">> Loaded 0 paths. DB table `creature_movement` is empty." );
@ -75,7 +75,7 @@ void WaypointManager::Load()
else
{
total_paths = (uint32)result->GetRowCount();
barGoLink bar( total_paths );
BarGoLink bar(total_paths);
do
{
@ -100,7 +100,7 @@ void WaypointManager::Load()
// 7 8 9 10 11 12 13 14 15 16
"textid1, textid2, textid3, textid4, textid5, emote, spell, orientation, model1, model2 FROM creature_movement");
barGoLink barRow((int)result->GetRowCount());
BarGoLink barRow((int)result->GetRowCount());
// error after load, we check if creature guid corresponding to the path id has proper MovementType
std::set<uint32> creatureNoMoveType;
@ -243,7 +243,7 @@ void WaypointManager::Load()
if (!result)
{
barGoLink bar(1);
BarGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString( ">> Loaded 0 path templates. DB table `creature_movement_template` is empty." );
@ -253,7 +253,7 @@ void WaypointManager::Load()
total_nodes = 0;
total_behaviors = 0;
total_paths = (uint32)result->GetRowCount();
barGoLink barRow(total_paths);
BarGoLink barRow(total_paths);
do
{
@ -278,7 +278,7 @@ void WaypointManager::Load()
// 7 8 9 10 11 12 13 14 15 16
"textid1, textid2, textid3, textid4, textid5, emote, spell, orientation, model1, model2 FROM creature_movement_template");
barGoLink bar( (int)result->GetRowCount() );
BarGoLink bar(result->GetRowCount());
do
{

View file

@ -200,7 +200,7 @@ extern int main(int argc, char **argv)
DETAIL_LOG("Using ACE: %s", ACE_VERSION);
///- Set progress bars show mode
barGoLink::SetOutputState(sConfig.GetBoolDefault("ShowProgressBars", true));
BarGoLink::SetOutputState(sConfig.GetBoolDefault("ShowProgressBars", true));
///- and run the 'Master'
/// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd?

View file

@ -224,7 +224,7 @@ void SQLStorageLoaderBase<T>::Load(SQLStorage &store, bool error_at_empty /*= tr
char * _data= new char[store.RecordCount *recordsize];
uint32 count = 0;
barGoLink bar( store.RecordCount );
BarGoLink bar(store.RecordCount);
do
{
fields = result->Fetch();

View file

@ -860,7 +860,7 @@ void Log::WaitBeforeContinueIfNeed()
else if (mode > 0)
{
printf("\nWait %u secs for continue.\n",mode);
barGoLink bar(mode);
BarGoLink bar(mode);
for(int i = 0; i < mode; ++i)
{
bar.step();

View file

@ -19,17 +19,35 @@
#include <stdio.h>
#include "ProgressBar.h"
#include "Errors.h"
bool barGoLink::m_showOutput = true;
bool BarGoLink::m_showOutput = true;
char const* const barGoLink::empty = " ";
char const* const BarGoLink::empty = " ";
#ifdef _WIN32
char const* const barGoLink::full = "\x3D";
char const* const BarGoLink::full = "\x3D";
#else
char const* const barGoLink::full = "*";
char const* const BarGoLink::full = "*";
#endif
barGoLink::~barGoLink()
BarGoLink::BarGoLink(int row_count)
{
init(row_count);
}
BarGoLink::BarGoLink(uint32 row_count)
{
MANGOS_ASSERT(row_count < (uint32)ACE_INT32_MAX);
init((int)row_count);
}
BarGoLink::BarGoLink(uint64 row_count)
{
MANGOS_ASSERT(row_count < (uint64)ACE_INT32_MAX);
init((int)row_count);
}
BarGoLink::~BarGoLink()
{
if (!m_showOutput)
return;
@ -38,7 +56,7 @@ barGoLink::~barGoLink()
fflush(stdout);
}
barGoLink::barGoLink(int row_count)
void BarGoLink::init(int row_count)
{
rec_no = 0;
rec_pos = 0;
@ -62,7 +80,7 @@ barGoLink::barGoLink(int row_count)
fflush(stdout);
}
void barGoLink::step()
void BarGoLink::step()
{
if (!m_showOutput)
return;
@ -94,7 +112,7 @@ void barGoLink::step()
}
// avoid use inline version because linking problems with private static field
void barGoLink::SetOutputState(bool on)
void BarGoLink::SetOutputState(bool on)
{
m_showOutput = on;
}

View file

@ -20,17 +20,21 @@
#include "Platform/Define.h"
class MANGOS_DLL_SPEC barGoLink
class MANGOS_DLL_SPEC BarGoLink
{
public: // constructors
barGoLink(int row_count);
~barGoLink();
explicit BarGoLink(int row_count);
explicit BarGoLink(uint32 row_count); // row_count < ACE_INT32_MAX
explicit BarGoLink(uint64 row_count); // row_count < ACE_INT32_MAX
~BarGoLink();
public: // modifiers
void step( void );
void step();
static void SetOutputState(bool on);
private:
void init(int row_count);
static bool m_showOutput; // not recommended change with existed active bar
static char const * const empty;
static char const * const full;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11589"
#define REVISION_NR "11590"
#endif // __REVISION_NR_H__