Changeset 173 for trunk/src/game/Level2.cpp
- Timestamp:
- 11/19/08 13:43:02 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Level2.cpp
r168 r173 1796 1796 else 1797 1797 { 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); 1798 1819 accId = objmgr.GetPlayerAccountIdByGUID(targetGUID); 1799 WorldSession session(0,NULL,SEC_PLAYER,0,0,LOCALE_enUS);1800 Player plr(&session); // use fake session for temporary load1801 plr.MinimalLoadFromDB(NULL, targetGUID);1802 money = plr.GetMoney();1803 total_player_time = plr.GetTotalPlayedTime();1804 level = plr.getLevel();1805 1820 } 1806 1821 … … 3384 3399 getline (infile,line); 3385 3400 //cout << line << endl; 3386 QueryResult *result = WorldDatabase. PQuery(line.c_str());3401 QueryResult *result = WorldDatabase.Query(line.c_str()); 3387 3402 delete result; 3388 3403 }