move these to before and after as they were before the changes

This commit is contained in:
DarthArgus
2016-12-29 08:53:48 +00:00
parent 81d679e0cc
commit 0995323201
2 changed files with 16 additions and 26 deletions
@@ -69,34 +69,10 @@ bool Snapshot::saveToDB(DB::Session *session)
{
NOT_NULL(session);
m_isBeingSaved = true;
CustomStepListType::iterator step;
for (step=m_customStepList.begin(); step !=m_customStepList.end(); ++step)
{
NOT_NULL(*step);
if (!(*step)->beforePersist(session)) {
m_isBeingSaved = false;
return false;
}
if (m_timestamp != 0 && !saveTimestamp(session)) {
return false;
}
if (m_timestamp!=0)
if (! saveTimestamp(session)) {
m_isBeingSaved = false;
return false;
}
for (step=m_customStepList.begin(); step !=m_customStepList.end(); ++step)
{
NOT_NULL(*step);
if (!(*step)->afterPersist(session)){
m_isBeingSaved = false;
return false;
}
}
m_isBeingSaved = false;
return true;
}
// ----------------------------------------------------------------------
@@ -94,6 +94,13 @@ bool SwgSnapshot::saveToDB(DB::Session *session) {
session->setAutoCommitMode(false);
for (auto step = m_customStepList.begin(); step !=m_customStepList.end(); ++step)
{
if (!(*step)->beforePersist(session)) {
return false;
}
}
// save all the buffers
if (!(m_objectTableBuffer.save(session))) { return false; }
if (!(m_battlefieldMarkerObjectBuffer.save(session))) { return false; }
@@ -131,6 +138,13 @@ bool SwgSnapshot::saveToDB(DB::Session *session) {
if (!(m_waypointBuffer.save(session))) { return false; }
if (!(m_weaponObjectBuffer.save(session))) { return false; }
for (auto step = m_customStepList.begin(); step !=m_customStepList.end(); ++step)
{
if (!(*step)->afterPersist(session)){
return false;
}
}
// save the parent class
if (!(Snapshot::saveToDB(session))) { return false; }