Core/DBLayer:
* Rename QueryResult class to ResultSet * Rename QueryResult_AutoPtr to QueryResult * Declare ACE refcounted auto pointer for PreparedResultSet class --HG-- branch : trunk
This commit is contained in:
@@ -37,7 +37,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
|
||||
sObjectMgr.LoadTrinityStrings("creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
|
||||
|
||||
// Gather Additional data from EventAI Texts
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
|
||||
|
||||
sLog.outString("Loading EventAI Texts additional data...");
|
||||
if (result)
|
||||
@@ -114,7 +114,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
|
||||
m_CreatureEventAI_Summon_Map.clear();
|
||||
|
||||
// Gather additional data for EventAI
|
||||
QueryResult_AutoPtr 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)
|
||||
{
|
||||
barGoLink bar(result->GetRowCount());
|
||||
@@ -165,7 +165,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
m_CreatureEventAI_Event_Map.clear();
|
||||
|
||||
// Gather event data
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, "
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, "
|
||||
"event_param1, event_param2, event_param3, event_param4, "
|
||||
"action1_type, action1_param1, action1_param2, action1_param3, "
|
||||
"action2_type, action2_param1, action2_param2, action2_param3, "
|
||||
|
||||
@@ -54,7 +54,7 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass
|
||||
|
||||
AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
|
||||
{
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accid);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accid);
|
||||
if (!result)
|
||||
return AOR_NAME_NOT_EXIST; // account doesn't exist
|
||||
|
||||
@@ -97,7 +97,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
|
||||
|
||||
AccountOpResult AccountMgr::ChangeUsername(uint32 accid, std::string new_uname, std::string new_passwd)
|
||||
{
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accid);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accid);
|
||||
if (!result)
|
||||
return AOR_NAME_NOT_EXIST; // account doesn't exist
|
||||
|
||||
@@ -142,7 +142,7 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accid, std::string new_passwd)
|
||||
uint32 AccountMgr::GetId(std::string username)
|
||||
{
|
||||
LoginDatabase.escape_string(username);
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT id FROM account WHERE username = '%s'", username.c_str());
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT id FROM account WHERE username = '%s'", username.c_str());
|
||||
if (!result)
|
||||
return 0;
|
||||
else
|
||||
@@ -154,7 +154,7 @@ uint32 AccountMgr::GetId(std::string username)
|
||||
|
||||
uint32 AccountMgr::GetSecurity(uint32 acc_id)
|
||||
{
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u'", acc_id);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u'", acc_id);
|
||||
if (result)
|
||||
{
|
||||
uint32 sec = (*result)[0].GetUInt32();
|
||||
@@ -166,7 +166,7 @@ uint32 AccountMgr::GetSecurity(uint32 acc_id)
|
||||
|
||||
uint32 AccountMgr::GetSecurity(uint64 acc_id, int32 realm_id)
|
||||
{
|
||||
QueryResult_AutoPtr result = (realm_id == -1)
|
||||
QueryResult result = (realm_id == -1)
|
||||
? LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND RealmID = '%d'", acc_id, realm_id)
|
||||
: LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND (RealmID = '%d' OR RealmID = '-1')", acc_id, realm_id);
|
||||
if (result)
|
||||
@@ -180,7 +180,7 @@ uint32 AccountMgr::GetSecurity(uint64 acc_id, int32 realm_id)
|
||||
|
||||
bool AccountMgr::GetName(uint32 acc_id, std::string &name)
|
||||
{
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT username FROM account WHERE id = '%u'", acc_id);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT username FROM account WHERE id = '%u'", acc_id);
|
||||
if (result)
|
||||
{
|
||||
name = (*result)[0].GetCppString();
|
||||
@@ -199,7 +199,7 @@ bool AccountMgr::CheckPassword(uint32 accid, std::string passwd)
|
||||
normalizeString(username);
|
||||
normalizeString(passwd);
|
||||
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d' AND sha_pass_hash='%s'", accid, CalculateShaPassHash(username, passwd).c_str());
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d' AND sha_pass_hash='%s'", accid, CalculateShaPassHash(username, passwd).c_str());
|
||||
if (result)
|
||||
return true;
|
||||
|
||||
@@ -210,7 +210,7 @@ uint32 AccountMgr::GetCharactersCount(uint32 acc_id)
|
||||
{
|
||||
uint32 charcount = 0;
|
||||
// check character count
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", acc_id);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", acc_id);
|
||||
if (result)
|
||||
{
|
||||
Field *fields=result->Fetch();
|
||||
|
||||
@@ -555,7 +555,7 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans)
|
||||
}
|
||||
}
|
||||
|
||||
void AchievementMgr::LoadFromDB(QueryResult_AutoPtr achievementResult, QueryResult_AutoPtr criteriaResult)
|
||||
void AchievementMgr::LoadFromDB(QueryResult achievementResult, QueryResult criteriaResult)
|
||||
{
|
||||
if (achievementResult)
|
||||
{
|
||||
@@ -2104,7 +2104,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
|
||||
{
|
||||
m_criteriaDataMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT criteria_id, type, value1, value2, ScriptName FROM achievement_criteria_data");
|
||||
QueryResult result = WorldDatabase.Query("SELECT criteria_id, type, value1, value2, ScriptName FROM achievement_criteria_data");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2243,7 +2243,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
|
||||
|
||||
void AchievementGlobalMgr::LoadCompletedAchievements()
|
||||
{
|
||||
QueryResult_AutoPtr 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)
|
||||
{
|
||||
@@ -2282,7 +2282,7 @@ void AchievementGlobalMgr::LoadRewards()
|
||||
m_achievementRewards.clear(); // need for reload case
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, title_A, title_H, item, sender, subject, text FROM achievement_reward");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, title_A, title_H, item, sender, subject, text FROM achievement_reward");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2392,7 +2392,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
{
|
||||
m_achievementRewardLocales.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,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,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)
|
||||
{
|
||||
|
||||
@@ -243,7 +243,7 @@ class AchievementMgr
|
||||
|
||||
void Reset();
|
||||
static void DeleteFromDB(uint32 lowguid);
|
||||
void LoadFromDB(QueryResult_AutoPtr achievementResult, QueryResult_AutoPtr criteriaResult);
|
||||
void LoadFromDB(QueryResult achievementResult, QueryResult criteriaResult);
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, bool evenIfCriteriaComplete = false);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, Unit *unit = NULL, uint32 time = 0);
|
||||
|
||||
@@ -35,7 +35,7 @@ AddonMgr::~AddonMgr()
|
||||
|
||||
void AddonMgr::LoadFromDB()
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT name, crc FROM addons");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT name, crc FROM addons");
|
||||
if (!result)
|
||||
{
|
||||
sLog.outErrorDb("The table `addons` is empty");
|
||||
|
||||
@@ -306,7 +306,7 @@ void AuctionHouseMgr::LoadAuctionItems()
|
||||
{
|
||||
// data needs to be at first place for Item::LoadFromDB
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, item_template FROM auctionhouse JOIN item_instance ON itemguid = guid");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, item_template FROM auctionhouse JOIN item_instance ON itemguid = guid");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -356,7 +356,7 @@ void AuctionHouseMgr::LoadAuctionItems()
|
||||
|
||||
void AuctionHouseMgr::LoadAuctions()
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT COUNT(*) FROM auctionhouse");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT COUNT(*) FROM auctionhouse");
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -555,7 +555,7 @@ void AuctionHouseObject::Update()
|
||||
if (AuctionsMap.empty())
|
||||
return;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT id FROM auctionhouse WHERE time <= %u ORDER BY TIME ASC", (uint32)curTime+60);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT id FROM auctionhouse WHERE time <= %u ORDER BY TIME ASC", (uint32)curTime+60);
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -132,7 +132,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
else
|
||||
{
|
||||
// 0 1
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT name, class FROM characters WHERE guid='%u'", GUID_LOPART(PlayerGuid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT name, class FROM characters WHERE guid='%u'", GUID_LOPART(PlayerGuid));
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
@@ -161,7 +161,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
plPRating = 1000;
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT matchmaker_rating FROM character_arena_stats WHERE guid='%u' AND slot='%u'", GUID_LOPART(PlayerGuid), GetSlot());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT matchmaker_rating FROM character_arena_stats WHERE guid='%u' AND slot='%u'", GUID_LOPART(PlayerGuid), GetSlot());
|
||||
if (result)
|
||||
plMMRating = (*result)[0].GetUInt32();
|
||||
|
||||
@@ -197,7 +197,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ArenaTeam::LoadArenaTeamFromDB(QueryResult_AutoPtr arenaTeamDataResult)
|
||||
bool ArenaTeam::LoadArenaTeamFromDB(QueryResult arenaTeamDataResult)
|
||||
{
|
||||
if (!arenaTeamDataResult)
|
||||
return false;
|
||||
@@ -224,7 +224,7 @@ bool ArenaTeam::LoadArenaTeamFromDB(QueryResult_AutoPtr arenaTeamDataResult)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ArenaTeam::LoadMembersFromDB(QueryResult_AutoPtr arenaTeamMembersResult)
|
||||
bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult)
|
||||
{
|
||||
if (!arenaTeamMembersResult)
|
||||
return false;
|
||||
@@ -252,7 +252,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult_AutoPtr arenaTeamMembersResult)
|
||||
|
||||
uint32 player_guid = fields[1].GetUInt32();
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery(
|
||||
QueryResult result = CharacterDatabase.PQuery(
|
||||
"SELECT personal_rating, matchmaker_rating FROM character_arena_stats WHERE guid = '%u' AND slot = '%u'", player_guid, GetSlot());
|
||||
|
||||
uint32 personalrating = 0;
|
||||
|
||||
@@ -182,8 +182,8 @@ class ArenaTeam
|
||||
|
||||
bool IsFighting() const;
|
||||
|
||||
bool LoadArenaTeamFromDB(QueryResult_AutoPtr arenaTeamDataResult);
|
||||
bool LoadMembersFromDB(QueryResult_AutoPtr arenaTeamMembersResult);
|
||||
bool LoadArenaTeamFromDB(QueryResult arenaTeamDataResult);
|
||||
bool LoadMembersFromDB(QueryResult arenaTeamMembersResult);
|
||||
void LoadStatsFromDB(uint32 ArenaTeamId);
|
||||
|
||||
void SaveToDB();
|
||||
|
||||
@@ -675,7 +675,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO,Weight,ScriptName FROM battleground_template");
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO,Weight,ScriptName FROM battleground_template");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -1116,7 +1116,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
{
|
||||
mBattleMastersMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,bg_template FROM battlemaster_entry");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,bg_template FROM battlemaster_entry");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
//load not built in channel if saved
|
||||
std::string _name(name);
|
||||
CharacterDatabase.escape_string(_name);
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT m_announce, m_moderate, m_public, m_password, BannedList FROM channels WHERE m_name = '%s' AND m_team = '%u'", _name.c_str(), m_Team);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT m_announce, m_moderate, m_public, m_password, BannedList FROM channels WHERE m_name = '%s' AND m_team = '%u'", _name.c_str(), m_Team);
|
||||
if (result)//load
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
@@ -799,7 +799,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{
|
||||
load_command_table = false;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT name,security,help FROM command");
|
||||
QueryResult result = WorldDatabase.Query("SELECT name,security,help FROM command");
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
|
||||
@@ -637,8 +637,8 @@ class ChatHandler
|
||||
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry);
|
||||
|
||||
// Utility methods for commands
|
||||
bool LookupPlayerSearchCommand(QueryResult_AutoPtr result, int32 limit);
|
||||
bool HandleBanListHelper(QueryResult_AutoPtr result);
|
||||
bool LookupPlayerSearchCommand(QueryResult result, int32 limit);
|
||||
bool HandleBanListHelper(QueryResult result);
|
||||
bool HandleBanHelper(BanMode mode,char const* args);
|
||||
bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
|
||||
bool HandleUnBanHelper(BanMode mode,char const* args);
|
||||
|
||||
@@ -293,7 +293,7 @@ bool ChatHandler::HandleGoCreatureCommand(const char* args)
|
||||
}
|
||||
//sLog.outError("DEBUG: %s", whereClause.c_str());
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map FROM creature %s", whereClause.str().c_str());
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map FROM creature %s", whereClause.str().c_str());
|
||||
if (!result)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_GOCREATNOTFOUND);
|
||||
@@ -391,7 +391,7 @@ bool ChatHandler::HandleGoObjectCommand(const char* args)
|
||||
bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr.GetActiveEventList();
|
||||
if (*args)
|
||||
{
|
||||
@@ -791,7 +791,7 @@ bool ChatHandler::HandleGameObjectNearCommand(const char* args)
|
||||
uint32 count = 0;
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, "
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, "
|
||||
"(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ "
|
||||
"FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
|
||||
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),
|
||||
@@ -2183,7 +2183,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
return false;
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT totaltime, level, money, account, race, class FROM characters WHERE guid = '%u'", GUID_LOPART(target_guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT totaltime, level, money, account, race, class FROM characters WHERE guid = '%u'", GUID_LOPART(target_guid));
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
@@ -2202,7 +2202,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
uint32 security = 0;
|
||||
std::string last_login = GetTrinityString(LANG_ERROR);
|
||||
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT a.username,aa.gmlevel,a.email,a.last_ip,a.last_login "
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT a.username,aa.gmlevel,a.email,a.last_ip,a.last_login "
|
||||
"FROM account a "
|
||||
"LEFT JOIN account_access aa "
|
||||
"ON (a.id = aa.id) "
|
||||
@@ -2313,7 +2313,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
|
||||
pathid = target->GetWaypointPath();
|
||||
else
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT MAX(id) FROM waypoint_data");
|
||||
QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM waypoint_data");
|
||||
uint32 maxpathid = result->Fetch()->GetInt32();
|
||||
pathid = maxpathid+1;
|
||||
sLog.outDebug("DEBUG: HandleWpAddCommand - New path started.");
|
||||
@@ -2335,7 +2335,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
|
||||
|
||||
sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0");
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
|
||||
|
||||
if (result)
|
||||
point = (*result)[0].GetUInt32();
|
||||
@@ -2392,7 +2392,7 @@ bool ChatHandler::HandleWpLoadPathCommand(const char *args)
|
||||
}
|
||||
|
||||
guidlow = target->GetDBTableGUIDLow();
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow);
|
||||
|
||||
if (result)
|
||||
WorldDatabase.PExecute("UPDATE creature_addon SET path_id = '%u' WHERE guid = '%u'", pathid, guidlow);
|
||||
@@ -2475,7 +2475,7 @@ bool ChatHandler::HandleWpEventCommand(const char* args)
|
||||
|
||||
if (id)
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid = %u", id);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid = %u", id);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2487,7 +2487,7 @@ bool ChatHandler::HandleWpEventCommand(const char* args)
|
||||
}
|
||||
else
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT MAX(guid) FROM waypoint_scripts");
|
||||
QueryResult result = WorldDatabase.Query("SELECT MAX(guid) FROM waypoint_scripts");
|
||||
id = result->Fetch()->GetUInt32();
|
||||
WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id+1);
|
||||
PSendSysMessage("%s%s%u|r", "|cff00ff00","Wp Event: New waypoint event added: |r|cff00ffff", id+1);
|
||||
@@ -2510,7 +2510,7 @@ bool ChatHandler::HandleWpEventCommand(const char* args)
|
||||
float a8, a9, a10, a11;
|
||||
char const* a7;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = %u", id);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = %u", id);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2543,7 +2543,7 @@ bool ChatHandler::HandleWpEventCommand(const char* args)
|
||||
{
|
||||
id = atoi(arg_id);
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid FROM waypoint_scripts WHERE guid = %u", id);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT guid FROM waypoint_scripts WHERE guid = %u", id);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -2611,7 +2611,7 @@ bool ChatHandler::HandleWpEventCommand(const char* args)
|
||||
}
|
||||
else
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'",id);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'",id);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2730,7 +2730,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
// Check the creature
|
||||
if (wpCreature->GetEntry() == VISUAL_WAYPOINT)
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2931,7 +2931,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow());
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow());
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2963,7 +2963,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
|
||||
if (show == "on")
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT point, position_x,position_y,position_z FROM waypoint_data WHERE id = '%u'", pathid);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT point, position_x,position_y,position_z FROM waypoint_data WHERE id = '%u'", pathid);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2975,7 +2975,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid);
|
||||
|
||||
// Delete all visuals for this NPC
|
||||
QueryResult_AutoPtr result2 = WorldDatabase.PQuery("SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid);
|
||||
QueryResult result2 = WorldDatabase.PQuery("SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid);
|
||||
|
||||
if (result2)
|
||||
{
|
||||
@@ -3058,7 +3058,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
{
|
||||
PSendSysMessage("|cff00ff00DEBUG: wp first, GUID: %u|r", pathid);
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z FROM waypoint_data WHERE point='1' AND id = '%u'",pathid);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z FROM waypoint_data WHERE point='1' AND id = '%u'",pathid);
|
||||
if (!result)
|
||||
{
|
||||
PSendSysMessage(LANG_WAYPOINT_NOTFOUND, pathid);
|
||||
@@ -3101,7 +3101,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
{
|
||||
PSendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff%u|r", pathid);
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
|
||||
if (result)
|
||||
Maxpoint = (*result)[0].GetUInt32();
|
||||
else
|
||||
@@ -3147,7 +3147,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
|
||||
if (show == "off")
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id = '%u'", 1);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id = '%u'", 1);
|
||||
if (!result)
|
||||
{
|
||||
SendSysMessage(LANG_WAYPOINT_VP_NOTFOUND);
|
||||
@@ -3793,7 +3793,7 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
|
||||
|
||||
LoginDatabase.escape_string (ip);
|
||||
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE last_ip = '%s'", ip.c_str ());
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE last_ip = '%s'", ip.c_str ());
|
||||
|
||||
return LookupPlayerSearchCommand (result,limit);
|
||||
}
|
||||
@@ -3812,7 +3812,7 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
|
||||
|
||||
LoginDatabase.escape_string (account);
|
||||
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE username = '%s'", account.c_str ());
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE username = '%s'", account.c_str ());
|
||||
|
||||
return LookupPlayerSearchCommand (result,limit);
|
||||
}
|
||||
@@ -3829,12 +3829,12 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
|
||||
|
||||
LoginDatabase.escape_string (email);
|
||||
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE email = '%s'", email.c_str ());
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE email = '%s'", email.c_str ());
|
||||
|
||||
return LookupPlayerSearchCommand (result,limit);
|
||||
}
|
||||
|
||||
bool ChatHandler::LookupPlayerSearchCommand(QueryResult_AutoPtr result, int32 limit)
|
||||
bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
|
||||
{
|
||||
if (!result)
|
||||
{
|
||||
@@ -3858,7 +3858,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult_AutoPtr result, int32 li
|
||||
uint32 acc_id = fields[0].GetUInt32();
|
||||
std::string acc_name = fields[1].GetCppString();
|
||||
|
||||
QueryResult_AutoPtr chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id);
|
||||
QueryResult chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id);
|
||||
if (chars)
|
||||
{
|
||||
PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT,acc_name.c_str(),acc_id);
|
||||
|
||||
@@ -294,7 +294,7 @@ bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint32 entry = (uint32) atoi((char*)args);
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT difficulty_entry_1,difficulty_entry_2,difficulty_entry_3,KillCredit1,KillCredit2,modelid1,modelid2,modelid3,modelid4,name,subname,IconName,gossip_menu_id,minlevel,maxlevel,exp,faction_A,faction_H,npcflag,speed_walk,speed_run,scale,rank,mindmg,maxdmg,dmgschool,attackpower,dmg_multiplier,baseattacktime,rangeattacktime,unit_class,unit_flags,dynamicflags,family,trainer_type,trainer_spell,trainer_class,trainer_race,minrangedmg,maxrangedmg,rangedattackpower,type,type_flags,lootid,pickpocketloot,skinloot,resistance1,resistance2,resistance3,resistance4,resistance5,resistance6,spell1,spell2,spell3,spell4,spell5,spell6,spell7,spell8,PetSpellDataId,VehicleId,mingold,maxgold,AIName,MovementType,InhabitType,Health_mod,Mana_mod,Armor_mod,RacialLeader,questItem1,questItem2,questItem3,questItem4,questItem5,questItem6,movementId,RegenHealth,equipment_id,mechanic_immune_mask,flags_extra,ScriptName FROM creature_template WHERE entry = %u", entry);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1,difficulty_entry_2,difficulty_entry_3,KillCredit1,KillCredit2,modelid1,modelid2,modelid3,modelid4,name,subname,IconName,gossip_menu_id,minlevel,maxlevel,exp,faction_A,faction_H,npcflag,speed_walk,speed_run,scale,rank,mindmg,maxdmg,dmgschool,attackpower,dmg_multiplier,baseattacktime,rangeattacktime,unit_class,unit_flags,dynamicflags,family,trainer_type,trainer_spell,trainer_class,trainer_race,minrangedmg,maxrangedmg,rangedattackpower,type,type_flags,lootid,pickpocketloot,skinloot,resistance1,resistance2,resistance3,resistance4,resistance5,resistance6,spell1,spell2,spell3,spell4,spell5,spell6,spell7,spell8,PetSpellDataId,VehicleId,mingold,maxgold,AIName,MovementType,InhabitType,Health_mod,Mana_mod,Armor_mod,RacialLeader,questItem1,questItem2,questItem3,questItem4,questItem5,questItem6,movementId,RegenHealth,equipment_id,mechanic_immune_mask,flags_extra,ScriptName FROM creature_template WHERE entry = %u", entry);
|
||||
if (!result)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry);
|
||||
@@ -1238,7 +1238,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char *args)
|
||||
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
|
||||
if (gmRealmID == -1)
|
||||
{
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT * FROM account_access WHERE id = '%u' AND gmlevel > '%d'", targetAccountId, gm);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT * FROM account_access WHERE id = '%u' AND gmlevel > '%d'", targetAccountId, gm);
|
||||
if (result)
|
||||
{
|
||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
|
||||
@@ -2405,7 +2405,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
{
|
||||
std::string itemName = citemName+1;
|
||||
WorldDatabase.escape_string(itemName);
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE name = '%s'", itemName.c_str());
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE name = '%s'", itemName.c_str());
|
||||
if (!result)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_COULDNOTFIND, citemName+1);
|
||||
@@ -2596,7 +2596,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
|
||||
return false;
|
||||
uint32 count = uint32(_count);
|
||||
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
// inventory case
|
||||
uint32 inv_count = 0;
|
||||
@@ -2661,7 +2661,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
|
||||
item_id, count);
|
||||
}
|
||||
else
|
||||
result = QueryResult_AutoPtr(NULL);
|
||||
result = QueryResult(NULL);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -2705,7 +2705,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
|
||||
item_id, count);
|
||||
}
|
||||
else
|
||||
result = QueryResult_AutoPtr(NULL);
|
||||
result = QueryResult(NULL);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -2801,7 +2801,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args)
|
||||
if (count < 0)
|
||||
return false;
|
||||
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
uint32 obj_count = 0;
|
||||
result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'",go_id);
|
||||
@@ -2931,7 +2931,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args)
|
||||
if (count < 0)
|
||||
return false;
|
||||
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
uint32 cr_count = 0;
|
||||
result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'",cr_id);
|
||||
@@ -5790,7 +5790,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
|
||||
|
||||
bool ChatHandler::HandleBanInfoHelper(uint32 accountid, char const* accountname)
|
||||
{
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate,banreason,bannedby FROM account_banned WHERE id = '%u' ORDER BY bandate ASC",accountid);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate,banreason,bannedby FROM account_banned WHERE id = '%u' ORDER BY bandate ASC",accountid);
|
||||
if (!result)
|
||||
{
|
||||
PSendSysMessage(LANG_BANINFO_NOACCOUNTBAN, accountname);
|
||||
@@ -5830,7 +5830,7 @@ bool ChatHandler::HandleBanInfoIPCommand(const char *args)
|
||||
std::string IP = cIP;
|
||||
|
||||
LoginDatabase.escape_string(IP);
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason,bannedby,unbandate-bandate FROM ip_banned WHERE ip = '%s'",IP.c_str());
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason,bannedby,unbandate-bandate FROM ip_banned WHERE ip = '%s'",IP.c_str());
|
||||
if (!result)
|
||||
{
|
||||
PSendSysMessage(LANG_BANINFO_NOIP);
|
||||
@@ -5856,7 +5856,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args)
|
||||
|
||||
std::string filter = cFilter;
|
||||
LoginDatabase.escape_string(filter);
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"),filter.c_str());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"),filter.c_str());
|
||||
if (!result)
|
||||
{
|
||||
PSendSysMessage(LANG_BANLIST_NOCHARACTER);
|
||||
@@ -5874,7 +5874,7 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args)
|
||||
std::string filter = cFilter ? cFilter : "";
|
||||
LoginDatabase.escape_string(filter);
|
||||
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
if (filter.empty())
|
||||
{
|
||||
@@ -5897,7 +5897,7 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args)
|
||||
return HandleBanListHelper(result);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanListHelper(QueryResult_AutoPtr result)
|
||||
bool ChatHandler::HandleBanListHelper(QueryResult result)
|
||||
{
|
||||
PSendSysMessage(LANG_BANLIST_MATCHINGACCOUNT);
|
||||
|
||||
@@ -5909,7 +5909,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult_AutoPtr result)
|
||||
Field* fields = result->Fetch();
|
||||
uint32 accountid = fields[0].GetUInt32();
|
||||
|
||||
QueryResult_AutoPtr banresult = LoginDatabase.PQuery("SELECT account.username FROM account,account_banned WHERE account_banned.id='%u' AND account_banned.id=account.id",accountid);
|
||||
QueryResult banresult = LoginDatabase.PQuery("SELECT account.username FROM account,account_banned WHERE account_banned.id='%u' AND account_banned.id=account.id",accountid);
|
||||
if (banresult)
|
||||
{
|
||||
Field* fields2 = banresult->Fetch();
|
||||
@@ -5939,7 +5939,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult_AutoPtr result)
|
||||
sAccountMgr.GetName (account_id,account_name);
|
||||
|
||||
// No SQL injection. id is uint32.
|
||||
QueryResult_AutoPtr banInfo = LoginDatabase.PQuery("SELECT bandate,unbandate,bannedby,banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
|
||||
QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate,unbandate,bannedby,banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id);
|
||||
if (banInfo)
|
||||
{
|
||||
Field *fields2 = banInfo->Fetch();
|
||||
@@ -5979,7 +5979,7 @@ bool ChatHandler::HandleBanListIPCommand(const char *args)
|
||||
std::string filter = cFilter ? cFilter : "";
|
||||
LoginDatabase.escape_string(filter);
|
||||
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
if (filter.empty())
|
||||
{
|
||||
@@ -6773,7 +6773,7 @@ bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/)
|
||||
bool ChatHandler::HandleGMListFullCommand(const char* /*args*/)
|
||||
{
|
||||
///- Get the accounts with GM Level >0
|
||||
QueryResult_AutoPtr result = LoginDatabase.Query("SELECT a.username,aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel > 0");
|
||||
QueryResult result = LoginDatabase.Query("SELECT a.username,aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel > 0");
|
||||
if (result)
|
||||
{
|
||||
SendSysMessage(LANG_GMLIST);
|
||||
@@ -7302,7 +7302,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
if (TargetName)
|
||||
{
|
||||
//check for offline players
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT characters.guid FROM characters WHERE characters.name = '%s'",name.c_str());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT characters.guid FROM characters WHERE characters.name = '%s'",name.c_str());
|
||||
if (!result)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
|
||||
@@ -7329,7 +7329,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
bool ChatHandler::HandleListFreezeCommand(const char * /*args*/)
|
||||
{
|
||||
//Get names from DB
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT characters.name FROM characters LEFT JOIN character_aura ON (characters.guid = character_aura.guid) WHERE character_aura.spell = 9454");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT characters.name FROM characters LEFT JOIN character_aura ON (characters.guid = character_aura.guid) WHERE character_aura.spell = 9454");
|
||||
if (!result)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS);
|
||||
|
||||
@@ -326,7 +326,7 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions");
|
||||
QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ void DisableMgr::LoadDisables()
|
||||
|
||||
m_DisableMap.clear();
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT sourceType,entry,flags FROM disables");
|
||||
QueryResult result = WorldDatabase.Query("SELECT sourceType,entry,flags FROM disables");
|
||||
|
||||
uint32 total_count = 0;
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ void LFGMgr::LoadDungeonEncounters()
|
||||
m_EncountersByAchievement.clear();
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT achievementId, dungeonId FROM lfg_dungeon_encounters");
|
||||
QueryResult result = WorldDatabase.Query("SELECT achievementId, dungeonId FROM lfg_dungeon_encounters");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ void LFGMgr::LoadRewards()
|
||||
|
||||
uint32 count = 0;
|
||||
// ORDER BY is very important for GetRandomDungeonReward!
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT dungeonId, maxLevel, firstQuestId, firstMoneyVar, firstXPVar, otherQuestId, otherMoneyVar, otherXPVar FROM lfg_dungeon_rewards ORDER BY dungeonId, maxLevel ASC");
|
||||
QueryResult result = WorldDatabase.Query("SELECT dungeonId, maxLevel, firstQuestId, firstMoneyVar, firstXPVar, otherQuestId, otherMoneyVar, otherXPVar FROM lfg_dungeon_rewards ORDER BY dungeonId, maxLevel ASC");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
CreatureGroupMap.clear();
|
||||
|
||||
//Check Integrity of the table
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT MAX(leaderGUID) FROM creature_formations");
|
||||
QueryResult result = WorldDatabase.Query("SELECT MAX(leaderGUID) FROM creature_formations");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
|
||||
// check data correctness
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE guid = %u", group_member->leaderGUID);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE guid = %u", group_member->leaderGUID);
|
||||
if (!result)
|
||||
{
|
||||
sLog.outErrorDb("creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID);
|
||||
|
||||
@@ -107,7 +107,7 @@ void Bag::SaveToDB(SQLTransaction& trans)
|
||||
Item::SaveToDB(trans);
|
||||
}
|
||||
|
||||
bool Bag::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result, uint32 entry)
|
||||
bool Bag::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult result, uint32 entry)
|
||||
{
|
||||
if (!Item::LoadFromDB(guid, owner_guid, result, entry))
|
||||
return false;
|
||||
|
||||
@@ -56,7 +56,7 @@ class Bag : public Item
|
||||
// overwrite virtual Item::SaveToDB
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
// overwrite virtual Item::LoadFromDB
|
||||
bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result, uint32 entry);
|
||||
bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult result, uint32 entry);
|
||||
// overwrite virtual Item::DeleteFromDB
|
||||
void DeleteFromDB(SQLTransaction& trans);
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ void Item::SaveToDB(SQLTransaction& trans)
|
||||
SetState(ITEM_UNCHANGED);
|
||||
}
|
||||
|
||||
bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result, uint32 entry)
|
||||
bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult result, uint32 entry)
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
//result = CharacterDatabase.PQuery("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text FROM item_instance WHERE guid = '%u'", guid);
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
struct SpellEntry;
|
||||
class Bag;
|
||||
class QueryResult;
|
||||
class Unit;
|
||||
|
||||
struct ItemSetEffect
|
||||
@@ -246,7 +245,7 @@ class Item : public Object
|
||||
bool IsBindedNotWith(Player const* player) const;
|
||||
bool IsBoundByEnchant() const;
|
||||
virtual void SaveToDB(SQLTransaction& trans);
|
||||
virtual bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result, uint32 entry);
|
||||
virtual bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult result, uint32 entry);
|
||||
virtual void DeleteFromDB(SQLTransaction& trans);
|
||||
void DeleteFromInventoryDB(SQLTransaction& trans);
|
||||
void SaveRefundDataToDB();
|
||||
|
||||
@@ -55,7 +55,7 @@ void LoadRandomEnchantmentsTable()
|
||||
float chance;
|
||||
uint32 count = 0;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, ench, chance FROM item_enchantment_template");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, ench, chance FROM item_enchantment_template");
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
|
||||
uint32 ownerid = owner->GetGUIDLow();
|
||||
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
if (petnumber)
|
||||
// known petnumber entry 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
||||
@@ -1096,7 +1096,7 @@ void Pet::_LoadSpellCooldowns()
|
||||
m_CreatureSpellCooldowns.clear();
|
||||
m_CreatureCategoryCooldowns.clear();
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT spell,time FROM pet_spell_cooldown WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT spell,time FROM pet_spell_cooldown WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -1158,7 +1158,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans)
|
||||
|
||||
void Pet::_LoadSpells()
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT spell,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT spell,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -1207,7 +1207,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
||||
{
|
||||
sLog.outDebug("Loading auras for pet %u",GetGUIDLow());
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -1693,7 +1693,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
|
||||
// now need only reset for offline pets (all pets except online case)
|
||||
uint32 except_petnumber = online_pet ? online_pet->GetCharmInfo()->GetPetNumber() : 0;
|
||||
|
||||
QueryResult_AutoPtr resultPets = CharacterDatabase.PQuery(
|
||||
QueryResult resultPets = CharacterDatabase.PQuery(
|
||||
"SELECT id FROM character_pet WHERE owner = '%u' AND id <> '%u'",
|
||||
owner->GetGUIDLow(),except_petnumber);
|
||||
|
||||
@@ -1701,7 +1701,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
|
||||
if (!resultPets)
|
||||
return;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery(
|
||||
QueryResult result = CharacterDatabase.PQuery(
|
||||
"SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet "
|
||||
"WHERE character_pet.owner = '%u' AND character_pet.id = pet_spell.guid AND character_pet.id <> %u",
|
||||
owner->GetGUIDLow(),except_petnumber);
|
||||
|
||||
@@ -1587,7 +1587,7 @@ void Player::setDeathState(DeathState s)
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data)
|
||||
bool Player::BuildEnumData(QueryResult result, WorldPacket * p_data)
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
|
||||
@@ -3919,7 +3919,7 @@ void Player::RemoveAllSpellCooldown()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::_LoadSpellCooldowns(QueryResult_AutoPtr result)
|
||||
void Player::_LoadSpellCooldowns(QueryResult result)
|
||||
{
|
||||
// some cooldowns can be already set at aura loading...
|
||||
|
||||
@@ -4436,7 +4436,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
LeaveAllArenaTeams(playerguid);
|
||||
|
||||
// the player was uninvited already on logout so just remove from group
|
||||
QueryResult_AutoPtr resultGroup = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", guid);
|
||||
QueryResult resultGroup = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", guid);
|
||||
if (resultGroup)
|
||||
if (Group* group = sObjectMgr.GetGroupByGUID((*resultGroup)[0].GetUInt32()))
|
||||
RemoveFromGroup(group, playerguid);
|
||||
@@ -4451,7 +4451,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
// Return back all mails with COD and Item 0 1 2 3 4 5 6 7
|
||||
QueryResult_AutoPtr resultMail = CharacterDatabase.PQuery("SELECT id,messageType,mailTemplateId,sender,subject,body,money,has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", guid);
|
||||
QueryResult resultMail = CharacterDatabase.PQuery("SELECT id,messageType,mailTemplateId,sender,subject,body,money,has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", guid);
|
||||
if (resultMail)
|
||||
{
|
||||
do
|
||||
@@ -4486,7 +4486,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
if (has_items)
|
||||
{
|
||||
// Data needs to be at first place for Item::LoadFromDB
|
||||
QueryResult_AutoPtr resultItems = CharacterDatabase.PQuery("SELECT creatorGuid,giftCreatorGuid,count,duration,charges,flags,enchantments,randomPropertyId,durability,playedTime,text,item_guid,item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail_id);
|
||||
QueryResult resultItems = CharacterDatabase.PQuery("SELECT creatorGuid,giftCreatorGuid,count,duration,charges,flags,enchantments,randomPropertyId,durability,playedTime,text,item_guid,item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail_id);
|
||||
if (resultItems)
|
||||
{
|
||||
do
|
||||
@@ -4528,7 +4528,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
|
||||
// Unsummon and delete for pets in world is not required: player deleted from CLI or character list with not loaded pet.
|
||||
// Get guids of character's pets, will deleted in transaction
|
||||
QueryResult_AutoPtr resultPets = CharacterDatabase.PQuery("SELECT id FROM character_pet WHERE owner = '%u'",guid);
|
||||
QueryResult resultPets = CharacterDatabase.PQuery("SELECT id FROM character_pet WHERE owner = '%u'",guid);
|
||||
|
||||
// NOW we can finally clear other DB data related to character
|
||||
if (resultPets)
|
||||
@@ -4615,7 +4615,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
|
||||
{
|
||||
sLog.outString("Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays);
|
||||
|
||||
QueryResult_AutoPtr resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '" UI64FMTD "'", uint64(time(NULL) - time_t(keepDays * DAY)));
|
||||
QueryResult resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '" UI64FMTD "'", uint64(time(NULL) - time_t(keepDays * DAY)));
|
||||
if (resultChars)
|
||||
{
|
||||
sLog.outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete",resultChars->GetRowCount());
|
||||
@@ -6911,7 +6911,7 @@ void Player::ModifyArenaPoints(int32 value)
|
||||
|
||||
uint32 Player::GetGuildIdFromDB(uint64 guid)
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid='%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
@@ -6921,7 +6921,7 @@ uint32 Player::GetGuildIdFromDB(uint64 guid)
|
||||
|
||||
uint32 Player::GetRankFromDB(uint64 guid)
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT rank FROM guild_member WHERE guid='%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT rank FROM guild_member WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if (result)
|
||||
{
|
||||
uint32 v = result->Fetch()[0].GetUInt32();
|
||||
@@ -6933,7 +6933,7 @@ uint32 Player::GetRankFromDB(uint64 guid)
|
||||
|
||||
uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type)
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u' AND type='%u' LIMIT 1", GUID_LOPART(guid), type);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u' AND type='%u' LIMIT 1", GUID_LOPART(guid), type);
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
@@ -6944,7 +6944,7 @@ uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type)
|
||||
uint32 Player::GetZoneIdFromDB(uint64 guid)
|
||||
{
|
||||
uint32 guidLow = GUID_LOPART(guid);
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT zone FROM characters WHERE guid='%u'", guidLow);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT zone FROM characters WHERE guid='%u'", guidLow);
|
||||
if (!result)
|
||||
return 0;
|
||||
Field* fields = result->Fetch();
|
||||
@@ -6973,7 +6973,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid)
|
||||
|
||||
uint32 Player::GetLevelFromDB(uint64 guid)
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid='%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
@@ -15679,7 +15679,7 @@ void Player::Initialize(uint32 guid)
|
||||
Object::_Create(guid, 0, HIGHGUID_PLAYER);
|
||||
}
|
||||
|
||||
void Player::_LoadDeclinedNames(QueryResult_AutoPtr result)
|
||||
void Player::_LoadDeclinedNames(QueryResult result)
|
||||
{
|
||||
if (!result)
|
||||
return;
|
||||
@@ -15691,7 +15691,7 @@ void Player::_LoadDeclinedNames(QueryResult_AutoPtr result)
|
||||
m_declinedname->name[i] = fields[i].GetCppString();
|
||||
}
|
||||
|
||||
void Player::_LoadArenaTeamInfo(QueryResult_AutoPtr result)
|
||||
void Player::_LoadArenaTeamInfo(QueryResult result)
|
||||
{
|
||||
// arenateamid, played_week, played_season, personal_rating, matchmaker_rating
|
||||
memset((void*)&m_uint32Values[PLAYER_FIELD_ARENA_TEAM_INFO_1_1], 0, sizeof(uint32) * MAX_ARENA_SLOT * ARENA_TEAM_END);
|
||||
@@ -15724,7 +15724,7 @@ void Player::_LoadArenaTeamInfo(QueryResult_AutoPtr result)
|
||||
}while (result->NextRow());
|
||||
}
|
||||
|
||||
void Player::_LoadArenaStatsInfo(QueryResult_AutoPtr result)
|
||||
void Player::_LoadArenaStatsInfo(QueryResult result)
|
||||
{
|
||||
uint8 slot = 0;
|
||||
if (!result)
|
||||
@@ -15759,7 +15759,7 @@ void Player::_LoadArenaStatsInfo(QueryResult_AutoPtr result)
|
||||
}while (nextrow);
|
||||
}
|
||||
|
||||
void Player::_LoadEquipmentSets(QueryResult_AutoPtr result)
|
||||
void Player::_LoadEquipmentSets(QueryResult result)
|
||||
{
|
||||
// SetPQuery(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = '%u' ORDER BY setindex", GUID_LOPART(m_guid));
|
||||
if (!result)
|
||||
@@ -15790,7 +15790,7 @@ void Player::_LoadEquipmentSets(QueryResult_AutoPtr result)
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
void Player::_LoadBGData(QueryResult_AutoPtr result)
|
||||
void Player::_LoadBGData(QueryResult result)
|
||||
{
|
||||
if (!result)
|
||||
return;
|
||||
@@ -15812,7 +15812,7 @@ void Player::_LoadBGData(QueryResult_AutoPtr result)
|
||||
|
||||
bool Player::LoadPositionFromDB(uint32& mapid, float& x,float& y,float& z,float& o, bool& in_flight, uint64 guid)
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,taxi_path FROM characters WHERE guid = '%u'",GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,taxi_path FROM characters WHERE guid = '%u'",GUID_LOPART(guid));
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
@@ -15870,7 +15870,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
|
||||
// 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
||||
//"health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = '%u'", guid);
|
||||
QueryResult_AutoPtr result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);
|
||||
QueryResult result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -16543,7 +16543,7 @@ bool Player::isAllowedToLoot(const Creature* creature)
|
||||
return false;
|
||||
}
|
||||
|
||||
void Player::_LoadActions(QueryResult_AutoPtr result)
|
||||
void Player::_LoadActions(QueryResult result)
|
||||
{
|
||||
m_actionButtons.clear();
|
||||
|
||||
@@ -16571,7 +16571,7 @@ void Player::_LoadActions(QueryResult_AutoPtr result)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::_LoadAuras(QueryResult_AutoPtr result, uint32 timediff)
|
||||
void Player::_LoadAuras(QueryResult result, uint32 timediff)
|
||||
{
|
||||
sLog.outDebug("Loading auras for player %u",GetGUIDLow());
|
||||
|
||||
@@ -16687,7 +16687,7 @@ void Player::LoadCorpse()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff)
|
||||
void Player::_LoadInventory(QueryResult result, uint32 timediff)
|
||||
{
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GetGUIDLow());
|
||||
std::map<uint64, Bag*> bagMap; // fast guid lookup for bags
|
||||
@@ -16762,7 +16762,7 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff)
|
||||
}
|
||||
else
|
||||
{
|
||||
QueryResult_AutoPtr result2 = CharacterDatabase.PQuery(
|
||||
QueryResult result2 = CharacterDatabase.PQuery(
|
||||
"SELECT player_guid,paidMoney,paidExtendedCost FROM `item_refund_instance` WHERE item_guid = '%u' AND player_guid = '%u' LIMIT 1",
|
||||
item->GetGUIDLow(), GetGUIDLow());
|
||||
if (!result2)
|
||||
@@ -16885,7 +16885,7 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff)
|
||||
void Player::_LoadMailedItems(Mail *mail)
|
||||
{
|
||||
// data needs to be at first place for Item::LoadFromDB
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, item_template, owner_guid FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, item_template, owner_guid FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID);
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -16925,7 +16925,7 @@ void Player::_LoadMailedItems(Mail *mail)
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
void Player::_LoadMailInit(QueryResult_AutoPtr resultUnread, QueryResult_AutoPtr resultDelivery)
|
||||
void Player::_LoadMailInit(QueryResult resultUnread, QueryResult resultDelivery)
|
||||
{
|
||||
//set a count of unread mails
|
||||
//QueryResult *resultMails = CharacterDatabase.PQuery("SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(playerGuid),(uint64)cTime);
|
||||
@@ -16948,7 +16948,7 @@ void Player::_LoadMail()
|
||||
{
|
||||
m_mail.clear();
|
||||
//mails are in right order 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC",GetGUIDLow());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC",GetGUIDLow());
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
@@ -16999,7 +16999,7 @@ void Player::LoadPet()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::_LoadQuestStatus(QueryResult_AutoPtr result)
|
||||
void Player::_LoadQuestStatus(QueryResult result)
|
||||
{
|
||||
mQuestStatus.clear();
|
||||
|
||||
@@ -17108,7 +17108,7 @@ void Player::_LoadQuestStatus(QueryResult_AutoPtr result)
|
||||
SetQuestSlot(i, 0);
|
||||
}
|
||||
|
||||
void Player::_LoadDailyQuestStatus(QueryResult_AutoPtr result)
|
||||
void Player::_LoadDailyQuestStatus(QueryResult result)
|
||||
{
|
||||
for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
|
||||
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx,0);
|
||||
@@ -17149,7 +17149,7 @@ void Player::_LoadDailyQuestStatus(QueryResult_AutoPtr result)
|
||||
m_DailyQuestChanged = false;
|
||||
}
|
||||
|
||||
void Player::_LoadWeeklyQuestStatus(QueryResult_AutoPtr result)
|
||||
void Player::_LoadWeeklyQuestStatus(QueryResult result)
|
||||
{
|
||||
m_weeklyquests.clear();
|
||||
|
||||
@@ -17176,7 +17176,7 @@ void Player::_LoadWeeklyQuestStatus(QueryResult_AutoPtr result)
|
||||
m_WeeklyQuestChanged = false;
|
||||
}
|
||||
|
||||
void Player::_LoadSpells(QueryResult_AutoPtr result)
|
||||
void Player::_LoadSpells(QueryResult result)
|
||||
{
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow());
|
||||
|
||||
@@ -17192,7 +17192,7 @@ void Player::_LoadSpells(QueryResult_AutoPtr result)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::_LoadGroup(QueryResult_AutoPtr result)
|
||||
void Player::_LoadGroup(QueryResult result)
|
||||
{
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", GetGUIDLow());
|
||||
if (result)
|
||||
@@ -17211,7 +17211,7 @@ void Player::_LoadGroup(QueryResult_AutoPtr result)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::_LoadBoundInstances(QueryResult_AutoPtr result)
|
||||
void Player::_LoadBoundInstances(QueryResult result)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||
m_boundInstances[i].clear();
|
||||
@@ -17562,7 +17562,7 @@ bool Player::CheckInstanceLoginValid()
|
||||
return sMapMgr.CanPlayerEnter(GetMap()->GetId(), this, true);
|
||||
}
|
||||
|
||||
bool Player::_LoadHomeBind(QueryResult_AutoPtr result)
|
||||
bool Player::_LoadHomeBind(QueryResult result)
|
||||
{
|
||||
PlayerInfo const *info = sObjectMgr.GetPlayerInfo(getRace(), getClass());
|
||||
if (!info)
|
||||
@@ -18291,7 +18291,7 @@ void Player::SetUInt32ValueInArray(Tokens& tokens,uint16 index, uint32 value)
|
||||
void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair)
|
||||
{
|
||||
// 0
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT playerBytes2 FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT playerBytes2 FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -19093,7 +19093,7 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask)
|
||||
|
||||
void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
|
||||
{
|
||||
QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL);
|
||||
QueryResult result = QueryResult(NULL);
|
||||
if (type == 10)
|
||||
result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid));
|
||||
else
|
||||
@@ -19135,7 +19135,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
|
||||
|
||||
void Player::LeaveAllArenaTeams(uint64 guid)
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -22754,7 +22754,7 @@ void Player::learnSpellHighRank(uint32 spellid)
|
||||
learnSpellHighRank(next);
|
||||
}
|
||||
|
||||
void Player::_LoadSkills(QueryResult_AutoPtr result)
|
||||
void Player::_LoadSkills(QueryResult result)
|
||||
{
|
||||
// 0 1 2
|
||||
// SetPQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
@@ -23664,7 +23664,7 @@ void Player::SetMap(Map * map)
|
||||
m_mapRef.link(map, this);
|
||||
}
|
||||
|
||||
void Player::_LoadGlyphs(QueryResult_AutoPtr result)
|
||||
void Player::_LoadGlyphs(QueryResult result)
|
||||
{
|
||||
// SetPQuery(PLAYER_LOGIN_QUERY_LOADGLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 from character_glyphs WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
if (!result)
|
||||
@@ -23698,7 +23698,7 @@ void Player::_SaveGlyphs(SQLTransaction& trans)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::_LoadTalents(QueryResult_AutoPtr result)
|
||||
void Player::_LoadTalents(QueryResult result)
|
||||
{
|
||||
// SetPQuery(PLAYER_LOGIN_QUERY_LOADTALENTS, "SELECT spell, spec FROM character_talent WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
if (result)
|
||||
@@ -23901,7 +23901,7 @@ void Player::ActivateSpec(uint8 spec)
|
||||
m_usedTalentCount = spentTalents;
|
||||
InitTalentForLevel();
|
||||
|
||||
if (QueryResult_AutoPtr result =
|
||||
if (QueryResult result =
|
||||
CharacterDatabase.PQuery("SELECT button,action,type FROM character_action WHERE guid = '%u' AND spec = '%u' ORDER BY button", GetGUIDLow(), m_activeSpec))
|
||||
_LoadActions(result);
|
||||
|
||||
@@ -24149,9 +24149,9 @@ void Player::SetRandomWinner(bool isWinner)
|
||||
CharacterDatabase.PExecute("INSERT INTO character_battleground_random (guid) VALUES ('%u')", GetGUIDLow());
|
||||
}
|
||||
|
||||
void Player::_LoadRandomBGStatus(QueryResult_AutoPtr result)
|
||||
void Player::_LoadRandomBGStatus(QueryResult result)
|
||||
{
|
||||
//QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT guid FROM character_battleground_random WHERE guid = '%u'", GetGUIDLow());
|
||||
//QueryResult result = CharacterDatabase.PQuery("SELECT guid FROM character_battleground_random WHERE guid = '%u'", GetGUIDLow());
|
||||
|
||||
if (result)
|
||||
m_IsBGRandomWinner = true;
|
||||
|
||||
@@ -1022,7 +1022,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
void Update(uint32 time);
|
||||
|
||||
static bool BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data);
|
||||
static bool BuildEnumData(QueryResult result, WorldPacket * p_data);
|
||||
|
||||
void SetInWater(bool apply);
|
||||
|
||||
@@ -1629,7 +1629,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void RemoveCategoryCooldown(uint32 cat);
|
||||
void RemoveArenaSpellCooldowns();
|
||||
void RemoveAllSpellCooldown();
|
||||
void _LoadSpellCooldowns(QueryResult_AutoPtr result);
|
||||
void _LoadSpellCooldowns(QueryResult result);
|
||||
void _SaveSpellCooldowns(SQLTransaction& trans);
|
||||
void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; }
|
||||
void UpdatePotionCooldown(Spell* spell = NULL);
|
||||
@@ -2414,30 +2414,30 @@ class Player : public Unit, public GridObject<Player>
|
||||
/*** LOAD SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
void _LoadActions(QueryResult_AutoPtr result);
|
||||
void _LoadAuras(QueryResult_AutoPtr result, uint32 timediff);
|
||||
void _LoadActions(QueryResult result);
|
||||
void _LoadAuras(QueryResult result, uint32 timediff);
|
||||
void _LoadGlyphAuras();
|
||||
void _LoadBoundInstances(QueryResult_AutoPtr result);
|
||||
void _LoadInventory(QueryResult_AutoPtr result, uint32 timediff);
|
||||
void _LoadMailInit(QueryResult_AutoPtr resultUnread, QueryResult_AutoPtr resultDelivery);
|
||||
void _LoadBoundInstances(QueryResult result);
|
||||
void _LoadInventory(QueryResult result, uint32 timediff);
|
||||
void _LoadMailInit(QueryResult resultUnread, QueryResult resultDelivery);
|
||||
void _LoadMail();
|
||||
void _LoadMailedItems(Mail *mail);
|
||||
void _LoadQuestStatus(QueryResult_AutoPtr result);
|
||||
void _LoadDailyQuestStatus(QueryResult_AutoPtr result);
|
||||
void _LoadWeeklyQuestStatus(QueryResult_AutoPtr result);
|
||||
void _LoadRandomBGStatus(QueryResult_AutoPtr result);
|
||||
void _LoadGroup(QueryResult_AutoPtr result);
|
||||
void _LoadSkills(QueryResult_AutoPtr result);
|
||||
void _LoadSpells(QueryResult_AutoPtr result);
|
||||
void _LoadFriendList(QueryResult_AutoPtr result);
|
||||
bool _LoadHomeBind(QueryResult_AutoPtr result);
|
||||
void _LoadDeclinedNames(QueryResult_AutoPtr result);
|
||||
void _LoadArenaTeamInfo(QueryResult_AutoPtr result);
|
||||
void _LoadArenaStatsInfo(QueryResult_AutoPtr result);
|
||||
void _LoadEquipmentSets(QueryResult_AutoPtr result);
|
||||
void _LoadBGData(QueryResult_AutoPtr result);
|
||||
void _LoadGlyphs(QueryResult_AutoPtr result);
|
||||
void _LoadTalents(QueryResult_AutoPtr result);
|
||||
void _LoadQuestStatus(QueryResult result);
|
||||
void _LoadDailyQuestStatus(QueryResult result);
|
||||
void _LoadWeeklyQuestStatus(QueryResult result);
|
||||
void _LoadRandomBGStatus(QueryResult result);
|
||||
void _LoadGroup(QueryResult result);
|
||||
void _LoadSkills(QueryResult result);
|
||||
void _LoadSpells(QueryResult result);
|
||||
void _LoadFriendList(QueryResult result);
|
||||
bool _LoadHomeBind(QueryResult result);
|
||||
void _LoadDeclinedNames(QueryResult result);
|
||||
void _LoadArenaTeamInfo(QueryResult result);
|
||||
void _LoadArenaStatsInfo(QueryResult result);
|
||||
void _LoadEquipmentSets(QueryResult result);
|
||||
void _LoadBGData(QueryResult result);
|
||||
void _LoadGlyphs(QueryResult result);
|
||||
void _LoadTalents(QueryResult result);
|
||||
|
||||
/*********************************************************/
|
||||
/*** SAVE SYSTEM ***/
|
||||
|
||||
@@ -289,7 +289,7 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
|
||||
}
|
||||
}
|
||||
|
||||
PlayerSocial *SocialMgr::LoadFromDB(QueryResult_AutoPtr result, uint32 guid)
|
||||
PlayerSocial *SocialMgr::LoadFromDB(QueryResult result, uint32 guid)
|
||||
{
|
||||
PlayerSocial *social = &m_socialMap[guid];
|
||||
social->SetPlayerGUID(guid);
|
||||
|
||||
@@ -153,7 +153,7 @@ class SocialMgr
|
||||
void SendFriendStatus(Player *player, FriendsResult result, uint32 friend_guid, bool broadcast);
|
||||
void BroadcastToFriendListers(Player *player, WorldPacket *packet);
|
||||
// Loading
|
||||
PlayerSocial *LoadFromDB(QueryResult_AutoPtr result, uint32 guid);
|
||||
PlayerSocial *LoadFromDB(QueryResult result, uint32 guid);
|
||||
private:
|
||||
SocialMap m_socialMap;
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
void MapManager::LoadTransports()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT guid, entry, name, period, ScriptName FROM transports");
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid, entry, name, period, ScriptName FROM transports");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -144,7 +144,7 @@ void MapManager::LoadTransportNPCs()
|
||||
{
|
||||
// Spawn NPCs linked to the transport
|
||||
// 0 1 2 3 4 5 6 7
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO, emote FROM creature_transport");
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO, emote FROM creature_transport");
|
||||
uint32 count = 0;
|
||||
|
||||
if (!result)
|
||||
@@ -705,7 +705,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
|
||||
tguid = currenttguid;
|
||||
}
|
||||
else
|
||||
currenttguid = std::max(tguid,currenttguid);
|
||||
currenttguid = std::max(tguid, currenttguid);
|
||||
|
||||
pCreature->SetGUIDTransport(tguid);
|
||||
sScriptMgr.OnAddCreaturePassenger(this, pCreature);
|
||||
|
||||
@@ -197,7 +197,7 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite)
|
||||
void GameEventMgr::LoadFromDB()
|
||||
{
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event");
|
||||
QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event");
|
||||
if (!result)
|
||||
{
|
||||
sLog.outString(">> Table game_event is empty.");
|
||||
@@ -212,7 +212,7 @@ void GameEventMgr::LoadFromDB()
|
||||
mGameEvent.resize(max_event_id+1);
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event");
|
||||
if (!result)
|
||||
{
|
||||
mGameEvent.clear();
|
||||
@@ -1073,7 +1073,7 @@ uint32 GameEventMgr::Initialize() // return the next e
|
||||
|
||||
void GameEventMgr::StartArenaSeason()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID));
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID));
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -429,7 +429,7 @@ void ObjectMgr::LoadCreatureLocales()
|
||||
{
|
||||
mCreatureLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,name_loc1,subname_loc1,name_loc2,subname_loc2,name_loc3,subname_loc3,name_loc4,subname_loc4,name_loc5,subname_loc5,name_loc6,subname_loc6,name_loc7,subname_loc7,name_loc8,subname_loc8 FROM locales_creature");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,name_loc1,subname_loc1,name_loc2,subname_loc2,name_loc3,subname_loc3,name_loc4,subname_loc4,name_loc5,subname_loc5,name_loc6,subname_loc6,name_loc7,subname_loc7,name_loc8,subname_loc8 FROM locales_creature");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
@@ -464,7 +464,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales()
|
||||
{
|
||||
mGossipMenuItemsLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT menu_id,id,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT menu_id,id,"
|
||||
"option_text_loc1,box_text_loc1,option_text_loc2,box_text_loc2,"
|
||||
"option_text_loc3,box_text_loc3,option_text_loc4,box_text_loc4,"
|
||||
"option_text_loc5,box_text_loc5,option_text_loc6,box_text_loc6,"
|
||||
@@ -505,7 +505,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
|
||||
{
|
||||
mPointOfInterestLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,icon_name_loc1,icon_name_loc2,icon_name_loc3,icon_name_loc4,icon_name_loc5,icon_name_loc6,icon_name_loc7,icon_name_loc8 FROM locales_points_of_interest");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,icon_name_loc1,icon_name_loc2,icon_name_loc3,icon_name_loc4,icon_name_loc5,icon_name_loc6,icon_name_loc7,icon_name_loc8 FROM locales_points_of_interest");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
@@ -1179,7 +1179,7 @@ bool ObjectMgr::CheckCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) const
|
||||
void ObjectMgr::LoadCreatureLinkedRespawn()
|
||||
{
|
||||
mCreatureLinkedRespawnMap.clear();
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT guid, linkedGuid FROM creature_linked_respawn ORDER BY guid ASC");
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid, linkedGuid FROM creature_linked_respawn ORDER BY guid ASC");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -1236,7 +1236,7 @@ void ObjectMgr::LoadCreatures()
|
||||
{
|
||||
uint32 count = 0;
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid,"
|
||||
// 4 5 6 7 8 9 10 11
|
||||
"equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint,"
|
||||
// 12 13 14 15 16 17 18 19
|
||||
@@ -1590,7 +1590,7 @@ void ObjectMgr::LoadGameobjects()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation,"
|
||||
// 7 8 9 10 11 12 13 14 15 16 17
|
||||
"rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, event, pool_entry "
|
||||
"FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid "
|
||||
@@ -1767,7 +1767,7 @@ void ObjectMgr::LoadCreatureRespawnTimes()
|
||||
{
|
||||
uint32 count = 0;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT guid,respawntime,instance FROM creature_respawn");
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid,respawntime,instance FROM creature_respawn");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -1807,7 +1807,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT guid,respawntime,instance FROM gameobject_respawn");
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid,respawntime,instance FROM gameobject_respawn");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -1848,7 +1848,7 @@ uint64 ObjectMgr::GetPlayerGUIDByName(std::string name) const
|
||||
CharacterDatabase.escape_string(name);
|
||||
|
||||
// Player name safe to sending to DB (checked at login) and this function using
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE name = '%s'", name.c_str());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE name = '%s'", name.c_str());
|
||||
if (result)
|
||||
guid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
|
||||
@@ -1864,7 +1864,7 @@ bool ObjectMgr::GetPlayerNameByGUID(const uint64 &guid, std::string &name) const
|
||||
return true;
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -1883,7 +1883,7 @@ uint32 ObjectMgr::GetPlayerTeamByGUID(const uint64 &guid) const
|
||||
return Player::TeamForRace(player->getRace());
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT race FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT race FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -1902,7 +1902,7 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(const uint64 &guid) const
|
||||
return player->GetSession()->GetAccountId();
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
if (result)
|
||||
{
|
||||
uint32 acc = (*result)[0].GetUInt32();
|
||||
@@ -1914,7 +1914,7 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(const uint64 &guid) const
|
||||
|
||||
uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(const std::string& name) const
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", name.c_str());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", name.c_str());
|
||||
if (result)
|
||||
{
|
||||
uint32 acc = (*result)[0].GetUInt32();
|
||||
@@ -1928,7 +1928,7 @@ void ObjectMgr::LoadItemLocales()
|
||||
{
|
||||
mItemLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,name_loc1,description_loc1,name_loc2,description_loc2,name_loc3,description_loc3,name_loc4,description_loc4,name_loc5,description_loc5,name_loc6,description_loc6,name_loc7,description_loc7,name_loc8,description_loc8 FROM locales_item");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,name_loc1,description_loc1,name_loc2,description_loc2,name_loc3,description_loc3,name_loc4,description_loc4,name_loc5,description_loc5,name_loc6,description_loc6,name_loc7,description_loc7,name_loc8,description_loc8 FROM locales_item");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
@@ -2424,7 +2424,7 @@ void ObjectMgr::LoadItemSetNameLocales()
|
||||
{
|
||||
mItemSetNameLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT `entry`,`name_loc1`,`name_loc2`,`name_loc3`,`name_loc4`,`name_loc5`,`name_loc6`,`name_loc7`,`name_loc8` FROM `locales_item_set_names`");
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`,`name_loc1`,`name_loc2`,`name_loc3`,`name_loc4`,`name_loc5`,`name_loc6`,`name_loc7`,`name_loc8` FROM `locales_item_set_names`");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
@@ -2455,7 +2455,7 @@ void ObjectMgr::LoadItemSetNames()
|
||||
{
|
||||
mItemSetNameMap.clear(); // needed for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT `entry`,`name`,`InventoryType` FROM `item_set_names`");
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`,`name`,`InventoryType` FROM `item_set_names`");
|
||||
|
||||
uint32 count = 0;
|
||||
std::set<uint32> itemSetItems;
|
||||
@@ -2542,7 +2542,7 @@ void ObjectMgr::LoadVehicleAccessories()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT `entry`,`accessory_entry`,`seat_id`,`minion` FROM `vehicle_accessory`");
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`,`accessory_entry`,`seat_id`,`minion` FROM `vehicle_accessory`");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2594,7 +2594,7 @@ void ObjectMgr::LoadVehicleScaling()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT `entry`,`baseItemLevel`,`scalingFactor` FROM `vehicle_scaling_info`");
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`,`baseItemLevel`,`scalingFactor` FROM `vehicle_scaling_info`");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2638,7 +2638,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
// Loading levels data
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor FROM pet_levelstats");
|
||||
QueryResult result = WorldDatabase.Query("SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor FROM pet_levelstats");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -2791,7 +2791,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
// Load playercreate
|
||||
{
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");
|
||||
QueryResult result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -2883,7 +2883,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outString("Loading Player Create Items Data...");
|
||||
{
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT race, class, itemid, amount FROM playercreateinfo_item");
|
||||
QueryResult result = WorldDatabase.Query("SELECT race, class, itemid, amount FROM playercreateinfo_item");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -2961,7 +2961,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outString("Loading Player Create Spell Data...");
|
||||
{
|
||||
|
||||
QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL);
|
||||
QueryResult result = QueryResult(NULL);
|
||||
if (sWorld.getBoolConfig(CONFIG_START_ALL_SPELLS))
|
||||
result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom");
|
||||
else
|
||||
@@ -3026,7 +3026,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outString("Loading Player Create Action Data...");
|
||||
{
|
||||
// 0 1 2 3 4
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT race, class, button, action, type FROM playercreateinfo_action");
|
||||
QueryResult result = WorldDatabase.Query("SELECT race, class, button, action, type FROM playercreateinfo_action");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -3077,7 +3077,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outString("Loading Player Create Level HP/Mana Data...");
|
||||
{
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT class, level, basehp, basemana FROM player_classlevelstats");
|
||||
QueryResult result = WorldDatabase.Query("SELECT class, level, basehp, basemana FROM player_classlevelstats");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -3162,7 +3162,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outString("Loading Player Create Level Stats Data...");
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT race, class, level, str, agi, sta, inte, spi FROM player_levelstats");
|
||||
QueryResult result = WorldDatabase.Query("SELECT race, class, level, str, agi, sta, inte, spi FROM player_levelstats");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -3284,7 +3284,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
mPlayerXPperLevel[level] = 0;
|
||||
|
||||
// 0 1
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT lvl, xp_for_next_level FROM player_xp_for_level");
|
||||
QueryResult result = WorldDatabase.Query("SELECT lvl, xp_for_next_level FROM player_xp_for_level");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -3450,7 +3450,7 @@ void ObjectMgr::LoadGuilds()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT guild.guildid,guild.name,leaderguid,EmblemStyle,EmblemColor,BorderStyle,BorderColor,"
|
||||
QueryResult result = CharacterDatabase.Query("SELECT guild.guildid,guild.name,leaderguid,EmblemStyle,EmblemColor,BorderStyle,BorderColor,"
|
||||
// 7 8 9 10 11 12
|
||||
"BackgroundColor,info,motd,createdate,BankMoney,COUNT(guild_bank_tab.guildid) "
|
||||
"FROM guild LEFT JOIN guild_bank_tab ON guild.guildid = guild_bank_tab.guildid GROUP BY guild.guildid ORDER BY guildid ASC");
|
||||
@@ -3469,11 +3469,11 @@ void ObjectMgr::LoadGuilds()
|
||||
|
||||
// load guild ranks
|
||||
// 0 1 2 3 4
|
||||
QueryResult_AutoPtr guildRanksResult = CharacterDatabase.Query("SELECT guildid,rid,rname,rights,BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
|
||||
QueryResult guildRanksResult = CharacterDatabase.Query("SELECT guildid,rid,rname,rights,BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
|
||||
|
||||
// load guild members
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr guildMembersResult = CharacterDatabase.Query("SELECT guildid,guild_member.guid,rank,pnote,offnote,BankResetTimeMoney,BankRemMoney,"
|
||||
QueryResult guildMembersResult = CharacterDatabase.Query("SELECT guildid,guild_member.guid,rank,pnote,offnote,BankResetTimeMoney,BankRemMoney,"
|
||||
// 7 8 9 10 11 12
|
||||
"BankResetTimeTab0,BankRemSlotsTab0,BankResetTimeTab1,BankRemSlotsTab1,BankResetTimeTab2,BankRemSlotsTab2,"
|
||||
// 13 14 15 16 17 18
|
||||
@@ -3484,7 +3484,7 @@ void ObjectMgr::LoadGuilds()
|
||||
|
||||
// load guild bank tab rights
|
||||
// 0 1 2 3 4
|
||||
QueryResult_AutoPtr 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(result->GetRowCount());
|
||||
|
||||
@@ -3528,7 +3528,7 @@ void ObjectMgr::LoadArenaTeams()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT arena_team.arenateamid,name,captainguid,type,BackgroundColor,EmblemStyle,"
|
||||
QueryResult result = CharacterDatabase.Query("SELECT arena_team.arenateamid,name,captainguid,type,BackgroundColor,EmblemStyle,"
|
||||
// 6 7 8 9 10 11 12 13 14
|
||||
"EmblemColor,BorderStyle,BorderColor, rating,games,wins,played,wins2,rank "
|
||||
"FROM arena_team LEFT JOIN arena_team_stats ON arena_team.arenateamid = arena_team_stats.arenateamid ORDER BY arena_team.arenateamid ASC");
|
||||
@@ -3546,7 +3546,7 @@ void ObjectMgr::LoadArenaTeams()
|
||||
}
|
||||
|
||||
// load arena_team members
|
||||
QueryResult_AutoPtr arenaTeamMembersResult = CharacterDatabase.Query(
|
||||
QueryResult arenaTeamMembersResult = CharacterDatabase.Query(
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
"SELECT arenateamid,member.guid,played_week,wons_week,played_season,wons_season,name,class "
|
||||
"FROM arena_team_member member LEFT JOIN characters chars on member.guid = chars.guid ORDER BY member.arenateamid ASC");
|
||||
@@ -3594,7 +3594,7 @@ void ObjectMgr::LoadGroups()
|
||||
|
||||
// ----------------------- Load Group definitions
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups");
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups");
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -3713,7 +3713,7 @@ void ObjectMgr::LoadQuests()
|
||||
mExclusiveQuestGroups.clear();
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClassMask, MinLevel, MaxLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClassMask, MinLevel, MaxLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue,"
|
||||
// 10 11 12 13 14 15 16 17 18 19
|
||||
"RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime,"
|
||||
// 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
||||
@@ -4405,7 +4405,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||
{
|
||||
mQuestLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,"
|
||||
"Title_loc1,Details_loc1,Objectives_loc1,OfferRewardText_loc1,RequestItemsText_loc1,EndText_loc1,CompletedText_loc1,ObjectiveText1_loc1,ObjectiveText2_loc1,ObjectiveText3_loc1,ObjectiveText4_loc1,"
|
||||
"Title_loc2,Details_loc2,Objectives_loc2,OfferRewardText_loc2,RequestItemsText_loc2,EndText_loc2,CompletedText_loc2,ObjectiveText1_loc2,ObjectiveText2_loc2,ObjectiveText3_loc2,ObjectiveText4_loc2,"
|
||||
"Title_loc3,Details_loc3,Objectives_loc3,OfferRewardText_loc3,RequestItemsText_loc3,EndText_loc3,CompletedText_loc3,ObjectiveText1_loc3,ObjectiveText2_loc3,ObjectiveText3_loc3,ObjectiveText4_loc3,"
|
||||
@@ -4487,7 +4487,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
|
||||
bool isSpellScriptTable = (type == SCRIPTS_SPELL);
|
||||
char buff[125];
|
||||
sprintf(buff, "SELECT id,delay,command,datalong,datalong2,dataint,x,y,z,o%s FROM %s", isSpellScriptTable ? ",effIndex" : "", tableName.c_str());
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query(buff);
|
||||
QueryResult result = WorldDatabase.Query(buff);
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -4908,7 +4908,7 @@ void ObjectMgr::LoadWaypointScripts()
|
||||
|
||||
for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr)
|
||||
{
|
||||
QueryResult_AutoPtr query = WorldDatabase.PQuery("SELECT * FROM waypoint_data WHERE action = %u", itr->first);
|
||||
QueryResult query = WorldDatabase.PQuery("SELECT * FROM waypoint_data WHERE action = %u", itr->first);
|
||||
if (!query || !query->GetRowCount())
|
||||
sLog.outErrorDb("There is no waypoint which links to the waypoint script %u", itr->first);
|
||||
}
|
||||
@@ -4917,7 +4917,7 @@ void ObjectMgr::LoadWaypointScripts()
|
||||
void ObjectMgr::LoadSpellScriptNames()
|
||||
{
|
||||
mSpellScripts.clear(); // need for reload case
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT spell_id, ScriptName FROM spell_script_names");
|
||||
QueryResult result = WorldDatabase.Query("SELECT spell_id, ScriptName FROM spell_script_names");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -5089,7 +5089,7 @@ void ObjectMgr::LoadPageTextLocales()
|
||||
{
|
||||
mPageTextLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr 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");
|
||||
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)
|
||||
return;
|
||||
@@ -5161,7 +5161,7 @@ GossipText const *ObjectMgr::GetGossipText(uint32 Text_ID) const
|
||||
|
||||
void ObjectMgr::LoadGossipText()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT * FROM npc_text");
|
||||
QueryResult result = WorldDatabase.Query("SELECT * FROM npc_text");
|
||||
|
||||
int count = 0;
|
||||
if (!result)
|
||||
@@ -5220,7 +5220,7 @@ void ObjectMgr::LoadNpcTextLocales()
|
||||
{
|
||||
mNpcTextLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,"
|
||||
"Text0_0_loc1,Text0_1_loc1,Text1_0_loc1,Text1_1_loc1,Text2_0_loc1,Text2_1_loc1,Text3_0_loc1,Text3_1_loc1,Text4_0_loc1,Text4_1_loc1,Text5_0_loc1,Text5_1_loc1,Text6_0_loc1,Text6_1_loc1,Text7_0_loc1,Text7_1_loc1,"
|
||||
"Text0_0_loc2,Text0_1_loc2,Text1_0_loc2,Text1_1_loc2,Text2_0_loc2,Text2_1_loc2,Text3_0_loc2,Text3_1_loc1,Text4_0_loc2,Text4_1_loc2,Text5_0_loc2,Text5_1_loc2,Text6_0_loc2,Text6_1_loc2,Text7_0_loc2,Text7_1_loc2,"
|
||||
"Text0_0_loc3,Text0_1_loc3,Text1_0_loc3,Text1_1_loc3,Text2_0_loc3,Text2_1_loc3,Text3_0_loc3,Text3_1_loc1,Text4_0_loc3,Text4_1_loc3,Text5_0_loc3,Text5_1_loc3,Text6_0_loc3,Text6_1_loc3,Text7_0_loc3,Text7_1_loc3,"
|
||||
@@ -5272,7 +5272,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
if (!serverUp)
|
||||
CharacterDatabase.PExecute("DELETE FROM mail WHERE expire_time < '" UI64FMTD "' AND has_items = '0' AND body = ''", (uint64)basetime);
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,has_items,expire_time,cod,checked,mailTemplateId FROM mail WHERE expire_time < '" UI64FMTD "'", (uint64)basetime);
|
||||
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);
|
||||
@@ -5320,7 +5320,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
//delete or return mail:
|
||||
if (has_items)
|
||||
{
|
||||
QueryResult_AutoPtr resultItems = CharacterDatabase.PQuery("SELECT item_guid,item_template FROM mail_items WHERE mail_id='%u'", m->messageID);
|
||||
QueryResult resultItems = CharacterDatabase.PQuery("SELECT item_guid,item_template FROM mail_items WHERE mail_id='%u'", m->messageID);
|
||||
if (resultItems)
|
||||
{
|
||||
do
|
||||
@@ -5365,7 +5365,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
|
||||
{
|
||||
mQuestAreaTriggerMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id,quest FROM areatrigger_involvedrelation");
|
||||
QueryResult result = WorldDatabase.Query("SELECT id,quest FROM areatrigger_involvedrelation");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -5428,7 +5428,7 @@ void ObjectMgr::LoadTavernAreaTriggers()
|
||||
{
|
||||
mTavernAreaTriggerSet.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id FROM areatrigger_tavern");
|
||||
QueryResult result = WorldDatabase.Query("SELECT id FROM areatrigger_tavern");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -5470,7 +5470,7 @@ void ObjectMgr::LoadTavernAreaTriggers()
|
||||
void ObjectMgr::LoadAreaTriggerScripts()
|
||||
{
|
||||
mAreaTriggerScripts.clear(); // need for reload case
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, ScriptName FROM areatrigger_scripts");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, ScriptName FROM areatrigger_scripts");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -5618,7 +5618,7 @@ void ObjectMgr::LoadGraveyardZones()
|
||||
{
|
||||
mGraveYardMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id,ghost_zone,faction FROM game_graveyard_zone");
|
||||
QueryResult result = WorldDatabase.Query("SELECT id,ghost_zone,faction FROM game_graveyard_zone");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -5885,7 +5885,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -5953,7 +5953,7 @@ void ObjectMgr::LoadAccessRequirements()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");
|
||||
QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -6097,7 +6097,7 @@ AreaTrigger const* ObjectMgr::GetMapEntranceTrigger(uint32 Map) const
|
||||
|
||||
void ObjectMgr::SetHighestGuids()
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT MAX(guid) FROM characters");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT MAX(guid) FROM characters");
|
||||
if (result)
|
||||
m_hiCharGuid = (*result)[0].GetUInt32()+1;
|
||||
|
||||
@@ -6288,7 +6288,7 @@ void ObjectMgr::LoadGameObjectLocales()
|
||||
{
|
||||
mGameObjectLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,"
|
||||
"name_loc1,name_loc2,name_loc3,name_loc4,name_loc5,name_loc6,name_loc7,name_loc8,"
|
||||
"castbarcaption_loc1,castbarcaption_loc2,castbarcaption_loc3,castbarcaption_loc4,"
|
||||
"castbarcaption_loc5,castbarcaption_loc6,castbarcaption_loc7,castbarcaption_loc8 FROM locales_gameobject");
|
||||
@@ -6564,7 +6564,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
||||
void ObjectMgr::LoadExplorationBaseXP()
|
||||
{
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT level,basexp FROM exploration_basexp");
|
||||
QueryResult result = WorldDatabase.Query("SELECT level,basexp FROM exploration_basexp");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -6610,7 +6610,7 @@ uint32 ObjectMgr::GetXPForLevel(uint8 level)
|
||||
void ObjectMgr::LoadPetNames()
|
||||
{
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT word,entry,half FROM pet_name_generation");
|
||||
QueryResult result = WorldDatabase.Query("SELECT word,entry,half FROM pet_name_generation");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -6647,7 +6647,7 @@ void ObjectMgr::LoadPetNames()
|
||||
|
||||
void ObjectMgr::LoadPetNumber()
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT MAX(id) FROM character_pet");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT MAX(id) FROM character_pet");
|
||||
if (result)
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
@@ -6687,7 +6687,7 @@ void ObjectMgr::LoadCorpses()
|
||||
{
|
||||
uint32 count = 0;
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT position_x, position_y, position_z, orientation, map, displayId, itemCache, bytes1, bytes2, guild, flags, dynFlags, time, corpse_type, instance, phaseMask, guid, player FROM corpse WHERE corpse_type <> 0");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT position_x, position_y, position_z, orientation, map, displayId, itemCache, bytes1, bytes2, guild, flags, dynFlags, time, corpse_type, instance, phaseMask, guid, player FROM corpse WHERE corpse_type <> 0");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -6732,7 +6732,7 @@ void ObjectMgr::LoadReputationRewardRate()
|
||||
m_RepRewardRateMap.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT faction, quest_rate, creature_rate, spell_rate FROM reputation_reward_rate");
|
||||
QueryResult result = WorldDatabase.Query("SELECT faction, quest_rate, creature_rate, spell_rate FROM reputation_reward_rate");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -6804,7 +6804,7 @@ void ObjectMgr::LoadReputationOnKill()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT creature_id, RewOnKillRepFaction1, RewOnKillRepFaction2,"
|
||||
QueryResult result = WorldDatabase.Query("SELECT creature_id, RewOnKillRepFaction1, RewOnKillRepFaction2,"
|
||||
// 3 4 5 6 7 8 9
|
||||
"IsTeamAward1, MaxStanding1, RewOnKillRepValue1, IsTeamAward2, MaxStanding2, RewOnKillRepValue2, TeamDependent "
|
||||
"FROM creature_onkill_reputation");
|
||||
@@ -6880,7 +6880,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
|
||||
m_RepSpilloverTemplateMap.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template");
|
||||
QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7000,7 +7000,7 @@ void ObjectMgr::LoadPointsOfInterest()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7052,7 +7052,7 @@ void ObjectMgr::LoadQuestPOI()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT questId, id, objIndex, mapid, WorldMapAreaId, FloorId, unk3, unk4 FROM quest_poi order by questId");
|
||||
QueryResult result = WorldDatabase.Query("SELECT questId, id, objIndex, mapid, WorldMapAreaId, FloorId, unk3, unk4 FROM quest_poi order by questId");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7083,7 +7083,7 @@ void ObjectMgr::LoadQuestPOI()
|
||||
|
||||
QuestPOI POI(id, objIndex, mapId, WorldMapAreaId, FloorId, unk3, unk4);
|
||||
|
||||
QueryResult_AutoPtr points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND id='%i'", questId, id);
|
||||
QueryResult points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND id='%i'", questId, id);
|
||||
|
||||
if (points)
|
||||
{
|
||||
@@ -7112,7 +7112,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
|
||||
|
||||
mSpellClickInfoMap.clear();
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT npc_entry, spell_id, quest_start, quest_start_active, quest_end, cast_flags, aura_required, aura_forbidden, user_type FROM npc_spellclick_spells");
|
||||
QueryResult result = WorldDatabase.Query("SELECT npc_entry, spell_id, quest_start, quest_start_active, quest_end, cast_flags, aura_required, aura_forbidden, user_type FROM npc_spellclick_spells");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7331,7 +7331,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map,char const* table)
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT id,quest FROM %s",table);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT id,quest FROM %s",table);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7429,7 +7429,7 @@ void ObjectMgr::LoadReservedPlayersNames()
|
||||
{
|
||||
m_ReservedNames.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT name FROM reserved_name");
|
||||
QueryResult result = WorldDatabase.Query("SELECT name FROM reserved_name");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
@@ -7737,7 +7737,7 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max
|
||||
++itr;
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT entry,content_default,content_loc1,content_loc2,content_loc3,content_loc4,content_loc5,content_loc6,content_loc7,content_loc8 FROM %s",table);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT entry,content_default,content_loc1,content_loc2,content_loc3,content_loc4,content_loc5,content_loc6,content_loc7,content_loc8 FROM %s",table);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7830,7 +7830,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
|
||||
mFishingBaseForArea.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7933,7 +7933,7 @@ void ObjectMgr::LoadGameTele()
|
||||
m_GameTeleMap.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele");
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -8063,7 +8063,7 @@ void ObjectMgr::LoadMailLevelRewards()
|
||||
m_mailLevelRewardMap.clear(); // for reload case
|
||||
|
||||
uint32 count = 0;
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward");
|
||||
QueryResult result = WorldDatabase.Query("SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -8213,7 +8213,7 @@ bool ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, Field *fields, std
|
||||
}
|
||||
int ObjectMgr::LoadReferenceTrainer(uint32 trainer, int32 spell, std::set<uint32> *skip_trainers, std::set<uint32> *talentIds)
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer WHERE entry='%d'", spell);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer WHERE entry='%d'", spell);
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
@@ -8242,7 +8242,7 @@ void ObjectMgr::LoadTrainerSpell()
|
||||
|
||||
std::set<uint32> skip_trainers;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("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)
|
||||
{
|
||||
@@ -8282,7 +8282,7 @@ void ObjectMgr::LoadTrainerSpell()
|
||||
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
|
||||
{
|
||||
// find all items from the reference vendor
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d' ORDER BY slot ASC", item);
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d' ORDER BY slot ASC", item);
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
@@ -8325,7 +8325,7 @@ void ObjectMgr::LoadVendors()
|
||||
|
||||
std::set<uint32> skip_vendors;
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC");
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -8377,7 +8377,7 @@ void ObjectMgr::LoadNpcTextId()
|
||||
|
||||
m_mCacheNpcTextIdMap.clear();
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip");
|
||||
QueryResult result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip");
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -8426,7 +8426,7 @@ void ObjectMgr::LoadGossipMenu()
|
||||
{
|
||||
m_mGossipMenusMap.clear();
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, text_id FROM gossip_menu");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, text_id FROM gossip_menu");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -8474,7 +8474,7 @@ void ObjectMgr::LoadGossipMenuItems()
|
||||
{
|
||||
m_mGossipMenuItemsMap.clear();
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query(
|
||||
QueryResult result = WorldDatabase.Query(
|
||||
"SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, "
|
||||
"action_menu_id, action_poi_id, action_script_id, box_coded, box_money, box_text "
|
||||
"FROM gossip_menu_option ORDER BY menu_id, id");
|
||||
@@ -8681,7 +8681,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
void ObjectMgr::LoadScriptNames()
|
||||
{
|
||||
m_scriptNames.push_back("");
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query(
|
||||
QueryResult result = WorldDatabase.Query(
|
||||
"SELECT DISTINCT(ScriptName) FROM achievement_criteria_data WHERE ScriptName <> '' AND type = 11 "
|
||||
"UNION "
|
||||
"SELECT DISTINCT(ScriptName) FROM battleground_template WHERE ScriptName <> '' "
|
||||
@@ -8858,7 +8858,7 @@ CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unit
|
||||
|
||||
void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor FROM creature_classlevelstats");
|
||||
QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor FROM creature_classlevelstats");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -8933,7 +8933,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
|
||||
void ObjectMgr::LoadFactionChangeAchievements()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_achievement");
|
||||
QueryResult result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_achievement");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -8978,7 +8978,7 @@ void ObjectMgr::LoadFactionChangeAchievements()
|
||||
|
||||
void ObjectMgr::LoadFactionChangeItems()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_items");
|
||||
QueryResult result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_items");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -9023,7 +9023,7 @@ void ObjectMgr::LoadFactionChangeItems()
|
||||
|
||||
void ObjectMgr::LoadFactionChangeSpells()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_spells");
|
||||
QueryResult result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_spells");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -9068,7 +9068,7 @@ void ObjectMgr::LoadFactionChangeSpells()
|
||||
|
||||
void ObjectMgr::LoadFactionChangeReputations()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_reputations");
|
||||
QueryResult result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_reputations");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -136,7 +136,7 @@ bool Group::Create(const uint64 &guid, const char * name)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Group::LoadGroupFromDB(const uint32 &groupGuid, QueryResult_AutoPtr result, bool loadMembers)
|
||||
bool Group::LoadGroupFromDB(const uint32 &groupGuid, QueryResult result, bool loadMembers)
|
||||
{
|
||||
if (isBGGroup())
|
||||
return false;
|
||||
|
||||
@@ -191,7 +191,7 @@ class Group
|
||||
|
||||
// group manipulation methods
|
||||
bool Create(const uint64 &guid, const char * name);
|
||||
bool LoadGroupFromDB(const uint32 &guid, QueryResult_AutoPtr result, bool loadMembers = true);
|
||||
bool LoadGroupFromDB(const uint32 &guid, QueryResult result, bool loadMembers = true);
|
||||
bool LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles);
|
||||
bool AddInvite(Player *player);
|
||||
uint32 RemoveInvite(Player *player);
|
||||
|
||||
@@ -147,7 +147,7 @@ bool Guild::AddMember(uint64 plGuid, uint32 plRank)
|
||||
}
|
||||
else
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT name,zone,level,class,account FROM characters WHERE guid = '%u'", GUID_LOPART(plGuid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT name,zone,level,class,account FROM characters WHERE guid = '%u'", GUID_LOPART(plGuid));
|
||||
if (!result)
|
||||
return false; // player doesn't exist
|
||||
|
||||
@@ -218,7 +218,7 @@ void Guild::SetGINFO(std::string ginfo)
|
||||
CharacterDatabase.PExecute("UPDATE guild SET info='%s' WHERE guildid='%u'", ginfo.c_str(), m_Id);
|
||||
}
|
||||
|
||||
bool Guild::LoadGuildFromDB(QueryResult_AutoPtr guildDataResult)
|
||||
bool Guild::LoadGuildFromDB(QueryResult guildDataResult)
|
||||
{
|
||||
if (!guildDataResult)
|
||||
return false;
|
||||
@@ -274,7 +274,7 @@ bool Guild::CheckGuildStructure()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Guild::LoadRanksFromDB(QueryResult_AutoPtr guildRanksResult)
|
||||
bool Guild::LoadRanksFromDB(QueryResult guildRanksResult)
|
||||
{
|
||||
if (!guildRanksResult)
|
||||
{
|
||||
@@ -351,7 +351,7 @@ bool Guild::LoadRanksFromDB(QueryResult_AutoPtr guildRanksResult)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Guild::LoadMembersFromDB(QueryResult_AutoPtr guildMembersResult)
|
||||
bool Guild::LoadMembersFromDB(QueryResult guildMembersResult)
|
||||
{
|
||||
if (!guildMembersResult)
|
||||
return false;
|
||||
@@ -876,7 +876,7 @@ void Guild::DisplayGuildEventLog(WorldSession *session)
|
||||
void Guild::LoadGuildEventLogFromDB()
|
||||
{
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp FROM guild_eventlog WHERE guildid=%u ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, GUILD_EVENTLOG_MAX_RECORDS);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp FROM guild_eventlog WHERE guildid=%u ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, GUILD_EVENTLOG_MAX_RECORDS);
|
||||
if (!result)
|
||||
return;
|
||||
bool isNextLogGuidSet = false;
|
||||
@@ -1128,7 +1128,7 @@ uint32 Guild::GetBankRights(uint32 rankId, uint8 TabId) const
|
||||
void Guild::LoadGuildBankFromDB()
|
||||
{
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT TabId, TabName, TabIcon, TabText FROM guild_bank_tab WHERE guildid='%u' ORDER BY TabId", m_Id);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT TabId, TabName, TabIcon, TabText FROM guild_bank_tab WHERE guildid='%u' ORDER BY TabId", m_Id);
|
||||
if (!result)
|
||||
{
|
||||
m_TabListMap.clear();
|
||||
@@ -1390,7 +1390,7 @@ uint32 Guild::GetBankSlotPerDay(uint32 rankId, uint8 TabId)
|
||||
// *************************************************
|
||||
// Rights per day related
|
||||
|
||||
bool Guild::LoadBankRightsFromDB(QueryResult_AutoPtr guildBankTabRightsResult)
|
||||
bool Guild::LoadBankRightsFromDB(QueryResult guildBankTabRightsResult)
|
||||
{
|
||||
if (!guildBankTabRightsResult)
|
||||
return true;
|
||||
@@ -1437,7 +1437,7 @@ void Guild::LoadGuildBankEventLogFromDB()
|
||||
for (uint32 tabId = 0; tabId < uint32(GetPurchasedTabs()); ++tabId)
|
||||
{
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp FROM guild_bank_eventlog WHERE guildid='%u' AND TabId='%u' ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, tabId, GUILD_BANK_MAX_LOGS);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp FROM guild_bank_eventlog WHERE guildid='%u' AND TabId='%u' ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, tabId, GUILD_BANK_MAX_LOGS);
|
||||
if (!result)
|
||||
continue;
|
||||
|
||||
@@ -1478,7 +1478,7 @@ void Guild::LoadGuildBankEventLogFromDB()
|
||||
|
||||
//special handle for guild bank money log
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp FROM guild_bank_eventlog WHERE guildid='%u' AND TabId='%u' ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, GUILD_BANK_MONEY_LOGS_TAB, GUILD_BANK_MAX_LOGS);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT LogGuid, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp FROM guild_bank_eventlog WHERE guildid='%u' AND TabId='%u' ORDER BY TimeStamp DESC,LogGuid DESC LIMIT %u", m_Id, GUILD_BANK_MONEY_LOGS_TAB, GUILD_BANK_MAX_LOGS);
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
|
||||
@@ -328,10 +328,10 @@ class Guild
|
||||
uint32 GetMemberSize() const { return members.size(); }
|
||||
uint32 GetAccountsNumber() const { return m_accountsNumber; }
|
||||
|
||||
bool LoadGuildFromDB(QueryResult_AutoPtr guildDataResult);
|
||||
bool LoadGuildFromDB(QueryResult guildDataResult);
|
||||
bool CheckGuildStructure();
|
||||
bool LoadRanksFromDB(QueryResult_AutoPtr guildRanksResult);
|
||||
bool LoadMembersFromDB(QueryResult_AutoPtr guildMembersResult);
|
||||
bool LoadRanksFromDB(QueryResult guildRanksResult);
|
||||
bool LoadMembersFromDB(QueryResult guildMembersResult);
|
||||
|
||||
void SetMemberStats(uint64 guid);
|
||||
|
||||
@@ -424,7 +424,7 @@ class Guild
|
||||
uint32 GetBankMoneyPerDay(uint32 rankId);
|
||||
uint32 GetBankSlotPerDay(uint32 rankId, uint8 TabId);
|
||||
// rights per day
|
||||
bool LoadBankRightsFromDB(QueryResult_AutoPtr guildBankTabRightsResult);
|
||||
bool LoadBankRightsFromDB(QueryResult guildBankTabRightsResult);
|
||||
// Guild Bank Event Logs
|
||||
void LoadGuildBankEventLogFromDB();
|
||||
void DisplayGuildBankLogs(WorldSession *session, uint8 TabId);
|
||||
|
||||
@@ -230,7 +230,7 @@ void InstanceSaveManager::_DelHelper(const char *fields, const char *table, cons
|
||||
vsnprintf(szQueryTail, MAX_QUERY_LEN, queryTail, ap);
|
||||
va_end(ap);
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT %s FROM %s %s", fields, table, szQueryTail);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT %s FROM %s %s", fields, table, szQueryTail);
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
@@ -270,7 +270,7 @@ void InstanceSaveManager::CleanupInstances()
|
||||
// creature_respawn and gameobject_respawn are in another database
|
||||
// first, obtain total instance set
|
||||
std::set<uint32> InstanceSet;
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT id FROM instance");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT id FROM instance");
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
@@ -349,7 +349,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_AutoPtr result = CharacterDatabase.Query("SELECT id FROM instance");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT id FROM instance");
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
@@ -405,7 +405,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
typedef std::multimap<uint32 /*PAIR32(map,difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances;
|
||||
ResetTimeMapDiffInstances mapDiffResetInstances;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance WHERE resettime > 0");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance WHERE resettime > 0");
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
|
||||
@@ -104,7 +104,7 @@ void LootStore::LoadLootTable()
|
||||
sLog.outString("%s :", GetName());
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT entry, item, ChanceOrQuestChance, lootmode, groupid, mincountOrRef, maxcount FROM %s",GetName());
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT entry, item, ChanceOrQuestChance, lootmode, groupid, mincountOrRef, maxcount FROM %s",GetName());
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -2463,7 +2463,7 @@ void InstanceMap::CreateInstanceData(bool load)
|
||||
if (load)
|
||||
{
|
||||
// TODO: make a global storage for this
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT data FROM instance WHERE map = '%u' AND id = '%u'", GetId(), i_InstanceId);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT data FROM instance WHERE map = '%u' AND id = '%u'", GetId(), i_InstanceId);
|
||||
if (result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
@@ -326,7 +326,7 @@ void MapManager::InitMaxInstanceId()
|
||||
{
|
||||
i_MaxInstanceId = 0;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT MAX(id) FROM instance");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT MAX(id) FROM instance");
|
||||
if (result)
|
||||
i_MaxInstanceId = result->Fetch()[0].GetUInt32();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void WaypointStore::Free()
|
||||
|
||||
void WaypointStore::Load()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT COUNT(id) FROM waypoint_data");
|
||||
QueryResult result = WorldDatabase.Query("SELECT COUNT(id) FROM waypoint_data");
|
||||
if (!result)
|
||||
{
|
||||
sLog.outError("an error occured while loading the table `waypoint_data` (maybe it doesn't exist ?)");
|
||||
@@ -107,7 +107,7 @@ void WaypointStore::UpdatePath(uint32 id)
|
||||
if (waypoint_map.find(id)!= waypoint_map.end())
|
||||
waypoint_map[id]->clear();
|
||||
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
result = WorldDatabase.PQuery("SELECT point,position_x,position_y,position_z,move_flag,delay,action,action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void OutdoorPvPMgr::LoadTemplates()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT TypeId, ScriptName FROM outdoorpvp_template");
|
||||
QueryResult result = WorldDatabase.Query("SELECT TypeId, ScriptName FROM outdoorpvp_template");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -380,7 +380,7 @@ PoolMgr::PoolMgr()
|
||||
|
||||
void PoolMgr::LoadFromDB()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template");
|
||||
QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template");
|
||||
if (!result)
|
||||
{
|
||||
sLog.outString(">> Table pool_template is empty.");
|
||||
@@ -656,7 +656,7 @@ void PoolMgr::LoadFromDB()
|
||||
// The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks
|
||||
void PoolMgr::Initialize()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry, pool_pool.pool_id, pool_pool.mother_pool FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL");
|
||||
QueryResult result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry, pool_pool.pool_id, pool_pool.mother_pool FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL");
|
||||
uint32 count=0;
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -452,7 +452,7 @@ void ReputationMgr::SetInactive(FactionState* faction, bool inactive)
|
||||
faction->Changed = true;
|
||||
}
|
||||
|
||||
void ReputationMgr::LoadFromDB(QueryResult_AutoPtr result)
|
||||
void ReputationMgr::LoadFromDB(QueryResult result)
|
||||
{
|
||||
// Set initial reputations (so everything is nifty before DB data load)
|
||||
Initialize();
|
||||
|
||||
@@ -59,7 +59,6 @@ typedef std::map<RepListID,FactionState> FactionStateList;
|
||||
typedef std::map<uint32,ReputationRank> ForcedReactions;
|
||||
|
||||
class Player;
|
||||
class QueryResult;
|
||||
|
||||
class ReputationMgr
|
||||
{
|
||||
@@ -69,7 +68,7 @@ class ReputationMgr
|
||||
~ReputationMgr() {}
|
||||
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
void LoadFromDB(QueryResult_AutoPtr result);
|
||||
void LoadFromDB(QueryResult result);
|
||||
public: // statics
|
||||
static const int32 PointsInRank[MAX_REPUTATION_RANK];
|
||||
static const int32 Reputation_Cap = 42999;
|
||||
|
||||
@@ -37,7 +37,7 @@ SystemMgr& SystemMgr::Instance()
|
||||
void SystemMgr::LoadVersion()
|
||||
{
|
||||
//Get Version information
|
||||
QueryResult_AutoPtr Result = WorldDatabase.Query("SELECT script_version FROM version LIMIT 1");
|
||||
QueryResult Result = WorldDatabase.Query("SELECT script_version FROM version LIMIT 1");
|
||||
|
||||
if (Result)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ void SystemMgr::LoadScriptTexts()
|
||||
sLog.outString("TSCR: Loading Script Texts...");
|
||||
LoadTrinityStrings("script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2));
|
||||
|
||||
QueryResult_AutoPtr Result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts");
|
||||
QueryResult Result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts");
|
||||
|
||||
sLog.outString("TSCR: Loading Script Texts additional data...");
|
||||
|
||||
@@ -124,7 +124,7 @@ void SystemMgr::LoadScriptTextsCustom()
|
||||
sLog.outString("TSCR: Loading Custom Texts...");
|
||||
LoadTrinityStrings("custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3));
|
||||
|
||||
QueryResult_AutoPtr Result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts");
|
||||
QueryResult Result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts");
|
||||
|
||||
sLog.outString("TSCR: Loading Custom Texts additional data...");
|
||||
|
||||
@@ -193,7 +193,7 @@ void SystemMgr::LoadScriptWaypoints()
|
||||
uint64 uiCreatureCount = 0;
|
||||
|
||||
// Load Waypoints
|
||||
QueryResult_AutoPtr Result = WorldDatabase.Query("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry");
|
||||
QueryResult Result = WorldDatabase.Query("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry");
|
||||
if (Result)
|
||||
uiCreatureCount = Result->GetRowCount();
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ bool LoginQueryHolder::Initialize()
|
||||
return res;
|
||||
}
|
||||
|
||||
void WorldSession::HandleCharEnum(QueryResult_AutoPtr result)
|
||||
void WorldSession::HandleCharEnum(QueryResult result)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_ENUM, 100); // we guess size
|
||||
|
||||
@@ -275,7 +275,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr resultacct = LoginDatabase.PQuery("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '%d'", GetAccountId());
|
||||
QueryResult resultacct = LoginDatabase.PQuery("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '%d'", GetAccountId());
|
||||
if (resultacct)
|
||||
{
|
||||
Field *fields=resultacct->Fetch();
|
||||
@@ -289,7 +289,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", GetAccountId());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", GetAccountId());
|
||||
uint8 charcount = 0;
|
||||
if (result)
|
||||
{
|
||||
@@ -332,7 +332,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (!AllowTwoSideAccounts || skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
QueryResult_AutoPtr result2 = CharacterDatabase.PQuery("SELECT level,race,class FROM characters WHERE account = '%u' %s",
|
||||
QueryResult result2 = CharacterDatabase.PQuery("SELECT level,race,class FROM characters WHERE account = '%u' %s",
|
||||
GetAccountId(), (skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT) ? "" : "LIMIT 1");
|
||||
if (result2)
|
||||
{
|
||||
@@ -507,7 +507,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT account,name FROM characters WHERE guid='%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT account,name FROM characters WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if (result)
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
@@ -643,7 +643,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
}
|
||||
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow());
|
||||
QueryResult_AutoPtr resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD);
|
||||
QueryResult resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD);
|
||||
|
||||
if (resultGuild)
|
||||
{
|
||||
@@ -961,7 +961,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
||||
);
|
||||
}
|
||||
|
||||
void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult_AutoPtr result, std::string newname)
|
||||
void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult result, std::string newname)
|
||||
{
|
||||
if (!result)
|
||||
{
|
||||
@@ -1162,7 +1162,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||
uint8 gender, skin, face, hairStyle, hairColor, facialHair;
|
||||
recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid));
|
||||
if (!result)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||
@@ -1222,7 +1222,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||
}
|
||||
|
||||
CharacterDatabase.escape_string(newname);
|
||||
if (QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid ='%u'", GUID_LOPART(guid)))
|
||||
if (QueryResult result = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid ='%u'", GUID_LOPART(guid)))
|
||||
{
|
||||
std::string oldname = result->Fetch()[0].GetCppString();
|
||||
std::string IP_str = GetRemoteAddress();
|
||||
@@ -1357,7 +1357,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
|
||||
recv_data >> newname;
|
||||
recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face >> race;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT class, level, at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT class, level, at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid));
|
||||
if (!result)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1);
|
||||
|
||||
@@ -128,12 +128,12 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||
else
|
||||
{
|
||||
rc_team = sObjectMgr.GetPlayerTeamByGUID(rc);
|
||||
if (QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc)))
|
||||
if (QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc)))
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
mails_count = fields[0].GetUInt32();
|
||||
}
|
||||
if (QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid = '%u'", GUID_LOPART(rc)))
|
||||
if (QueryResult result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid = '%u'", GUID_LOPART(rc)))
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
receiveLevel = fields[0].GetUInt8();
|
||||
|
||||
@@ -558,7 +558,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data)
|
||||
);
|
||||
}
|
||||
|
||||
void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, std::string friendNote)
|
||||
void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string friendNote)
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
@@ -644,7 +644,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data)
|
||||
m_addIgnoreCallback = CharacterDatabase.AsyncPQuery("SELECT guid FROM characters WHERE name = '%s'", IgnoreName.c_str());
|
||||
}
|
||||
|
||||
void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult_AutoPtr result)
|
||||
void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult result)
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
@@ -1323,7 +1323,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
|
||||
|
||||
uint32 accid = plr->GetSession()->GetAccountId();
|
||||
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT username,email,last_ip FROM account WHERE id=%u", accid);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT username,email,last_ip FROM account WHERE id=%u", accid);
|
||||
if (!result)
|
||||
{
|
||||
SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str());
|
||||
|
||||
@@ -524,7 +524,7 @@ void WorldSession::SendStablePet(uint64 guid)
|
||||
);
|
||||
}
|
||||
|
||||
void WorldSession::SendStablePetCallback(QueryResult_AutoPtr result, uint64 guid)
|
||||
void WorldSession::SendStablePetCallback(QueryResult result, uint64 guid)
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
@@ -621,7 +621,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data)
|
||||
|
||||
}
|
||||
|
||||
void WorldSession::HandleStablePetCallback(QueryResult_AutoPtr result)
|
||||
void WorldSession::HandleStablePetCallback(QueryResult result)
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
@@ -680,7 +680,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
|
||||
);
|
||||
}
|
||||
|
||||
void WorldSession::HandleUnstablePetCallback(QueryResult_AutoPtr result, uint32 petnumber)
|
||||
void WorldSession::HandleUnstablePetCallback(QueryResult result, uint32 petnumber)
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
@@ -804,7 +804,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
|
||||
);
|
||||
}
|
||||
|
||||
void WorldSession::HandleStableSwapPetCallback(QueryResult_AutoPtr result, uint32 petnumber)
|
||||
void WorldSession::HandleStableSwapPetCallback(QueryResult result, uint32 petnumber)
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
|
||||
@@ -207,7 +207,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
// a petition is invalid, if both the owner and the type matches
|
||||
// we checked above, if this player is in an arenateam, so this must be
|
||||
// datacorruption
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT petitionguid FROM petition WHERE ownerguid = '%u' AND type = '%u'", _player->GetGUIDLow(), type);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT petitionguid FROM petition WHERE ownerguid = '%u' AND type = '%u'", _player->GetGUIDLow(), type);
|
||||
|
||||
std::ostringstream ssInvalidPetitionGUIDs;
|
||||
|
||||
@@ -246,7 +246,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data)
|
||||
// solve (possible) some strange compile problems with explicit use GUID_LOPART(petitionguid) at some GCC versions (wrong code optimization in compiler?)
|
||||
uint32 petitionguid_low = GUID_LOPART(petitionguid);
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", petitionguid_low);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", petitionguid_low);
|
||||
if (!result)
|
||||
{
|
||||
sLog.outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName());
|
||||
@@ -307,7 +307,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
|
||||
std::string name = "NO_NAME_FOR_GUID";
|
||||
uint8 signs = 0;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery(
|
||||
QueryResult result = CharacterDatabase.PQuery(
|
||||
"SELECT ownerguid, name, "
|
||||
" (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = '%u') AS signs, "
|
||||
" type "
|
||||
@@ -382,7 +382,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -445,7 +445,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
||||
recv_data >> petitionguid; // petition guid
|
||||
recv_data >> unk;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery(
|
||||
QueryResult result = CharacterDatabase.PQuery(
|
||||
"SELECT ownerguid, "
|
||||
" (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = '%u') AS signs, "
|
||||
" type "
|
||||
@@ -569,7 +569,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data)
|
||||
recv_data >> petitionguid; // petition guid
|
||||
sLog.outDebug("Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow());
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT ownerguid FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -602,7 +602,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -703,7 +703,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
||||
sLog.outDebug("Petition %u turned in by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow());
|
||||
|
||||
// data
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT ownerguid, name, type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid, name, type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
if (result)
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
@@ -60,7 +60,7 @@ void WorldSession::SendNameQueryOpcode(Player *p)
|
||||
|
||||
void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid)
|
||||
{
|
||||
ACE_Future<QueryResult_AutoPtr> lFutureResult =
|
||||
ACE_Future<QueryResult> lFutureResult =
|
||||
CharacterDatabase.AsyncPQuery(
|
||||
!sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) ?
|
||||
// ------- Query Without Declined Names --------
|
||||
@@ -82,7 +82,7 @@ void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid)
|
||||
// CharacterDatabase.AsyncPQuery(&WorldSession::SendNameQueryOpcodeFromDBCallBack, GetAccountId(),
|
||||
}
|
||||
|
||||
void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult_AutoPtr result)
|
||||
void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult result)
|
||||
{
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -245,7 +245,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))// wrapped?
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT entry, flags FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT entry, flags FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow());
|
||||
if (result)
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
@@ -588,7 +588,7 @@ void WorldSession::LoadGlobalAccountData()
|
||||
);
|
||||
}
|
||||
|
||||
void WorldSession::LoadAccountData(QueryResult_AutoPtr result, uint32 mask)
|
||||
void WorldSession::LoadAccountData(QueryResult result, uint32 mask)
|
||||
{
|
||||
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
|
||||
if (mask & (1 << i))
|
||||
@@ -668,7 +668,7 @@ void WorldSession::LoadTutorialsData()
|
||||
for (int aX = 0 ; aX < 8 ; ++aX)
|
||||
m_Tutorials[ aX ] = 0;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7 FROM character_tutorial WHERE account = '%u'", GetAccountId());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7 FROM character_tutorial WHERE account = '%u'", GetAccountId());
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -699,7 +699,7 @@ void WorldSession::SaveTutorialsData(SQLTransaction& trans)
|
||||
|
||||
uint32 Rows=0;
|
||||
// it's better than rebuilding indexes multiple times
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT count(*) AS r FROM character_tutorial WHERE account = '%u'", GetAccountId());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT count(*) AS r FROM character_tutorial WHERE account = '%u'", GetAccountId());
|
||||
if (result)
|
||||
Rows = result->Fetch()[0].GetUInt32();
|
||||
|
||||
@@ -959,7 +959,7 @@ void WorldSession::SetPlayer(Player *plr)
|
||||
|
||||
void WorldSession::ProcessQueryCallbacks()
|
||||
{
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
//! HandleNameQueryOpcode
|
||||
while (!m_nameQueryCallbacks.is_empty())
|
||||
|
||||
@@ -45,7 +45,6 @@ class GameObject;
|
||||
class Quest;
|
||||
class WorldPacket;
|
||||
class WorldSocket;
|
||||
class QueryResult;
|
||||
class LoginQueryHolder;
|
||||
class CharacterHandler;
|
||||
class SpellCastTargets;
|
||||
@@ -200,7 +199,7 @@ class WorldSession
|
||||
//void SendTestCreatureQueryOpcode(uint32 entry, uint64 guid, uint32 testvalue);
|
||||
void SendNameQueryOpcode(Player* p);
|
||||
void SendNameQueryOpcodeFromDB(uint64 guid);
|
||||
void SendNameQueryOpcodeFromDBCallBack(QueryResult_AutoPtr result);
|
||||
void SendNameQueryOpcodeFromDBCallBack(QueryResult result);
|
||||
|
||||
void SendTrainerList(uint64 guid);
|
||||
void SendTrainerList(uint64 guid, const std::string& strTitle);
|
||||
@@ -226,7 +225,7 @@ class WorldSession
|
||||
// Pet
|
||||
void SendPetNameQuery(uint64 guid, uint32 petnumber);
|
||||
void SendStablePet(uint64 guid);
|
||||
void SendStablePetCallback(QueryResult_AutoPtr result, uint64 guid);
|
||||
void SendStablePetCallback(QueryResult result, uint64 guid);
|
||||
void SendStableResult(uint8 guid);
|
||||
bool CheckStableMaster(uint64 guid);
|
||||
|
||||
@@ -235,7 +234,7 @@ class WorldSession
|
||||
void SetAccountData(AccountDataType type, time_t time_, std::string data);
|
||||
void SendAccountDataTimes(uint32 mask);
|
||||
void LoadGlobalAccountData();
|
||||
void LoadAccountData(QueryResult_AutoPtr result, uint32 mask);
|
||||
void LoadAccountData(QueryResult result, uint32 mask);
|
||||
void LoadTutorialsData();
|
||||
void SendTutorialsData();
|
||||
void SaveTutorialsData(SQLTransaction& trans);
|
||||
@@ -327,7 +326,7 @@ class WorldSession
|
||||
void HandleCharDeleteOpcode(WorldPacket& recvPacket);
|
||||
void HandleCharCreateOpcode(WorldPacket& recvPacket);
|
||||
void HandlePlayerLoginOpcode(WorldPacket& recvPacket);
|
||||
void HandleCharEnum(QueryResult_AutoPtr result);
|
||||
void HandleCharEnum(QueryResult result);
|
||||
void HandlePlayerLogin(LoginQueryHolder * holder);
|
||||
void HandleCharFactionOrRaceChange(WorldPacket& recv_data);
|
||||
|
||||
@@ -399,10 +398,10 @@ class WorldSession
|
||||
void HandleEmoteOpcode(WorldPacket& recvPacket);
|
||||
void HandleContactListOpcode(WorldPacket& recvPacket);
|
||||
void HandleAddFriendOpcode(WorldPacket& recvPacket);
|
||||
void HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, std::string friendNote);
|
||||
void HandleAddFriendOpcodeCallBack(QueryResult result, std::string friendNote);
|
||||
void HandleDelFriendOpcode(WorldPacket& recvPacket);
|
||||
void HandleAddIgnoreOpcode(WorldPacket& recvPacket);
|
||||
void HandleAddIgnoreOpcodeCallBack(QueryResult_AutoPtr result);
|
||||
void HandleAddIgnoreOpcodeCallBack(QueryResult result);
|
||||
void HandleDelIgnoreOpcode(WorldPacket& recvPacket);
|
||||
void HandleSetContactNotesOpcode(WorldPacket& recvPacket);
|
||||
void HandleBugOpcode(WorldPacket& recvPacket);
|
||||
@@ -519,13 +518,13 @@ class WorldSession
|
||||
void HandleBinderActivateOpcode(WorldPacket& recvPacket);
|
||||
void HandleListStabledPetsOpcode(WorldPacket& recvPacket);
|
||||
void HandleStablePet(WorldPacket& recvPacket);
|
||||
void HandleStablePetCallback(QueryResult_AutoPtr result);
|
||||
void HandleStablePetCallback(QueryResult result);
|
||||
void HandleUnstablePet(WorldPacket& recvPacket);
|
||||
void HandleUnstablePetCallback(QueryResult_AutoPtr result, uint32 petnumber);
|
||||
void HandleUnstablePetCallback(QueryResult result, uint32 petnumber);
|
||||
void HandleBuyStableSlot(WorldPacket& recvPacket);
|
||||
void HandleStableRevivePet(WorldPacket& recvPacket);
|
||||
void HandleStableSwapPet(WorldPacket& recvPacket);
|
||||
void HandleStableSwapPetCallback(QueryResult_AutoPtr result, uint32 petnumber);
|
||||
void HandleStableSwapPetCallback(QueryResult result, uint32 petnumber);
|
||||
|
||||
void HandleDuelAcceptedOpcode(WorldPacket& recvPacket);
|
||||
void HandleDuelCancelledOpcode(WorldPacket& recvPacket);
|
||||
@@ -678,7 +677,7 @@ class WorldSession
|
||||
void HandleSetActionBarToggles(WorldPacket& recv_data);
|
||||
|
||||
void HandleCharRenameOpcode(WorldPacket& recv_data);
|
||||
void HandleChangePlayerNameOpcodeCallBack(QueryResult_AutoPtr result, std::string newname);
|
||||
void HandleChangePlayerNameOpcodeCallBack(QueryResult result, std::string newname);
|
||||
void HandleSetPlayerDeclinedNames(WorldPacket& recv_data);
|
||||
|
||||
void HandleTotemDestroyed(WorldPacket& recv_data);
|
||||
@@ -819,7 +818,7 @@ class WorldSession
|
||||
private:
|
||||
void ProcessQueryCallbacks();
|
||||
|
||||
ACE_Future_Set<QueryResult_AutoPtr> m_nameQueryCallbacks;
|
||||
ACE_Future_Set<QueryResult> m_nameQueryCallbacks;
|
||||
QueryResultFuture m_charEnumCallback;
|
||||
QueryResultFuture m_addIgnoreCallback;
|
||||
QueryResultFuture m_stablePetCallback;
|
||||
|
||||
@@ -812,7 +812,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
LoginDatabase.escape_string (safe_account);
|
||||
// No SQL injection, username escaped.
|
||||
|
||||
QueryResult_AutoPtr result =
|
||||
QueryResult result =
|
||||
LoginDatabase.PQuery ("SELECT "
|
||||
"id, " //0
|
||||
"sessionkey, " //1
|
||||
@@ -913,7 +913,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
||||
}
|
||||
|
||||
// Re-check account ban (same check as in realmd)
|
||||
QueryResult_AutoPtr banresult =
|
||||
QueryResult banresult =
|
||||
LoginDatabase.PQuery ("SELECT 1 FROM account_banned WHERE id = %u AND active = 1 "
|
||||
"UNION "
|
||||
"SELECT 1 FROM ip_banned WHERE ip = '%s'",
|
||||
|
||||
@@ -54,7 +54,7 @@ void LoadSkillDiscoveryTable()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT spellId, reqSpell, reqSkillValue, chance FROM skill_discovery_template");
|
||||
QueryResult result = WorldDatabase.Query("SELECT spellId, reqSpell, reqSkillValue, chance FROM skill_discovery_template");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ void LoadSkillExtraItemTable()
|
||||
SkillExtraItemStore.clear(); // need for reload
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("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)
|
||||
{
|
||||
|
||||
@@ -1120,7 +1120,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult_AutoPtr 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)
|
||||
{
|
||||
|
||||
@@ -1265,7 +1265,7 @@ void SpellMgr::LoadSpellProcEvents()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -1331,7 +1331,7 @@ void SpellMgr::LoadSpellBonusess()
|
||||
mSpellBonusMap.clear(); // need for reload case
|
||||
uint32 count = 0;
|
||||
// 0 1 2 3 4
|
||||
QueryResult_AutoPtr 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)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -1507,7 +1507,7 @@ void SpellMgr::LoadSpellGroups()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -1597,7 +1597,7 @@ void SpellMgr::LoadSpellGroupStackRules()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
|
||||
QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -1650,7 +1650,7 @@ void SpellMgr::LoadSpellThreats()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, Threat FROM spell_threat");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, Threat FROM spell_threat");
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -2004,7 +2004,7 @@ void SpellMgr::LoadSpellLearnSpells()
|
||||
mSpellLearnSpells.clear(); // need for reload case
|
||||
|
||||
// 0 1 2
|
||||
QueryResult_AutoPtr 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)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -2114,7 +2114,7 @@ void SpellMgr::LoadSpellPetAuras()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr 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)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -2469,7 +2469,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult_AutoPtr 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)
|
||||
{
|
||||
@@ -3238,7 +3238,7 @@ void SpellMgr::LoadSpellEnchantProcData()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -3286,7 +3286,7 @@ void SpellMgr::LoadSpellRequired()
|
||||
mSpellsReqSpell.clear(); // need for reload case
|
||||
mSpellReq.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required");
|
||||
QueryResult result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -3345,7 +3345,7 @@ void SpellMgr::LoadSpellRanks()
|
||||
{
|
||||
mSpellChains.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id , rank");
|
||||
QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id , rank");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -3978,7 +3978,7 @@ void SpellMgr::LoadSpellLinked()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
|
||||
QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
|
||||
@@ -52,7 +52,7 @@ void TicketMgr::LoadGMTickets()
|
||||
m_GMticketid = 0;
|
||||
m_openTickets = 0;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT guid, playerGuid, name, message, createtime, map, posX, posY, posZ, timestamp, closed, assignedto, comment, completed, escalated, viewed FROM gm_tickets");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT guid, playerGuid, name, message, createtime, map, posX, posY, posZ, timestamp, closed, assignedto, comment, completed, escalated, viewed FROM gm_tickets");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -110,7 +110,7 @@ void TicketMgr::LoadGMTickets()
|
||||
void TicketMgr::LoadGMSurveys()
|
||||
{
|
||||
// we don't actually load anything into memory here as there's no reason to
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT MAX(surveyid) FROM gm_surveys");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT MAX(surveyid) FROM gm_surveys");
|
||||
if (result)
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
@@ -32,7 +32,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
|
||||
sLog.outString("Cleaning character database...");
|
||||
|
||||
// check flags which clean ups are necessary
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry=20004");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry=20004");
|
||||
if(!result)
|
||||
return;
|
||||
uint32 flags = (*result)[0].GetUInt32();
|
||||
@@ -52,7 +52,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
|
||||
void CharacterDatabaseCleaner::CheckUnique(const char* column, const
|
||||
char* table, bool (*check)(uint32))
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table);
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table);
|
||||
if(!result)
|
||||
{
|
||||
sLog.outString( "Table %s is empty.", table );
|
||||
|
||||
@@ -196,7 +196,7 @@ bool changetokGuid(std::string &str, int n, std::map<uint32, uint32> &guidMap, u
|
||||
return changetoknth(str, n, chritem, false, nonzero);
|
||||
}
|
||||
|
||||
std::string CreateDumpString(char const* tableName, QueryResult_AutoPtr result)
|
||||
std::string CreateDumpString(char const* tableName, QueryResult result)
|
||||
{
|
||||
if (!tableName || !result) return "";
|
||||
std::ostringstream ss;
|
||||
@@ -246,7 +246,7 @@ std::string PlayerDumpWriter::GenerateWhereStr(char const* field, GUIDs const& g
|
||||
return wherestr.str();
|
||||
}
|
||||
|
||||
void StoreGUID(QueryResult_AutoPtr result,uint32 field,std::set<uint32>& guids)
|
||||
void StoreGUID(QueryResult result,uint32 field,std::set<uint32>& guids)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 guid = fields[field].GetUInt32();
|
||||
@@ -254,7 +254,7 @@ void StoreGUID(QueryResult_AutoPtr result,uint32 field,std::set<uint32>& guids)
|
||||
guids.insert(guid);
|
||||
}
|
||||
|
||||
void StoreGUID(QueryResult_AutoPtr result,uint32 data,uint32 field, std::set<uint32>& guids)
|
||||
void StoreGUID(QueryResult result,uint32 data,uint32 field, std::set<uint32>& guids)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
std::string dataStr = fields[data].GetCppString();
|
||||
@@ -298,7 +298,7 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl
|
||||
else // not set case, get single guid string
|
||||
wherestr = GenerateWhereStr(fieldname,guid);
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT * FROM %s WHERE %s", tableFrom, wherestr.c_str());
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT * FROM %s WHERE %s", tableFrom, wherestr.c_str());
|
||||
if (!result)
|
||||
return true;
|
||||
|
||||
@@ -392,7 +392,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
if (!fin)
|
||||
return DUMP_FILE_OPEN_ERROR;
|
||||
|
||||
QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL);
|
||||
QueryResult result = QueryResult(NULL);
|
||||
char newguid[20], chraccount[20], newpetid[20], currpetid[20], lastpetid[20];
|
||||
|
||||
// make sure the same guid doesn't already exist and is safe to use
|
||||
|
||||
@@ -81,7 +81,7 @@ void WeatherMgr::LoadWeatherData()
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT zone, spring_rain_chance, spring_snow_chance, spring_storm_chance, summer_rain_chance, summer_snow_chance, summer_storm_chance, fall_rain_chance, fall_snow_chance, fall_storm_chance, winter_rain_chance, winter_snow_chance, winter_storm_chance, ScriptName FROM game_weather");
|
||||
QueryResult result = WorldDatabase.Query("SELECT zone, spring_rain_chance, spring_snow_chance, spring_storm_chance, summer_rain_chance, summer_snow_chance, summer_storm_chance, fall_rain_chance, fall_snow_chance, fall_storm_chance, winter_rain_chance, winter_snow_chance, winter_storm_chance, ScriptName FROM game_weather");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -1819,7 +1819,7 @@ void World::LoadAutobroadcasts()
|
||||
{
|
||||
m_Autobroadcasts.clear();
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT text FROM autobroadcast");
|
||||
QueryResult result = WorldDatabase.Query("SELECT text FROM autobroadcast");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2220,7 +2220,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
|
||||
LoginDatabase.escape_string(safe_author);
|
||||
|
||||
uint32 duration_secs = TimeStringToSecs(duration);
|
||||
QueryResult_AutoPtr resultAccounts = QueryResult_AutoPtr(NULL); //used for kicking
|
||||
QueryResult resultAccounts = QueryResult(NULL); //used for kicking
|
||||
|
||||
///- Update the database with ban information
|
||||
switch(mode)
|
||||
@@ -2506,7 +2506,7 @@ void World::UpdateRealmCharCount(uint32 accountId)
|
||||
);
|
||||
}
|
||||
|
||||
void World::_UpdateRealmCharCount(QueryResult_AutoPtr resultCharCount, uint32 accountId)
|
||||
void World::_UpdateRealmCharCount(QueryResult resultCharCount, uint32 accountId)
|
||||
{
|
||||
if (resultCharCount)
|
||||
{
|
||||
@@ -2529,7 +2529,7 @@ void World::InitDailyQuestResetTime()
|
||||
{
|
||||
time_t mostRecentQuestTime;
|
||||
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT MAX(time) FROM character_queststatus_daily");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT MAX(time) FROM character_queststatus_daily");
|
||||
if (result)
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
@@ -2601,7 +2601,7 @@ void World::ResetDailyQuests()
|
||||
|
||||
void World::LoadDBAllowedSecurityLevel()
|
||||
{
|
||||
QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT allowedSecurityLevel from realmlist WHERE id = '%d'", realmID);
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT allowedSecurityLevel from realmlist WHERE id = '%d'", realmID);
|
||||
if (result)
|
||||
SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt16()));
|
||||
}
|
||||
@@ -2646,7 +2646,7 @@ void World::UpdateMaxSessionCounters()
|
||||
|
||||
void World::LoadDBVersion()
|
||||
{
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT db_version, script_version, cache_id FROM version LIMIT 1");
|
||||
QueryResult result = WorldDatabase.Query("SELECT db_version, script_version, cache_id FROM version LIMIT 1");
|
||||
//QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version, cache_id FROM db_version LIMIT 1");
|
||||
if (result)
|
||||
{
|
||||
@@ -2689,7 +2689,7 @@ void World::UpdateAreaDependentAuras()
|
||||
|
||||
void World::LoadWorldStates()
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT entry, value FROM worldstates");
|
||||
QueryResult result = CharacterDatabase.Query("SELECT entry, value FROM worldstates");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2735,7 +2735,7 @@ uint64 World::getWorldState(uint32 index) const
|
||||
|
||||
void World::ProcessQueryCallbacks()
|
||||
{
|
||||
QueryResult_AutoPtr result;
|
||||
QueryResult result;
|
||||
|
||||
//-UpdateRealmCharCount
|
||||
if (m_realmCharCallback.IsReady())
|
||||
|
||||
@@ -43,7 +43,6 @@ class WorldSession;
|
||||
class Player;
|
||||
struct ScriptAction;
|
||||
struct ScriptInfo;
|
||||
class QueryResult;
|
||||
class WorldSocket;
|
||||
class SystemMgr;
|
||||
|
||||
@@ -738,7 +737,7 @@ class World
|
||||
protected:
|
||||
void _UpdateGameTime();
|
||||
// callback for UpdateRealmCharacters
|
||||
void _UpdateRealmCharCount(QueryResult_AutoPtr resultCharCount, uint32 accountId);
|
||||
void _UpdateRealmCharCount(QueryResult resultCharCount, uint32 accountId);
|
||||
|
||||
void InitDailyQuestResetTime();
|
||||
void InitWeeklyQuestResetTime();
|
||||
|
||||
Reference in New Issue
Block a user