mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
Stores: cloud saves recognise GOG games, wait for a new prefix, never overwrite blindly
On device nothing ran for ELDERBORN: a GOG game without arguments has no launcher .bat, Steam runs its exe, and droiddeck-store-launch only looked for the .bat. It now recognises the exe too, looking through the folders above it for the sidecar, and every path logs a result line. A first launch has no prefix yet: the download is answered as deferred and runs once Proton has made the prefix's user folder, within a minute, without holding the launch. Uploads are safe now. CloudPlan decides per file against this device's baseline - the local and cloud state at the last sync: no upload before a download has completed once, the first download lets the cloud win, and a file changed on both sides is a conflict that Manage saves offers to settle with Keep cloud or Keep local. The cloud copy is backed up before an upload replaces it, as the local folder is before a download.
This commit is contained in:
1 parent
b323a0b33e
commit
41422407c4
11 files changed
+464
-87
No files matched your search
@@ -55,7 +55,9 @@ class Detection(unittest.TestCase):
|
||||
def test_anything_else_is_left_alone(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
folder = game(root)
|
||||
self.assertIsNone(store.find_store_game([str(folder / 'Metalstorm.exe')]))
|
||||
# The exe of a store game is one too (a GOG game without a launcher); a stray file is not.
|
||||
self.assertEqual(folder, store.find_store_game([str(folder / 'Metalstorm.exe')])[0])
|
||||
self.assertIsNone(store.find_store_game([str(Path(root) / 'elsewhere/readme.txt')]))
|
||||
(folder / '.droiddeck-store.json').unlink()
|
||||
self.assertIsNone(store.find_store_game([str(folder / '.droiddeck-launch.bat')]))
|
||||
|
||||
@@ -193,6 +195,20 @@ class Browser(unittest.TestCase):
|
||||
self.assertEqual('https://www.epicgames.com', xdg.where('https://www.epicgames.com/activate?code=SECRET'))
|
||||
|
||||
|
||||
class ExeTarget(unittest.TestCase):
|
||||
def test_a_game_started_by_its_exe_is_found_from_a_subfolder(self):
|
||||
# Most GOG games have no launcher .bat: Steam runs the exe, which may sit in a subfolder.
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
folder = game(root, store_id='gog', ident='1207664643')
|
||||
(folder / 'bin/x64').mkdir(parents=True)
|
||||
exe = folder / 'bin/x64/ELDERBORN.exe'
|
||||
exe.write_text('MZ')
|
||||
found = store.find_store_game(['"%s"' % exe])
|
||||
self.assertEqual(folder, found[0])
|
||||
self.assertEqual('gog', found[1]['store'])
|
||||
self.assertIsNone(store.find_store_game(['/root/Games/Other/x.exe']))
|
||||
|
||||
|
||||
class CloudHooks(unittest.TestCase):
|
||||
def test_a_store_game_with_cloud_saves_asks_before_and_after(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
|
||||
Reference in new issue
Block a user