[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

@ -2215,9 +2215,9 @@ AchievementCriteriaEntryList const& AchievementGlobalMgr::GetAchievementCriteria
void AchievementGlobalMgr::LoadAchievementCriteriaList() void AchievementGlobalMgr::LoadAchievementCriteriaList()
{ {
if(sAchievementCriteriaStore.GetNumRows()==0) if (sAchievementCriteriaStore.GetNumRows()==0)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -2225,7 +2225,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
return; return;
} }
barGoLink bar( sAchievementCriteriaStore.GetNumRows() ); BarGoLink bar(sAchievementCriteriaStore.GetNumRows());
for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId) for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId)
{ {
bar.step(); bar.step();
@ -2248,7 +2248,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
{ {
if(sAchievementStore.GetNumRows()==0) if(sAchievementStore.GetNumRows()==0)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -2257,13 +2257,13 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
} }
uint32 count = 0; uint32 count = 0;
barGoLink bar( sAchievementStore.GetNumRows() ); BarGoLink bar(sAchievementStore.GetNumRows());
for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId) for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId)
{ {
bar.step(); bar.step();
AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId); AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId);
if(!achievement || !achievement->refAchievement) if (!achievement || !achievement->refAchievement)
continue; continue;
m_AchievementListByReferencedId[achievement->refAchievement].push_back(achievement); m_AchievementListByReferencedId[achievement->refAchievement].push_back(achievement);
@ -2271,7 +2271,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
} }
sLog.outString(); sLog.outString();
sLog.outString(">> Loaded %u achievement references.",count); sLog.outString(">> Loaded %u achievement references.", count);
} }
void AchievementGlobalMgr::LoadAchievementCriteriaRequirements() void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
@ -2280,9 +2280,9 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
QueryResult *result = WorldDatabase.Query("SELECT criteria_id, type, value1, value2 FROM achievement_criteria_requirement"); QueryResult *result = WorldDatabase.Query("SELECT criteria_id, type, value1, value2 FROM achievement_criteria_requirement");
if(!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -2292,7 +2292,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
uint32 count = 0; uint32 count = 0;
uint32 disabled_count = 0; uint32 disabled_count = 0;
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
bar.step(); bar.step();
@ -2409,9 +2409,9 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
{ {
QueryResult *result = CharacterDatabase.Query("SELECT achievement FROM character_achievement GROUP BY achievement"); QueryResult *result = CharacterDatabase.Query("SELECT achievement FROM character_achievement GROUP BY achievement");
if(!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -2419,14 +2419,14 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
bar.step(); bar.step();
Field *fields = result->Fetch(); Field *fields = result->Fetch();
uint32 achievement_id = fields[0].GetUInt32(); uint32 achievement_id = fields[0].GetUInt32();
if(!sAchievementStore.LookupEntry(achievement_id)) if (!sAchievementStore.LookupEntry(achievement_id))
{ {
// we will remove nonexistent achievement for all characters // we will remove nonexistent achievement for all characters
sLog.outError("Nonexistent achievement %u data removed from table `character_achievement`.",achievement_id); sLog.outError("Nonexistent achievement %u data removed from table `character_achievement`.",achievement_id);
@ -2450,9 +2450,9 @@ void AchievementGlobalMgr::LoadRewards()
// 0 1 2 3 4 5 6 7 // 0 1 2 3 4 5 6 7
QueryResult *result = WorldDatabase.Query("SELECT entry, gender, title_A, title_H, item, sender, subject, text FROM achievement_reward"); QueryResult *result = WorldDatabase.Query("SELECT entry, gender, title_A, title_H, item, sender, subject, text FROM achievement_reward");
if(!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
@ -2462,7 +2462,7 @@ void AchievementGlobalMgr::LoadRewards()
} }
uint32 count = 0; uint32 count = 0;
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -2581,9 +2581,9 @@ void AchievementGlobalMgr::LoadRewardLocales()
QueryResult *result = WorldDatabase.Query("SELECT entry,gender,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4,subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8 FROM locales_achievement_reward"); QueryResult *result = WorldDatabase.Query("SELECT entry,gender,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4,subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8 FROM locales_achievement_reward");
if(!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
@ -2592,7 +2592,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -2601,7 +2601,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
uint32 entry = fields[0].GetUInt32(); uint32 entry = fields[0].GetUInt32();
if(m_achievementRewards.find(entry)==m_achievementRewards.end()) if (m_achievementRewards.find(entry)==m_achievementRewards.end())
{ {
sLog.outErrorDb( "Table `locales_achievement_reward` (Entry: %u) has locale strings for nonexistent achievement reward .", entry); sLog.outErrorDb( "Table `locales_achievement_reward` (Entry: %u) has locale strings for nonexistent achievement reward .", entry);
continue; continue;

View file

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

View file

@ -1612,7 +1612,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
@ -1621,7 +1621,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -2025,15 +2025,15 @@ void BattleGroundMgr::LoadBattleMastersEntry()
if (!result) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded 0 battlemaster entries - table is empty!" ); sLog.outString(">> Loaded 0 battlemaster entries - table is empty!");
return; return;
} }
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -2046,13 +2046,13 @@ void BattleGroundMgr::LoadBattleMastersEntry()
uint32 bgTypeId = fields[1].GetUInt32(); uint32 bgTypeId = fields[1].GetUInt32();
if (!sBattlemasterListStore.LookupEntry(bgTypeId)) if (!sBattlemasterListStore.LookupEntry(bgTypeId))
{ {
sLog.outErrorDb("Table `battlemaster_entry` contain entry %u for nonexistent battleground type %u, ignored.",entry,bgTypeId); sLog.outErrorDb("Table `battlemaster_entry` contain entry %u for nonexistent battleground type %u, ignored.", entry, bgTypeId);
continue; continue;
} }
mBattleMastersMap[entry] = BattleGroundTypeId(bgTypeId); mBattleMastersMap[entry] = BattleGroundTypeId(bgTypeId);
} while( result->NextRow() ); } while(result->NextRow());
delete result; delete result;
@ -2135,9 +2135,9 @@ void BattleGroundMgr::LoadBattleEventIndexes()
"LEFT OUTER JOIN battleground_events AS description ON data.map = description.map " "LEFT OUTER JOIN battleground_events AS description ON data.map = description.map "
"AND data.ev1 = description.event1 AND data.ev2 = description.event2 " "AND data.ev1 = description.event1 AND data.ev2 = description.event2 "
"ORDER BY m, ev1, ev2" ); "ORDER BY m, ev1, ev2" );
if(!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -2145,7 +2145,7 @@ void BattleGroundMgr::LoadBattleEventIndexes()
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {

View file

@ -61,7 +61,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
bool found = false; bool found = false;
std::ostringstream ss; std::ostringstream ss;
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
bar.step(); bar.step();
@ -70,9 +70,9 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
uint32 id = fields[0].GetUInt32(); uint32 id = fields[0].GetUInt32();
if(!check(id)) if (!check(id))
{ {
if(!found) if (!found)
{ {
ss << "DELETE FROM " << table << " WHERE " << column << " IN ("; ss << "DELETE FROM " << table << " WHERE " << column << " IN (";
found = true; found = true;
@ -82,7 +82,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
ss << id; ss << id;
} }
} }
while( result->NextRow() ); while (result->NextRow());
delete result; delete result;
if (found) if (found)

View file

@ -44,7 +44,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
sLog.outString("Loading EventAI Texts additional data..."); sLog.outString("Loading EventAI Texts additional data...");
if (result) if (result)
{ {
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
uint32 count = 0; uint32 count = 0;
do do
@ -105,7 +105,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
} }
else else
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty."); 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"); QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons");
if (result) if (result)
{ {
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
uint32 Count = 0; uint32 Count = 0;
do do
@ -176,7 +176,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use)
temp.orientation = fields[4].GetFloat(); temp.orientation = fields[4].GetFloat();
temp.SpawnTimeSecs = fields[5].GetUInt32(); temp.SpawnTimeSecs = fields[5].GetUInt32();
if(!MaNGOS::IsValidMapCoord(temp.position_x,temp.position_y,temp.position_z,temp.orientation)) if (!MaNGOS::IsValidMapCoord(temp.position_x,temp.position_y,temp.position_z,temp.orientation))
{ {
sLog.outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f,%f,%f,%f), skipping.", i,temp.position_x,temp.position_y,temp.position_z,temp.orientation); sLog.outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f,%f,%f,%f), skipping.", i,temp.position_x,temp.position_y,temp.position_z,temp.orientation);
continue; continue;
@ -196,7 +196,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use)
sLog.outString(">> Loaded %u CreatureEventAI summon definitions", Count); sLog.outString(">> Loaded %u CreatureEventAI summon definitions", Count);
}else }else
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty."); 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"); "FROM creature_ai_scripts");
if (result) if (result)
{ {
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
uint32 Count = 0; uint32 Count = 0;
do do
@ -822,7 +822,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
sLog.outString(">> Loaded %u CreatureEventAI scripts", Count); sLog.outString(">> Loaded %u CreatureEventAI scripts", Count);
}else }else
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty."); sLog.outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");

View file

@ -283,7 +283,7 @@ struct LocalData
}; };
template<class T> 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 // compatibility format and C++ structure sizes
MANGOS_ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename)); 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; const uint32 DBCFilesCount = 92;
barGoLink bar( (int)DBCFilesCount ); BarGoLink bar(DBCFilesCount);
StoreProblemList bad_dbc_files; StoreProblemList bad_dbc_files;
@ -373,9 +373,9 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaStore, dbcPath,"AreaTable.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaStore, dbcPath,"AreaTable.dbc");
// must be after sAreaStore loading // must be after sAreaStore loading
for(uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0 for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0
{ {
if(AreaTableEntry const* area = sAreaStore.LookupEntry(i)) if (AreaTableEntry const* area = sAreaStore.LookupEntry(i))
{ {
// fill AreaId->DBC records // fill AreaId->DBC records
sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID),area->exploreFlag)); sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID),area->exploreFlag));

View file

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

View file

@ -110,7 +110,7 @@ void GameEventMgr::LoadFromDB()
} }
QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description FROM game_event"); QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description FROM game_event");
if( !result ) if (!result)
{ {
mGameEvent.clear(); mGameEvent.clear();
sLog.outString(">> Table game_event is empty!"); sLog.outString(">> Table game_event is empty!");
@ -121,7 +121,7 @@ void GameEventMgr::LoadFromDB()
uint32 count = 0; uint32 count = 0;
{ {
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
++count; ++count;
@ -183,9 +183,9 @@ void GameEventMgr::LoadFromDB()
"FROM creature JOIN game_event_creature ON creature.guid = game_event_creature.guid"); "FROM creature JOIN game_event_creature ON creature.guid = game_event_creature.guid");
count = 0; count = 0;
if( !result ) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -194,7 +194,7 @@ void GameEventMgr::LoadFromDB()
else else
{ {
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@ -261,9 +261,9 @@ void GameEventMgr::LoadFromDB()
"FROM gameobject JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid"); "FROM gameobject JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid");
count = 0; count = 0;
if( !result ) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -272,7 +272,7 @@ void GameEventMgr::LoadFromDB()
else else
{ {
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@ -352,9 +352,9 @@ void GameEventMgr::LoadFromDB()
"FROM creature JOIN game_event_creature_data ON creature.guid=game_event_creature_data.guid"); "FROM creature JOIN game_event_creature_data ON creature.guid=game_event_creature_data.guid");
count = 0; count = 0;
if( !result ) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -363,7 +363,7 @@ void GameEventMgr::LoadFromDB()
else else
{ {
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@ -432,9 +432,9 @@ void GameEventMgr::LoadFromDB()
result = WorldDatabase.Query("SELECT quest, event FROM game_event_quest"); result = WorldDatabase.Query("SELECT quest, event FROM game_event_quest");
count = 0; count = 0;
if( !result ) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -443,7 +443,7 @@ void GameEventMgr::LoadFromDB()
else else
{ {
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@ -494,7 +494,7 @@ void GameEventMgr::LoadFromDB()
count = 0; count = 0;
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -503,7 +503,7 @@ void GameEventMgr::LoadFromDB()
else else
{ {
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();

View file

@ -95,7 +95,7 @@ void GuildMgr::LoadGuilds()
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
@ -123,7 +123,7 @@ void GuildMgr::LoadGuilds()
// 0 1 2 3 4 // 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"); 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 do
{ {

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

@ -92,7 +92,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename)
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -100,7 +100,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename)
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -804,7 +804,7 @@ void ScriptMgr::LoadAreaTriggerScripts()
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -812,7 +812,7 @@ void ScriptMgr::LoadAreaTriggerScripts()
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -848,7 +848,7 @@ void ScriptMgr::LoadEventIdScripts()
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
@ -856,13 +856,13 @@ void ScriptMgr::LoadEventIdScripts()
return; 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() // TODO: remove duplicate code below, same way to collect event id's used in LoadEventScripts()
std::set<uint32> evt_scripts; std::set<uint32> evt_scripts;
// Load all possible event entries from gameobjects // Load all possible event entries from gameobjects
for(uint32 i = 1; i < sGOStorage.MaxEntry; ++i) for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i)
{ {
if (GameObjectInfo const* goInfo = sGOStorage.LookupEntry<GameObjectInfo>(i)) if (GameObjectInfo const* goInfo = sGOStorage.LookupEntry<GameObjectInfo>(i))
{ {
@ -959,14 +959,14 @@ void ScriptMgr::LoadScriptNames()
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outErrorDb(">> Loaded empty set of Script Names!"); sLog.outErrorDb(">> Loaded empty set of Script Names!");
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
uint32 count = 0; uint32 count = 0;
do do
@ -979,7 +979,7 @@ void ScriptMgr::LoadScriptNames()
std::sort(m_scriptNames.begin(), m_scriptNames.end()); std::sort(m_scriptNames.begin(), m_scriptNames.end());
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %d Script Names", count ); sLog.outString(">> Loaded %d Script Names", count);
} }
uint32 ScriptMgr::GetScriptId(const char *name) const uint32 ScriptMgr::GetScriptId(const char *name) const

View file

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

View file

@ -61,7 +61,7 @@ void LoadSkillExtraItemTable()
if (result) if (result)
{ {
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -70,28 +70,28 @@ void LoadSkillExtraItemTable()
uint32 spellId = fields[0].GetUInt32(); uint32 spellId = fields[0].GetUInt32();
if(!sSpellStore.LookupEntry(spellId)) if (!sSpellStore.LookupEntry(spellId))
{ {
sLog.outError("Skill specialization %u has nonexistent spell id in `skill_extra_item_template`!", spellId); sLog.outError("Skill specialization %u has nonexistent spell id in `skill_extra_item_template`!", spellId);
continue; continue;
} }
uint32 requiredSpecialization = fields[1].GetUInt32(); uint32 requiredSpecialization = fields[1].GetUInt32();
if(!sSpellStore.LookupEntry(requiredSpecialization)) if (!sSpellStore.LookupEntry(requiredSpecialization))
{ {
sLog.outError("Skill specialization %u have nonexistent required specialization spell id %u in `skill_extra_item_template`!", spellId,requiredSpecialization); sLog.outError("Skill specialization %u have nonexistent required specialization spell id %u in `skill_extra_item_template`!", spellId,requiredSpecialization);
continue; continue;
} }
float additionalCreateChance = fields[2].GetFloat(); float additionalCreateChance = fields[2].GetFloat();
if(additionalCreateChance <= 0.0f) if (additionalCreateChance <= 0.0f)
{ {
sLog.outError("Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId); sLog.outError("Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
continue; continue;
} }
uint8 additionalMaxNum = fields[3].GetUInt8(); uint8 additionalMaxNum = fields[3].GetUInt8();
if(!additionalMaxNum) if (!additionalMaxNum)
{ {
sLog.outError("Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId); sLog.outError("Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
continue; continue;
@ -109,7 +109,7 @@ void LoadSkillExtraItemTable()
delete result; delete result;
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u spell specialization definitions", count ); sLog.outString(">> Loaded %u spell specialization definitions", count);
} }
else else
{ {

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"); 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) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
@ -1005,7 +1005,7 @@ void SpellMgr::LoadSpellTargetPositions()
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -1274,18 +1274,18 @@ void SpellMgr::LoadSpellProcEvents()
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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"); 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 ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> No spell proc event conditions loaded"); sLog.outString(">> No spell proc event conditions loaded");
return; return;
} }
SpellRankHelper<SpellProcEventEntry, DoSpellProcEvent, SpellProcEventMap> rankHelper(*this, mSpellProcEventMap); SpellRankHelper<SpellProcEventEntry, DoSpellProcEvent, SpellProcEventMap> rankHelper(*this, mSpellProcEventMap);
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@ -1339,19 +1339,19 @@ void SpellMgr::LoadSpellProcItemEnchant()
// 0 1 // 0 1
QueryResult *result = WorldDatabase.Query("SELECT entry, ppmRate FROM spell_proc_item_enchant"); QueryResult *result = WorldDatabase.Query("SELECT entry, ppmRate FROM spell_proc_item_enchant");
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u proc item enchant definitions", count ); sLog.outString(">> Loaded %u proc item enchant definitions", count);
return; return;
} }
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -1409,16 +1409,16 @@ void SpellMgr::LoadSpellBonuses()
uint32 count = 0; uint32 count = 0;
// 0 1 2 3 // 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data"); QueryResult *result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u spell bonus data", count); sLog.outString(">> Loaded %u spell bonus data", count);
return; return;
} }
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
@ -1628,19 +1628,19 @@ void SpellMgr::LoadSpellElixirs()
// 0 1 // 0 1
QueryResult *result = WorldDatabase.Query("SELECT entry, mask FROM spell_elixir"); QueryResult *result = WorldDatabase.Query("SELECT entry, mask FROM spell_elixir");
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u spell elixir definitions", count ); sLog.outString(">> Loaded %u spell elixir definitions", count);
return; return;
} }
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -1730,18 +1730,18 @@ void SpellMgr::LoadSpellThreats()
// 0 1 2 3 // 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT entry, Threat, multiplier, ap_bonus FROM spell_threat"); QueryResult *result = WorldDatabase.Query("SELECT entry, Threat, multiplier, ap_bonus FROM spell_threat");
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> No spell threat entries loaded."); sLog.outString(">> No spell threat entries loaded.");
return; return;
} }
SpellRankHelper<SpellThreatEntry, DoSpellThreat, SpellThreatMap> rankHelper(*this, mSpellThreatMap); SpellRankHelper<SpellThreatEntry, DoSpellThreat, SpellThreatMap> rankHelper(*this, mSpellThreatMap);
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -2716,11 +2716,11 @@ void SpellMgr::LoadSpellChains()
QueryResult *result = WorldDatabase.Query("SELECT spell_id, prev_spell, first_spell, rank, req_spell FROM spell_chain"); QueryResult *result = WorldDatabase.Query("SELECT spell_id, prev_spell, first_spell, rank, req_spell FROM spell_chain");
if (!result) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded 0 spell chain records" ); sLog.outString(">> Loaded 0 spell chain records");
sLog.outErrorDb("`spell_chains` table is empty!"); sLog.outErrorDb("`spell_chains` table is empty!");
return; return;
} }
@ -2729,7 +2729,7 @@ void SpellMgr::LoadSpellChains()
uint32 new_count = 0; uint32 new_count = 0;
uint32 req_count = 0; uint32 req_count = 0;
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
bar.step(); bar.step();
@ -2973,23 +2973,23 @@ void SpellMgr::LoadSpellLearnSkills()
// search auto-learned skills and add its to map also for use in unlearn spells/talents // search auto-learned skills and add its to map also for use in unlearn spells/talents
uint32 dbc_count = 0; uint32 dbc_count = 0;
barGoLink bar( sSpellStore.GetNumRows() ); BarGoLink bar(sSpellStore.GetNumRows());
for(uint32 spell = 0; spell < sSpellStore.GetNumRows(); ++spell) for (uint32 spell = 0; spell < sSpellStore.GetNumRows(); ++spell)
{ {
bar.step(); bar.step();
SpellEntry const* entry = sSpellStore.LookupEntry(spell); SpellEntry const* entry = sSpellStore.LookupEntry(spell);
if(!entry) if (!entry)
continue; continue;
for(int i = 0; i < MAX_EFFECT_INDEX; ++i) for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{ {
if(entry->Effect[i] == SPELL_EFFECT_SKILL) if (entry->Effect[i] == SPELL_EFFECT_SKILL)
{ {
SpellLearnSkillNode dbc_node; SpellLearnSkillNode dbc_node;
dbc_node.skill = entry->EffectMiscValue[i]; dbc_node.skill = entry->EffectMiscValue[i];
dbc_node.step = entry->CalculateSimpleValue(SpellEffectIndex(i)); dbc_node.step = entry->CalculateSimpleValue(SpellEffectIndex(i));
if ( dbc_node.skill != SKILL_RIDING ) if (dbc_node.skill != SKILL_RIDING)
dbc_node.value = 1; dbc_node.value = 1;
else else
dbc_node.value = dbc_node.step * 75; dbc_node.value = dbc_node.step * 75;
@ -3003,7 +3003,7 @@ void SpellMgr::LoadSpellLearnSkills()
} }
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u Spell Learn Skills from DBC", dbc_count ); sLog.outString(">> Loaded %u Spell Learn Skills from DBC", dbc_count);
} }
void SpellMgr::LoadSpellLearnSpells() void SpellMgr::LoadSpellLearnSpells()
@ -3014,18 +3014,18 @@ void SpellMgr::LoadSpellLearnSpells()
QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell"); QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
if (!result) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded 0 spell learn spells" ); sLog.outString(">> Loaded 0 spell learn spells");
sLog.outErrorDb("`spell_learn_spell` table is empty!"); sLog.outErrorDb("`spell_learn_spell` table is empty!");
return; return;
} }
uint32 count = 0; uint32 count = 0;
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
bar.step(); bar.step();
@ -3059,7 +3059,7 @@ void SpellMgr::LoadSpellLearnSpells()
mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell_id,node)); mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell_id,node));
++count; ++count;
} while( result->NextRow() ); } while (result->NextRow());
delete result; delete result;
@ -3126,7 +3126,7 @@ void SpellMgr::LoadSpellScriptTarget()
if (!result) if (!result)
{ {
barGoLink bar(1); BarGoLink bar(1);
bar.step(); bar.step();
@ -3135,7 +3135,7 @@ void SpellMgr::LoadSpellScriptTarget()
return; return;
} }
barGoLink bar((int)result->GetRowCount()); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -3267,19 +3267,19 @@ void SpellMgr::LoadSpellPetAuras()
// 0 1 2 3 // 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras"); QueryResult *result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u spell pet auras", count ); sLog.outString(">> Loaded %u spell pet auras", count);
return; return;
} }
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -3612,18 +3612,18 @@ void SpellMgr::LoadSpellAreas()
// 0 1 2 3 4 5 6 7 8 // 0 1 2 3 4 5 6 7 8
QueryResult *result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area"); QueryResult *result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u spell area requirements", count ); sLog.outString(">> Loaded %u spell area requirements", count);
return; return;
} }
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {
@ -3643,7 +3643,7 @@ void SpellMgr::LoadSpellAreas()
spellArea.gender = Gender(fields[7].GetUInt8()); spellArea.gender = Gender(fields[7].GetUInt8());
spellArea.autocast = fields[8].GetBool(); spellArea.autocast = fields[8].GetBool();
if(!sSpellStore.LookupEntry(spell)) if (!sSpellStore.LookupEntry(spell))
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` does not exist", spell); sLog.outErrorDb("Spell %u listed in `spell_area` does not exist", spell);
continue; continue;
@ -3652,7 +3652,7 @@ void SpellMgr::LoadSpellAreas()
{ {
bool ok = true; bool ok = true;
SpellAreaMapBounds sa_bounds = GetSpellAreaMapBounds(spellArea.spellId); SpellAreaMapBounds sa_bounds = GetSpellAreaMapBounds(spellArea.spellId);
for(SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr) for (SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr)
{ {
if (spellArea.spellId != itr->second.spellId) if (spellArea.spellId != itr->second.spellId)
continue; continue;
@ -3672,7 +3672,7 @@ void SpellMgr::LoadSpellAreas()
break; break;
} }
if(!ok) if (!ok)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell); sLog.outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell);
continue; continue;
@ -3680,43 +3680,43 @@ void SpellMgr::LoadSpellAreas()
} }
if(spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId)) if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell,spellArea.areaId); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell,spellArea.areaId);
continue; continue;
} }
if(spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart)) if (spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart))
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart);
continue; continue;
} }
if(spellArea.questEnd) if (spellArea.questEnd)
{ {
if(!sObjectMgr.GetQuestTemplate(spellArea.questEnd)) if (!sObjectMgr.GetQuestTemplate(spellArea.questEnd))
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd);
continue; continue;
} }
if(spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive) if (spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd); sLog.outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd);
continue; continue;
} }
} }
if(spellArea.auraSpell) if (spellArea.auraSpell)
{ {
SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(spellArea.auraSpell)); SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(spellArea.auraSpell));
if(!spellInfo) if (!spellInfo)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell,abs(spellArea.auraSpell)); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell,abs(spellArea.auraSpell));
continue; continue;
} }
switch(spellInfo->EffectApplyAuraName[EFFECT_INDEX_0]) switch (spellInfo->EffectApplyAuraName[EFFECT_INDEX_0])
{ {
case SPELL_AURA_DUMMY: case SPELL_AURA_DUMMY:
case SPELL_AURA_PHASE: case SPELL_AURA_PHASE:
@ -3727,7 +3727,7 @@ void SpellMgr::LoadSpellAreas()
continue; continue;
} }
if(uint32(abs(spellArea.auraSpell))==spellArea.spellId) if (uint32(abs(spellArea.auraSpell))==spellArea.spellId)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell)); sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
continue; continue;
@ -3738,7 +3738,7 @@ void SpellMgr::LoadSpellAreas()
{ {
bool chain = false; bool chain = false;
SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId); SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId);
for(SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr) for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
{ {
if (itr->second->autocast && itr->second->auraSpell > 0) if (itr->second->autocast && itr->second->auraSpell > 0)
{ {
@ -3754,7 +3754,7 @@ void SpellMgr::LoadSpellAreas()
} }
SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell); SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell);
for(SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2) for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
{ {
if (itr2->second.autocast && itr2->second.auraSpell > 0) if (itr2->second.autocast && itr2->second.auraSpell > 0)
{ {
@ -3763,7 +3763,7 @@ void SpellMgr::LoadSpellAreas()
} }
} }
if(chain) if (chain)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell); sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell);
continue; continue;
@ -3771,13 +3771,13 @@ void SpellMgr::LoadSpellAreas()
} }
} }
if(spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0) if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell,spellArea.raceMask); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell,spellArea.raceMask);
continue; continue;
} }
if(spellArea.gender!=GENDER_NONE && spellArea.gender!=GENDER_FEMALE && spellArea.gender!=GENDER_MALE) if (spellArea.gender!=GENDER_NONE && spellArea.gender!=GENDER_FEMALE && spellArea.gender!=GENDER_MALE)
{ {
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell,spellArea.gender); sLog.outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell,spellArea.gender);
continue; continue;
@ -3786,33 +3786,33 @@ void SpellMgr::LoadSpellAreas()
SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell,spellArea))->second; SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell,spellArea))->second;
// for search by current zone/subzone at zone/subzone change // for search by current zone/subzone at zone/subzone change
if(spellArea.areaId) if (spellArea.areaId)
mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId,sa)); mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId,sa));
// for search at quest start/reward // for search at quest start/reward
if(spellArea.questStart) if (spellArea.questStart)
{ {
if(spellArea.questStartCanActive) if (spellArea.questStartCanActive)
mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa)); mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa));
else else
mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa)); mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa));
} }
// for search at quest start/reward // for search at quest start/reward
if(spellArea.questEnd) if (spellArea.questEnd)
mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd,sa)); mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd,sa));
// for search at aura apply // for search at aura apply
if(spellArea.auraSpell) if (spellArea.auraSpell)
mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(abs(spellArea.auraSpell),sa)); mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(abs(spellArea.auraSpell),sa));
++count; ++count;
} while( result->NextRow() ); } while (result->NextRow());
delete result; delete result;
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u spell area requirements", count ); sLog.outString(">> Loaded %u spell area requirements", count);
} }
SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player) SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player)
@ -3949,7 +3949,7 @@ void SpellMgr::LoadSkillLineAbilityMap()
{ {
mSkillLineAbilityMap.clear(); mSkillLineAbilityMap.clear();
barGoLink bar( (int)sSkillLineAbilityStore.GetNumRows() ); BarGoLink bar(sSkillLineAbilityStore.GetNumRows());
uint32 count = 0; uint32 count = 0;
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i) for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
@ -3971,7 +3971,7 @@ void SpellMgr::LoadSkillRaceClassInfoMap()
{ {
mSkillRaceClassInfoMap.clear(); mSkillRaceClassInfoMap.clear();
barGoLink bar( (int)sSkillRaceClassInfoStore.GetNumRows() ); BarGoLink bar(sSkillRaceClassInfoStore.GetNumRows());
uint32 count = 0; uint32 count = 0;
for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i) for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i)
@ -4002,9 +4002,9 @@ void SpellMgr::CheckUsedSpells(char const* table)
// 0 1 2 3 4 5 6 7 8 9 10 11 // 0 1 2 3 4 5 6 7 8 9 10 11
QueryResult *result = WorldDatabase.PQuery("SELECT spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMaskB,SpellIcon,SpellVisual,SpellCategory,EffectType,EffectAura,EffectIdx,Name,Code FROM %s",table); QueryResult *result = WorldDatabase.PQuery("SELECT spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMaskB,SpellIcon,SpellVisual,SpellCategory,EffectType,EffectAura,EffectIdx,Name,Code FROM %s",table);
if( !result ) if (!result)
{ {
barGoLink bar( 1 ); BarGoLink bar(1);
bar.step(); bar.step();
@ -4013,7 +4013,7 @@ void SpellMgr::CheckUsedSpells(char const* table)
return; return;
} }
barGoLink bar( (int)result->GetRowCount() ); BarGoLink bar(result->GetRowCount());
do do
{ {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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