aboutsummaryrefslogtreecommitdiff
path: root/backends/saves/default
diff options
context:
space:
mode:
Diffstat (limited to 'backends/saves/default')
-rw-r--r--backends/saves/default/default-saves.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index a669c2ce81..3fcb3cb3b3 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -27,6 +27,10 @@
#include "common/scummsys.h"
+#ifdef USE_CLOUD
+#include "backends/cloud/cloudmanager.h"
+#endif
+
#if !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
#include "backends/saves/default/default-saves.h"
@@ -109,6 +113,12 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const Common::String
if (getError().getCode() != Common::kNoError)
return nullptr;
+ for (Common::StringArray::const_iterator i = _lockedFiles.begin(), end = _lockedFiles.end(); i != end; ++i) {
+ if (filename == *i) {
+ return nullptr; //file is locked, no loading available
+ }
+ }
+
SaveFileCache::const_iterator file = _saveFileCache.find(filename);
if (file == _saveFileCache.end()) {
return nullptr;
@@ -126,6 +136,12 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String
if (getError().getCode() != Common::kNoError)
return nullptr;
+ for (Common::StringArray::const_iterator i = _lockedFiles.begin(), end = _lockedFiles.end(); i != end; ++i) {
+ if (filename == *i) {
+ return nullptr; //file is locked, no saving available
+ }
+ }
+
// Obtain node.
SaveFileCache::const_iterator file = _saveFileCache.find(filename);
Common::FSNode fileNode;
@@ -209,6 +225,12 @@ void DefaultSaveFileManager::assureCached(const Common::String &savePathName) {
// Check that path exists and is usable.
checkPath(Common::FSNode(savePathName));
+#ifdef USE_CLOUD
+ Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing
+ if (!files.empty()) updateSavefilesList(files); //makes this cache invalid
+ else _lockedFiles = files;
+#endif
+
if (_cachedDirectory == savePathName) {
return;
}