diff options
author | megamage <none@none> | 2009-06-27 17:39:51 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-27 17:39:51 -0500 |
commit | d9ec2d21969f19f0e97fe1c490fae7c0b495bfc9 (patch) | |
tree | 8e50fe975eb2813d6f160469af5e4a6dff101a6d /src/game/Level2.cpp | |
parent | 02a5c2fcc6ae1d0391ea782429574fb91c763746 (diff) |
[8072] First step to get rid of data blob.
Adds new fields gender, level, xp, money, playerBytes, playerBytes2 and playerFlags to characters table.
The update will not work if your database contains characters with an old data field (not fitting to the actual client version).
It's recommended to backup your character database before applying this patch.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r-- | src/game/Level2.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index e7a684a8111..901c9ba1d1c 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -2268,22 +2268,17 @@ bool ChatHandler::HandlePInfoCommand(const char* args) if (HasLowerSecurity(NULL, target_guid)) return false; - // 0 - QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime FROM characters WHERE guid = '%u'", GUID_LOPART(target_guid)); + // 0 1 2 3 + QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime, level, money, account FROM characters WHERE guid = '%u'", GUID_LOPART(target_guid)); if (!result) return false; Field *fields = result->Fetch(); total_player_time = fields[0].GetUInt32(); + level = fields[1].GetUInt32(); + money = fields[2].GetUInt32(); + accId = fields[3].GetUInt32(); delete result; - - Tokens data; - if (!Player::LoadValuesArrayFromDB(data,target_guid)) - return false; - - money = Player::GetUInt32ValueFromArray(data, PLAYER_FIELD_COINAGE); - level = Player::GetUInt32ValueFromArray(data, UNIT_FIELD_LEVEL); - accId = objmgr.GetPlayerAccountIdByGUID(target_guid); } std::string username = GetTrinityString(LANG_ERROR); |