aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/storage.cpp
AgeCommit message (Collapse)Author
2019-11-15CLOUD: Remove the saves sync finished OSD messageBastien Bouclet
It's not very good for immersion when it appears after an autosave. The cloud icon is a good enough indication that cloud synchronization happened.
2019-07-30CLOUD: Ask user to manually enable StorageAlexander Tkachev
For more security, newly connected Storage only gets username/used space information and is disabled until user manually presses the button.
2016-10-29CLOUD: Use OSDMessageQueue to post OSD messages from the cloud threadThierry Crozat
2016-09-18ALL: Homogeneize use of 'saved game' in messagesThierry Crozat
2016-09-03JANITORIAL: Make GPL headers uniformEugene Sandulenko
2016-08-24ALL: Fix debug, warning and error usageAlexander Tkachev
Added prefixes, used debug(9).
2016-08-24CLOUD: JANITORIAL: Fix code formattingEugene Sandulenko
2016-08-24JANITORIAL: Remove spaces at the end of the lineAlexander Tkachev
I knew there were some, but I wanted to fix them once, instead of doing it all the time.
2016-08-24CLOUD: Do some refactoring/cleanupAlexander Tkachev
Nothing really major.
2016-08-24CLOUD: Add default SavesSync callbacksAlexander Tkachev
With OSD messages indicating whether saves sync is complete, cancelled or failed.
2016-08-24CLOUD: Calculate FolderDownload download speedAlexander Tkachev
2016-08-24CLOUD: Update FolderDownloadRequestAlexander Tkachev
It now keeps track of downloaded bytes.
2016-08-24CLOUD: Add Storage::uploadStreamSupported()Alexander Tkachev
Box uses POST multipart/form requests for uploading. Such requests could be sent with libcurl if we either have a file available or a buffer with this file's contents. SavesSyncRequest was using Storage::upload(ReadStream *), which couldn't be implemented in BoxStorage. Thus I've added a method to test whether such upload is supported and, if it's not, SavesSyncRequest uses the other.
2016-08-24CLOUD: Fix Storage::streamFile()Alexander Tkachev
2016-08-24GUI: Upgrade DownloadDialogAlexander Tkachev
It now shows the remote and local directories and a progress bar. Storage now shows OSD messages on download success and failure.
2016-08-24CLOUD: Add FolderDownload-related methods in StorageAlexander Tkachev
CloudManager's shortcuts are added too. The idea is to keep FolderDownload request within Storage, and provide necessary means to access it. The download is started and cancelled through the DownloadDialog.
2016-08-24CLOUD: Make Storage::savesSync() restartAlexander Tkachev
If Storage::syncSaves() is called when sync is running, another sync would be automatically scheduled in the end of the current one. That could be helpful when we want to specify that we changed something during sync (created new save slot, for example).
2016-08-24CLOUD: Update downloading in StoragesAlexander Tkachev
Id should be used everywhere.
2016-08-24CLOUD: Update Requests to use StorageFile::id()Alexander Tkachev
Only two places to update, as others still require id resolving.
2016-08-24CLOUD: Make ProgressDialog display downloading progressAlexander Tkachev
2016-08-24GUI: Add SaveLoadCloudSyncProgressDialogAlexander Tkachev
It's shown by SaveLoadChooserDialog when files are downloaded and some save slots are locked. One can hide that dialog to interact with non-locked slots or cancel saves sync completely. Dialog's label shows current sync progress. Dialog automatically hides itself when all files are downloaded. WARNING: right now that results in a crash!
2016-08-24CLOUD: Update syncSaves() to return SavesSyncRequest *Alexander Tkachev
So other classes could use that information without casting.
2016-08-24CLOUD: Fix SavesSyncRequest to return right filesAlexander Tkachev
Files we need are files to be downloaded, because that's what blocks us from reading/writing in those.
2016-08-24CLOUD: Extend Storage & SavesSyncRequestAlexander Tkachev
Now one can learn whether SavesSyncRequest is running, its progress and which files are being synced.
2016-08-24CLOUD: Add mutexes in StorageAlexander Tkachev
2016-08-24CLOUD: Implement Storage's isWorking()Alexander Tkachev
It now keeps track of how many Requests are running. To achieve that, we had to pass a callback to ConnectionManager, so each Request has a callback paired with it. If that's one of Storage's Requests, it has a callback, which would decrease a counter. When Storage adds a Request, it also increases a counter and passes that callback. Callback is called by ConnMan when Request is deleted. isWorking() returns true if there is at least one Request running.
2016-08-24CLOUD: Move download methods into StorageAlexander Tkachev
DownloadRequest and FolderDownloadRequest are using other Storage's methods. Thus, download() and downloadFolder() could be implemented in base Storage class.
2016-08-24CLOUD: Make syncSaves() common for all StoragesAlexander Tkachev
As it uses SavesSyncRequest and this request is using Storage's upload(), download() and listDirectory(), there is no need to make storage-dependent version of that request and so method could be implemented in base Storage.
2016-08-24CLOUD: Add OneDriveUploadRequestAlexander Tkachev
Doesn't support server's requested ranges yet. Commit also adds some PUT-related code in NetworkReadStream and CurlRequest.
2016-08-24CLOUD: Make ConnectionManager singletonAlexander Tkachev
With ConnectionManager singleton one can start their Requests without creating Storage instance. Moreover, Storage instance should contain cloud API, not Requests-related handling and timer starting methods. Thus, these methods were moved into ConnectionManager itself.
2016-08-24CLOUD: Add ConnectionManager and NetworkReadStreamAlexander Tkachev
NetworkReadStream actually saves whole response in the memory now. There is a pause mechanism in libcurl, but if libcurl is requesting something compressed, it would have to uncompress data as it goes even if we paused the request. Even though our own stream won't be notified about this data when when "pause" the request, libcurl's own buffer wound be expanding.
2016-08-24CLOUD: Add CurlRequestAlexander Tkachev
CurlRequest uses own multi_handle, in which it creates an easy_handle to make a request. Every time `handle()` is called it checks whether request is complete and, if it is, stops.
2016-08-24CLOUD: Fix GCC static cloudThread compile errorAlexander Tkachev
It's not static anymore.
2016-08-24CLOUD: Add first RequestAlexander Tkachev
Just fooling around with the example Request, but the idea works well.
2016-08-24CLOUD: Do minor fixesAlexander Tkachev
2016-08-24CLOUD: Add Cloud::Manager and Cloud::StorageAlexander Tkachev
This commit introduces Common::CloudManager, which can be accessed from OSystem. The backend for this manager is Cloud::Manager (defined in backends/cloud/manager.h). It should load all users storages from configs and provide access to current Storage instance. For now it just creates a new one. Cloud::Storage (backends/cloud/storage.h) provides an API to interact with cloud storage, for example, create new directory or sync files. Right now it's not ready and has only two dummy methods: listDirectory() and syncSaves(). There is Cloud::Dropbox::DropboxStorage backend (backends/cloud/dropbox/dropboxstorage.h) for Cloud::Storage. Right now it implements both listDirectory() and syncSaves() with starting timer task and handling it by printing out some JSON examples.