FriendsOfGalaxy/galaxy-integration-uplay

uplay is closed too quickly for sync

Opened this issue · 3 comments

if the closing client feature is enabled,
and a game is exited uplay is shutdown before it can sync saves.

I don't know if this is an integration or gog 2.0 issue so i reported it to both

Hi @benjajb,

yes, it looks like a problem.

When we send notification to Galaxy that the game is no longer running, and in Galaxy there is setting to "close external client", then shutdown_platform_client method is called.

We're using "taskkill /im upc.exe" command to tell Ubisoft client to close.
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/taskkill
This is basically calling WM_CLOSE signal - it is up to application to handle that.

We're not using /f force flag, but nevertheless looks like Ubisoft client does not support graceful shutdown with cloud saves this way.

Any help with discovering different method appreciated.

If there is no handler for any kind of external command, maybe the workaround would be to detect when cloud saves sync is finished. How? Maybe some cache change, or note in windows registry, or at least network inspection...

PR welcomed.

Quick research:

There is C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\savegames\

that contains

  • <club_id>/<launch_id>(or<install_id>)/.save
  • <club_id>/<launch_id>(or<install_id>)/.save.upload

files, for example 57a84edf-09d7-448f-a18f-09c504b84637\3352\1.save.upload for Uno game.

EDIT ----

Looks like 1.save.upload file has gone after closing game and after cloud saves upload.
In case when Galaxy closed the Uplay client, the file has stayed - so apparently not uploaded yet.
That is nice.

If anyone wants help there is a list of questions/checks that need to be addresed before any coding:

  • test on 2 other games if upload file disappears indeed.
  • launch_id vs install_id - which one is used in directory names
  • check if it always in the same format for example 1.save.upload. It looks like ordered migrations.
  • for above ^ check case when you play few times being offline and each time saving and exiting game just to be sure that we should track all upload files. It would be bad, if some of them can stay there forever.
  • check how Offline mode in Ubisoft client could be detected - in such case we don't need to track files/wait for anything