mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[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. Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
f34ce077c0
commit
8a32a19bad
13 changed files with 229 additions and 171 deletions
|
|
@ -2133,22 +2133,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 = GetMangosString(LANG_ERROR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue