[svn] * Avoid access to bag item prototype for getting bag size, use related item update field instead as more fast source.

* Better check client inventory pos data received in some client packets to skip invalid cases.
* Removed some unnecessary database queries.
* Make guid lookup for adding ignore async.
* Added two parameter versions of the AsyncQuery function
* Make queries for adding friends async. - Hunuza
* Replace some PQuery() calls with more simple Query() - Hunuza
* Mark spell as executed instead of deleteable to solve crash.
*** Source mangos.

**Its a big commit. so test with care... or without care.... whatever floats your boat.

--HG--
branch : trunk
This commit is contained in:
KingPin
2008-11-05 20:10:19 -06:00
parent 404f72c7a2
commit 8d331f2b10
27 changed files with 394 additions and 280 deletions

View File

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