Show
Ignore:
Timestamp:
11/19/08 13:43:02 (17 years ago)
Author:
yumileroy
Message:

[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.

Original author: KingPin?
Date: 2008-11-05 20:10:19-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/ObjectMgr.cpp

    r168 r173  
    27292729    uint32 count = 0; 
    27302730    //                                                     0         1              2           3           4              5      6      7      8      9      10     11     12     13      14          15 
    2731     QueryResult *result = CharacterDatabase.PQuery("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, leaderGuid FROM groups"); 
     2731    QueryResult *result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, leaderGuid FROM groups"); 
    27322732 
    27332733    if( !result ) 
     
    27712771    leaderGuid = 0; 
    27722772    //                                        0           1          2         3 
    2773     result = CharacterDatabase.PQuery("SELECT memberGuid, assistant, subgroup, leaderGuid FROM group_member ORDER BY leaderGuid"); 
     2773    result = CharacterDatabase.Query("SELECT memberGuid, assistant, subgroup, leaderGuid FROM group_member ORDER BY leaderGuid"); 
    27742774    if(!result) 
    27752775    { 
     
    28242824    group = NULL; 
    28252825    leaderGuid = 0; 
    2826     result = CharacterDatabase.PQuery( 
     2826    result = CharacterDatabase.Query( 
    28272827        //      0           1    2         3          4           5 
    28282828        "SELECT leaderGuid, map, instance, permanent, difficulty, resettime, " 
     
    36923692void ObjectMgr::LoadPetCreateSpells() 
    36933693{ 
    3694     QueryResult *result = WorldDatabase.PQuery("SELECT entry, Spell1, Spell2, Spell3, Spell4 FROM petcreateinfo_spell"); 
     3694    QueryResult *result = WorldDatabase.Query("SELECT entry, Spell1, Spell2, Spell3, Spell4 FROM petcreateinfo_spell"); 
    36953695    if(!result) 
    36963696    { 
     
    40724072void ObjectMgr::LoadItemTexts() 
    40734073{ 
    4074     QueryResult *result = CharacterDatabase.PQuery("SELECT id, text FROM item_text"); 
     4074    QueryResult *result = CharacterDatabase.Query("SELECT id, text FROM item_text"); 
    40754075 
    40764076    uint32 count = 0; 
     
    41554155    mPageTextLocaleMap.clear(); 
    41564156     
    4157     QueryResult *result = WorldDatabase.PQuery("SELECT entry,text_loc1,text_loc2,text_loc3,text_loc4,text_loc5,text_loc6,text_loc7,text_loc8 FROM locales_page_text"); 
     4157    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"); 
    41584158 
    41594159    if(!result) 
     
    57115711    uint32 count = 0; 
    57125712    //                                                     0           1           2           3            4    5     6     7            8         10 
    5713     QueryResult *result = CharacterDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map, data, time, corpse_type, instance, guid FROM corpse WHERE corpse_type <> 0"); 
     5713    QueryResult *result = CharacterDatabase.Query("SELECT position_x, position_y, position_z, orientation, map, data, time, corpse_type, instance, guid FROM corpse WHERE corpse_type <> 0"); 
    57145714 
    57155715    if( !result ) 
     
    60756075    m_ReservedNames.clear();                                // need for reload case 
    60766076 
    6077     QueryResult *result = WorldDatabase.PQuery("SELECT name FROM reserved_name"); 
     6077    QueryResult *result = WorldDatabase.Query("SELECT name FROM reserved_name"); 
    60786078 
    60796079    uint32 count = 0; 
     
    69626962    std::set<uint32> skip_trainers; 
    69636963 
    6964     QueryResult *result = WorldDatabase.PQuery("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer"); 
     6964    QueryResult *result = WorldDatabase.Query("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer"); 
    69656965 
    69666966    if( !result ) 
     
    70537053    std::set<uint32> skip_vendors; 
    70547054 
    7055     QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor"); 
     7055    QueryResult *result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor"); 
    70567056    if( !result ) 
    70577057    { 
     
    70997099    m_mCacheNpcTextIdMap.clear(); 
    71007100 
    7101     QueryResult* result = WorldDatabase.PQuery("SELECT npc_guid, textid FROM npc_gossip"); 
     7101    QueryResult* result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip"); 
    71027102    if( !result ) 
    71037103    {