mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Account data saving must work now
This commit is contained in:
parent
97bf2e7d68
commit
6496f7499e
13 changed files with 87 additions and 71 deletions
|
|
@ -18568,28 +18568,3 @@ void Player::InitGlyphsForLevel()
|
|||
|
||||
SetUInt32Value(PLAYER_GLYPHS_ENABLED, value);
|
||||
}
|
||||
|
||||
void Player::LoadAccountData(QueryResult *result)
|
||||
{
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
AccountData data;
|
||||
uint32 type = fields[0].GetUInt32();
|
||||
data.Time = fields[1].GetUInt32();
|
||||
data.Data = fields[2].GetCppString();
|
||||
|
||||
if(type < NUM_ACCOUNT_DATA_TYPES)
|
||||
m_accountData[type] = data;
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
}
|
||||
|
||||
void Player::SaveAccountData(uint32 type)
|
||||
{
|
||||
uint32 lowguid = GetGUIDLow();
|
||||
CharacterDatabase.PExecute("DELETE FROM account_data WHERE guid=%u AND type=%u", lowguid, type);
|
||||
CharacterDatabase.PExecute("INSERT INTO account_data VALUES (%u,%u,%u,%s)", lowguid, type, (uint32)m_accountData[type].Time, m_accountData[type].Data.c_str());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue