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/Level2.cpp

    r168 r173  
    17961796    else 
    17971797    { 
     1798        QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime FROM characters WHERE guid = '%u'", targetGUID); 
     1799        if (!result) 
     1800        { 
     1801            SendSysMessage(LANG_PLAYER_NOT_FOUND); 
     1802            SetSentErrorMessage(true); 
     1803            return false; 
     1804        } 
     1805        Field *fields = result->Fetch(); 
     1806        total_player_time = fields[0].GetUInt32(); 
     1807        delete result; 
     1808         
     1809        Tokens data; 
     1810        if (!Player::LoadValuesArrayFromDB(data,targetGUID)) 
     1811        { 
     1812            SendSysMessage(LANG_PLAYER_NOT_FOUND); 
     1813            SetSentErrorMessage(true); 
     1814            return false; 
     1815        } 
     1816         
     1817        money = Player::GetUInt32ValueFromArray(data, PLAYER_FIELD_COINAGE); 
     1818        level = Player::GetUInt32ValueFromArray(data, UNIT_FIELD_LEVEL); 
    17981819        accId = objmgr.GetPlayerAccountIdByGUID(targetGUID); 
    1799         WorldSession session(0,NULL,SEC_PLAYER,0,0,LOCALE_enUS); 
    1800         Player plr(&session);                               // use fake session for temporary load 
    1801         plr.MinimalLoadFromDB(NULL, targetGUID); 
    1802         money = plr.GetMoney(); 
    1803         total_player_time = plr.GetTotalPlayedTime(); 
    1804         level = plr.getLevel(); 
    18051820    } 
    18061821 
     
    33843399            getline (infile,line); 
    33853400            //cout << line << endl; 
    3386             QueryResult *result = WorldDatabase.PQuery(line.c_str()); 
     3401            QueryResult *result = WorldDatabase.Query(line.c_str()); 
    33873402            delete result; 
    33883403        }