From 0995323201efb235496949112b87ed412d1c7f52 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Thu, 29 Dec 2016 08:53:48 +0000 Subject: [PATCH] move these to before and after as they were before the changes --- .../serverDatabase/src/shared/Snapshot.cpp | 28 ++----------------- .../src/shared/core/SwgSnapshot.cpp | 14 ++++++++++ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/engine/server/library/serverDatabase/src/shared/Snapshot.cpp b/engine/server/library/serverDatabase/src/shared/Snapshot.cpp index 163c2225..c61520c0 100755 --- a/engine/server/library/serverDatabase/src/shared/Snapshot.cpp +++ b/engine/server/library/serverDatabase/src/shared/Snapshot.cpp @@ -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; } // ---------------------------------------------------------------------- diff --git a/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp b/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp index e6f04dd2..a111e70c 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp @@ -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; }