mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01: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.
--HG--
branch : trunk
This commit is contained in:
@@ -369,20 +369,17 @@ bool Guild::FillPlayerData(uint64 guid, MemberSlot* memslot)
|
||||
}
|
||||
else
|
||||
{
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT name,data,zone,class FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
if(!result)
|
||||
return false; // player doesn't exist
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT name,level,zone,class FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
|
||||
if(!result)
|
||||
return false; // player doesn't exist
|
||||
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
plName = fields[0].GetCppString();
|
||||
|
||||
Tokens data = StrSplit(fields[1].GetCppString(), " ");
|
||||
plLevel = Player::GetUInt32ValueFromArray(data,UNIT_FIELD_LEVEL);
|
||||
|
||||
plZone = fields[2].GetUInt32();
|
||||
plClass = fields[3].GetUInt32();
|
||||
delete result;
|
||||
plName = fields[0].GetCppString();
|
||||
plLevel = fields[1].GetUInt32();
|
||||
plZone = fields[2].GetUInt32();
|
||||
plClass = fields[3].GetUInt32();
|
||||
delete result;
|
||||
|
||||
if(plLevel<1||plLevel>STRONG_MAX_LEVEL) // can be at broken `data` field
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user