Implemented 'Inventory Snapshot' feature

This commit is contained in:
Uleat
2015-09-25 23:07:05 -04:00
parent 41d19c4e8a
commit a1089fccd6
15 changed files with 192 additions and 6 deletions
+11
View File
@@ -642,6 +642,17 @@ bool Client::Save(uint8 iCommitNow) {
m_pp.hunger_level = EQEmu::Clamp(m_pp.hunger_level, 0, 50000);
m_pp.thirst_level = EQEmu::Clamp(m_pp.thirst_level, 0, 50000);
// perform snapshot before SaveCharacterData() so that m_epp will contain the updated time
if (RuleB(Character, ActiveInvSnapshots) && time(nullptr) >= GetNextInvSnapshotTime()) {
if (database.SaveCharacterInventorySnapshot(CharacterID())) {
SetNextInvSnapshot(RuleI(Character, InvSnapshotMinIntervalM));
}
else {
SetNextInvSnapshot(RuleI(Character, InvSnapshotMinRetryM));
}
}
database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp, &m_epp); /* Save Character Data */
return true;