mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-02 03:16:11 -04:00
40 lines
1.0 KiB
C++
Executable File
40 lines
1.0 KiB
C++
Executable File
// ======================================================================
|
|
//
|
|
// TaskSaveSnapshot.cpp
|
|
// copyright (c) 2001 Sony Online Entertainment
|
|
//
|
|
// ======================================================================
|
|
|
|
#include "serverDatabase/FirstServerDatabase.h"
|
|
#include "serverDatabase/TaskSaveSnapshot.h"
|
|
|
|
#include "serverDatabase/Persister.h"
|
|
#include "serverDatabase/Snapshot.h"
|
|
|
|
// ======================================================================
|
|
|
|
TaskSaveSnapshot::TaskSaveSnapshot(Snapshot *snapshot) : m_snapshot(snapshot)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
bool TaskSaveSnapshot::process(DB::Session *session)
|
|
{
|
|
if (session != nullptr) {
|
|
return (m_snapshot->saveToDB(session));
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void TaskSaveSnapshot::onComplete()
|
|
{
|
|
m_snapshot->saveCompleted();
|
|
Persister::getInstance().saveCompleted(m_snapshot);
|
|
}
|
|
|
|
// ======================================================================
|