Replace some PQuery() calls with more simple Query()

This commit is contained in:
hunuza 2008-11-02 23:22:18 +01:00
parent 086dee05cd
commit fa37c291d6
8 changed files with 24 additions and 24 deletions

View file

@ -309,7 +309,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
bool have_same_race = false;
if(!AllowTwoSideAccounts || skipCinematics == 1)
{
QueryResult *result2 = CharacterDatabase.PQuery("SELECT DISTINCT race FROM characters WHERE account = '%u' %s", GetAccountId(),skipCinematics == 1 ? "" : "LIMIT 1");
QueryResult *result2 = CharacterDatabase.Query("SELECT DISTINCT race FROM characters WHERE account = '%u' %s", GetAccountId(),skipCinematics == 1 ? "" : "LIMIT 1");
if(result2)
{
uint32 team_= Player::TeamForRace(race_);

View file

@ -268,7 +268,7 @@ void InstanceSaveManager::CleanupInstances()
// creature_respawn and gameobject_respawn are in another database
// first, obtain total instance set
std::set< uint32 > InstanceSet;
QueryResult *result = CharacterDatabase.PQuery("SELECT id FROM instance");
QueryResult *result = CharacterDatabase.Query("SELECT id FROM instance");
if( result )
{
do
@ -281,7 +281,7 @@ void InstanceSaveManager::CleanupInstances()
}
// creature_respawn
result = WorldDatabase.PQuery("SELECT DISTINCT(instance) FROM creature_respawn WHERE instance <> 0");
result = WorldDatabase.Query("SELECT DISTINCT(instance) FROM creature_respawn WHERE instance <> 0");
if( result )
{
do
@ -295,7 +295,7 @@ void InstanceSaveManager::CleanupInstances()
}
// gameobject_respawn
result = WorldDatabase.PQuery("SELECT DISTINCT(instance) FROM gameobject_respawn WHERE instance <> 0");
result = WorldDatabase.Query("SELECT DISTINCT(instance) FROM gameobject_respawn WHERE instance <> 0");
if( result )
{
do
@ -324,7 +324,7 @@ void InstanceSaveManager::PackInstances()
// all valid ids are in the instance table
// any associations to ids not in this table are assumed to be
// cleaned already in CleanupInstances
QueryResult *result = CharacterDatabase.PQuery("SELECT id FROM instance");
QueryResult *result = CharacterDatabase.Query("SELECT id FROM instance");
if( result )
{
do
@ -374,7 +374,7 @@ void InstanceSaveManager::LoadResetTimes()
// resettime = 0 in the DB for raid/heroic instances so those are skipped
typedef std::map<uint32, std::pair<uint32, uint64> > ResetTimeMapType;
ResetTimeMapType InstResetTime;
QueryResult *result = CharacterDatabase.PQuery("SELECT id, map, resettime FROM instance WHERE resettime > 0");
QueryResult *result = CharacterDatabase.Query("SELECT id, map, resettime FROM instance WHERE resettime > 0");
if( result )
{
do
@ -390,7 +390,7 @@ void InstanceSaveManager::LoadResetTimes()
delete result;
// update reset time for normal instances with the max creature respawn time + X hours
result = WorldDatabase.PQuery("SELECT MAX(respawntime), instance FROM creature_respawn WHERE instance > 0 GROUP BY instance");
result = WorldDatabase.Query("SELECT MAX(respawntime), instance FROM creature_respawn WHERE instance > 0 GROUP BY instance");
if( result )
{
do

View file

@ -3399,7 +3399,7 @@ bool ChatHandler::HandleWpImportCommand(const char *args)
{
getline (infile,line);
//cout << line << endl;
QueryResult *result = WorldDatabase.PQuery(line.c_str());
QueryResult *result = WorldDatabase.Query(line.c_str());
delete result;
}
infile.close();

View file

@ -2630,7 +2630,7 @@ void ObjectMgr::LoadGroups()
uint64 leaderGuid = 0;
uint32 count = 0;
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
QueryResult *result = CharacterDatabase.PQuery("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, leaderGuid FROM groups");
QueryResult *result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, leaderGuid FROM groups");
if( !result )
{
@ -2672,7 +2672,7 @@ void ObjectMgr::LoadGroups()
group = NULL;
leaderGuid = 0;
// 0 1 2 3
result = CharacterDatabase.PQuery("SELECT memberGuid, assistant, subgroup, leaderGuid FROM group_member ORDER BY leaderGuid");
result = CharacterDatabase.Query("SELECT memberGuid, assistant, subgroup, leaderGuid FROM group_member ORDER BY leaderGuid");
if(!result)
{
barGoLink bar( 1 );
@ -2725,7 +2725,7 @@ void ObjectMgr::LoadGroups()
count = 0;
group = NULL;
leaderGuid = 0;
result = CharacterDatabase.PQuery(
result = CharacterDatabase.Query(
// 0 1 2 3 4 5
"SELECT leaderGuid, map, instance, permanent, difficulty, resettime, "
// 6
@ -3593,7 +3593,7 @@ void ObjectMgr::LoadQuestLocales()
void ObjectMgr::LoadPetCreateSpells()
{
QueryResult *result = WorldDatabase.PQuery("SELECT entry, Spell1, Spell2, Spell3, Spell4 FROM petcreateinfo_spell");
QueryResult *result = WorldDatabase.Query("SELECT entry, Spell1, Spell2, Spell3, Spell4 FROM petcreateinfo_spell");
if(!result)
{
barGoLink bar( 1 );
@ -3973,7 +3973,7 @@ void ObjectMgr::LoadEventScripts()
void ObjectMgr::LoadItemTexts()
{
QueryResult *result = CharacterDatabase.PQuery("SELECT id, text FROM item_text");
QueryResult *result = CharacterDatabase.Query("SELECT id, text FROM item_text");
uint32 count = 0;
@ -4056,7 +4056,7 @@ void ObjectMgr::LoadPageTextLocales()
{
mPageTextLocaleMap.clear(); // need for reload case
QueryResult *result = WorldDatabase.PQuery("SELECT entry,text_loc1,text_loc2,text_loc3,text_loc4,text_loc5,text_loc6,text_loc7,text_loc8 FROM locales_page_text");
QueryResult *result = WorldDatabase.Query("SELECT entry,text_loc1,text_loc2,text_loc3,text_loc4,text_loc5,text_loc6,text_loc7,text_loc8 FROM locales_page_text");
if(!result)
{
@ -5567,7 +5567,7 @@ void ObjectMgr::LoadCorpses()
{
uint32 count = 0;
// 0 1 2 3 4 5 6 7 8 10
QueryResult *result = CharacterDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map, data, time, corpse_type, instance, guid FROM corpse WHERE corpse_type <> 0");
QueryResult *result = CharacterDatabase.Query("SELECT position_x, position_y, position_z, orientation, map, data, time, corpse_type, instance, guid FROM corpse WHERE corpse_type <> 0");
if( !result )
{
@ -5931,7 +5931,7 @@ void ObjectMgr::LoadReservedPlayersNames()
{
m_ReservedNames.clear(); // need for reload case
QueryResult *result = WorldDatabase.PQuery("SELECT name FROM reserved_name");
QueryResult *result = WorldDatabase.Query("SELECT name FROM reserved_name");
uint32 count = 0;
@ -6771,7 +6771,7 @@ void ObjectMgr::LoadTrainerSpell()
std::set<uint32> skip_trainers;
QueryResult *result = WorldDatabase.PQuery("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer");
QueryResult *result = WorldDatabase.Query("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer");
if( !result )
{
@ -6862,7 +6862,7 @@ void ObjectMgr::LoadVendors()
std::set<uint32> skip_vendors;
QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor");
QueryResult *result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor");
if( !result )
{
barGoLink bar( 1 );
@ -6908,7 +6908,7 @@ void ObjectMgr::LoadNpcTextId()
m_mCacheNpcTextIdMap.clear();
QueryResult* result = WorldDatabase.PQuery("SELECT npc_guid, textid FROM npc_gossip");
QueryResult* result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip");
if( !result )
{
barGoLink bar( 1 );

View file

@ -52,7 +52,7 @@ void LoadSkillDiscoveryTable()
uint32 count = 0;
// 0 1 2
QueryResult *result = WorldDatabase.PQuery("SELECT spellId, reqSpell, chance FROM skill_discovery_template");
QueryResult *result = WorldDatabase.Query("SELECT spellId, reqSpell, chance FROM skill_discovery_template");
if (result)
{

View file

@ -57,7 +57,7 @@ void LoadSkillExtraItemTable()
SkillExtraItemStore.clear(); // need for reload
// 0 1 2 3
QueryResult *result = WorldDatabase.PQuery("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
QueryResult *result = WorldDatabase.Query("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
if (result)
{

View file

@ -1458,7 +1458,7 @@ void SpellMgr::LoadSpellChains()
mSpellChains.clear(); // need for reload case
mSpellChainsNext.clear(); // need for reload case
QueryResult *result = WorldDatabase.PQuery("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 == NULL)
{
barGoLink bar( 1 );
@ -1665,7 +1665,7 @@ void SpellMgr::LoadSpellLearnSpells()
{
mSpellLearnSpells.clear(); // need for reload case
QueryResult *result = WorldDatabase.PQuery("SELECT entry, SpellID FROM spell_learn_spell");
QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID FROM spell_learn_spell");
if(!result)
{
barGoLink bar( 1 );

View file

@ -114,7 +114,7 @@ void MapManager::LoadTransports()
sLog.outString( ">> Loaded %u transports", count );
// check transport data DB integrity
result = WorldDatabase.PQuery("SELECT gameobject.guid,gameobject.id,transports.name FROM gameobject,transports WHERE gameobject.id = transports.entry");
result = WorldDatabase.Query("SELECT gameobject.guid,gameobject.id,transports.name FROM gameobject,transports WHERE gameobject.id = transports.entry");
if(result) // wrong data found
{
do