mirror of
https://github.com/SWG-Source/src.git
synced 2026-09-11 23:45:01 -04:00
move these to before and after as they were before the changes
This commit is contained in:
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user