Kapiainen / Lauhdutin

A Rainmeter skin for launching games.
MIT License
67 stars 8 forks source link

GOG support for uninstalled too? #86

Closed BanCrash closed 6 years ago

BanCrash commented 7 years ago

Hello, by chance I found an unofficial GOG api documentation that shows how to get all the games an account have:

https://gogapidocs.readthedocs.io/en/latest/

In concrete, the part I think could be useful is:

https://gogapidocs.readthedocs.io/en/latest/account.html#games-movies

I don't know if there is a way to work with this, but just in case I let this here for if you want to check it out!

EDIT: A topic on GOG official forum talking about this: https://www.gog.com/forum/general/unofficial_gog_api_documentation/page1

EDIT 2: After a little research I see that you have first to log in in your web browser, and then with the link you get directly from GOG you can access locally to your account and make that call for your games. There is also an implementation of this in github (at least, I think it is) https://github.com/Yepoleb/pygogapi

Kapiainen commented 7 years ago

TL;DR: Looks intriguing, but I have some questions and concerns about using the API and existing wrappers. Don't expect to see it implemented in Lauhdutin any time soon.

Neat. The 1.2.x updates to GOG Galaxy changed some of the local files and now there is a local database with information on all GOG games (prior versions only populated a similar local database with info on games viewed by the user via the Galaxy client i.e. only games that probably already were installed), but it does not include a list of owned games for accounts that have logged in so this is along the lines of what I've been looking for.

I still haven't found an API/protocol for interacting with the Galaxy client itself like one can with the Steam and Battle.net clients, but at least Lauhdutin could for example start the Galaxy client. It would be nice to have it be able to also either open up the page for the game or even bring up the GUI for starting the installation of the game.

However, I do have some concerns:

EDIT: Some of these questions and concerns may have answers already, but it'll take a while to read and process all of the material out there.

BanCrash commented 7 years ago

Hello, I understand all your concerns. However maybe I found a better way:

ProgramData\GOG.com\Galaxy\storage

In this folder there is a file named ownership.db that have a sql database that shows all games you have been installed every time (in the ProductOwnership table), even if now it is not installed. The important thing about this is, even if you only pulse the install button on GOG galaxy, and then pulse cancel button, that game will appear in this database:

image

image

In this screen you can see that there is a charging process, in that charging process I think GOG galaxy write the ID to this database. I pulse Cancel after that and surprise:

image

The main problem is that you have to do this process with all the games you have (pulse install, then cancel), but maybe this is better than the other way?

EDIT:

Other interesting file could be galaxy.db in the same folder, that have a table (Product Details View) with ALL the games GOG have (not only you owned). For example:

image

With this, I can see easily how game belong to the id I have in the previous file:

image

Kapiainen commented 7 years ago

I'm aware of those files and their contents (they are some of the files that Lauhdutin's Python backend processes), and I had once upon a time also been hopeful about what could be done with ownership.db. However, as you also noticed the contents only reflect what has been installed (or has been attempted to install). galaxy.db replaced productdetails.db in GOG Galaxy 1.2.x, which is why Lauhdutin 2.7.1 was needed as the latter file had been removed completely when the Galaxy client was updated.

BanCrash commented 7 years ago

Ah, okay then. Then I hope in the future there is a change on GOG Galaxy on that file or to solve all concerns about that public API.

BanCrash commented 7 years ago

About this, I found this tool that allows you to download all your GOG games. I know that this tool would have all the concerns of the other tool, just share it for if it is more useful than the other.

https://github.com/eddie3/gogrepo

The topic on the official GOG forum have 40 pages and it is still alive, so I don't think GOG cares about this. Source

By the way, in the official GOG forum I found too a post that shows how to create a shorcut that launches a GOG game within GOG Galaxy:

Yes you can create shortcuts to use Galaxy:

"GALAXYPATH\GalaxyClient.exe" /command=runGame /gameId=IDNUMBER /path="GAMEPATH"

The uppercase words have to be changed to the specific value. The gameid you can easily see by looking into the game folder and check for files with "goggame-IDNUMBER" in them.

Source

Kapiainen commented 7 years ago

I found that repo as well back when you opened this thread. My previously stated concerns apply to it as well.

Not closing down a discussion/project is not the same as endorsing it. I'd rather wait a while longer to see what happens with the API.

The last part about launching games looks like a really useful piece of information that I wasn't previously aware of. Thanks!

BanCrash commented 7 years ago

Ah, okay!

Sure!

Glad to help!