[10142] Read/write time as uint64 in [character_]account_data

Client currently expected uint32 value and time_t fit but
in DB time_t stored for portability as uint64 for this and other tables.
This commit is contained in:
VladimirMangos 2010-07-03 09:07:59 +04:00
parent c0d7e2a176
commit c6a55a4ac0
2 changed files with 4 additions and 4 deletions

View file

@ -605,7 +605,7 @@ void WorldSession::LoadAccountData(QueryResult* result, uint32 mask)
continue;
}
m_accountData[type].Time = fields[1].GetUInt32();
m_accountData[type].Time = time_t(fields[1].GetUInt64());
m_accountData[type].Data = fields[2].GetCppString();
} while (result->NextRow());
@ -623,7 +623,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::strin
CharacterDatabase.PExecute("DELETE FROM account_data WHERE account='%u' AND type='%u'", acc, type);
std::string safe_data = data;
CharacterDatabase.escape_string(safe_data);
CharacterDatabase.PExecute("INSERT INTO account_data VALUES ('%u','%u','%u','%s')", acc, type, (uint32)time_, safe_data.c_str());
CharacterDatabase.PExecute("INSERT INTO account_data VALUES ('%u','%u','" UI64FMTD "','%s')", acc, type, uint64(time_), safe_data.c_str());
CharacterDatabase.CommitTransaction ();
}
else
@ -636,7 +636,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::strin
CharacterDatabase.PExecute("DELETE FROM character_account_data WHERE guid='%u' AND type='%u'", m_GUIDLow, type);
std::string safe_data = data;
CharacterDatabase.escape_string(safe_data);
CharacterDatabase.PExecute("INSERT INTO character_account_data VALUES ('%u','%u','%u','%s')", m_GUIDLow, type, (uint32)time_, safe_data.c_str());
CharacterDatabase.PExecute("INSERT INTO character_account_data VALUES ('%u','%u','" UI64FMTD "','%s')", m_GUIDLow, type, uint64(time_), safe_data.c_str());
CharacterDatabase.CommitTransaction ();
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10141"
#define REVISION_NR "10142"
#endif // __REVISION_NR_H__