Jump to content
LaunchBox Community Forums

Work in progress: gog.com plugin


Recommended Posts

I've been waiting for years for the Launchbox devs to include gog.com support as it already exists for Steam and when the plugin API came about I hoped somebody would make a plugin for it.

Since this didn't happen I started doing it myself. It will be another two weeks or so until it's in a state fit for a first release, but until that I thought I show you my progress and maybe somebody can answer some of my questions along the way or want to give some input.

While in theory - with the introduction of the gog Galaxy client and user profiles - everything we are used from steam integration could be implementet in a similar fashion for gog.com, the documentation for this isn't quite complete and also I wanted to start out with the assumption that you don't need to have Galaxy installed for the plugin to work.

So my first challenge was user authentification. Since this is only possible with a browser supporting JavaScipt I shopped for libraries and ended up with CefSharp, a wrapper for the Chrome Embedded Framework for Visula Studio/.Net. After loging in for the first time we receive an acces token for further API calls. To make life (and debugging) easier the token is refreshed before every API call of the plugin and stored in a file in the plugin folder so the session can be kept alive when restarting Launchbox.

Spoiler

gog2.thumb.PNG.2230059279b2e6c6a9a17d4e5fd728d5.PNGgog3.thumb.PNG.e988c993801eca9a055dec7c5f054557.PNG

After that we can get all the game data from gog.com including download paths not only for the game but also for manuals and all the extra stuff!

Spoiler

gog5.thumb.PNG.6a9fea1916d5c69ec636605fe35cf186.PNGgog6.thumb.PNG.88cd46371fee9e222369f4e04b2caf67.PNG

The next step will be adding the games to the Launchbox collection and implementing a hook to ask for the download of a game when attempting to play it and set the proper application path after that. A lot of other stuff is imaginable, like downloading and adding extras like manuals and wallpapers from the context menu, proper integration with Galaxy client if installed, implementing gog.com Achievments in the Retro Achievments API and so on...

At the moment I still have a problem with plugin loading: CefSharp comes with it's own binary and a lot of additional class libraries. It seems Launchbox tries to load them as plugins (even after moving them to a subfolder of the plugin folder). While it doesn't break anything it causes a ton of pop ups like the one below. Is there a way to prevent this?

gog1.thumb.PNG.a9459280a5eea6ca5ba3a39160f195fe.PNG

Edited by wasili
  • Like 5
Link to comment
Share on other sites

Here it is, the first version of the plugin!

I was able to resolve the problem with plugin loading by simply pointing to the CefSharp binary that already comes with Launchbox.

Also working with the galaxy client turned out to be much easier, so for now the full functionality requires it to be installed. You can still import the games without but there will be no automatic replacement of the installer download link with the executable path of the game.

For more Info see the github page here: https://github.com/GrafWasili/gogPluginForLaunchbox

 

 

Edited by wasili
Updated link to file
  • Like 2
Link to comment
Share on other sites

You only need the files in the bin folder, copy to them to a new subfolder in the plugins folder. (should be gogplugin.dll, gogplugin.dll.config and newtonsoft.json.dll)

Than you should find "Add games from gog.com" in the tools menu.

Also it only works on 64bit right now, forgot to mention that, sorry . If you need a 32bit version let me know...

Please let me know if it still won't work.

Edited by wasili
Link to comment
Share on other sites

  • 3 months later...

Everything in the plugin API documentation is definitely still accurate, but it does need updated with a few new things. Really the only thing missing now is that you can't directly access the main form (because it no longer exists).

Most plugins should also already be fully compatible as long as they're using the advertised/documented features and not diving into undocumented stuff. Looking at the error above, it looks to be unrelated to differences between .Next and the OG interface.

  • Like 1
Link to comment
Share on other sites

Thanks @Jason Carr for clarifying and and thanks @Strathos70 for confirming that the plugin does work with the current Launchbox Next version. I updated the file description accordingly.

I could not have tested it myself since I''m using Big Box and didn't renew my license for a while...

Regarding your Problem:

Could you post your output of https://embed.gog.com/account/gameDetails/2.json ?

Edited by wasili
Link to comment
Share on other sites

My screenshot show one error, but i actually get that error that all games until i close launchbox.

Here it is:

{
  "title": "Fallout 2 Classic",
  "backgroundImage": "//images-1.gog.com/2405d078c16fc6b25414d2f08725596b955f5ca899ae30f317de7269dfefa22b",
  "cdKey": "",
  "textInformation": "",
  "downloads": [
    [
      "English",
      {
        "windows": [
          {
            "manualUrl": "/downloads/fallout_2_classic/en1installer0",
            "downloaderUrl": "gogdownloader://fallout_2_classic/installer_win_en",
            "name": "Fallout 2 Classic",
            "version": null,
            "date": "",
            "size": "721 MB"
          }
        ],
        "mac": [
          {
            "manualUrl": "/downloads/fallout_2_classic/en2installer1",
            "downloaderUrl": "gogdownloader://fallout_2_classic/installer__en",
            "name": "Fallout 2 Classic",
            "version": null,
            "date": "",
            "size": "591 MB"
          }
        ]
      }
    ],
    [
      "français",
      {
        "windows": [
          {
            "manualUrl": "/downloads/fallout_2_classic/fr1installer1",
            "downloaderUrl": "gogdownloader://fallout_2_classic/installer_win_fr",
            "name": "Fallout 2 Classic",
            "version": null,
            "date": "",
            "size": "721 MB"
          }
        ]
      }
    ],
    [
      "Deutsch",
      {
        "windows": [
          {
            "manualUrl": "/downloads/fallout_2_classic/de1installer1",
            "downloaderUrl": "gogdownloader://fallout_2_classic/installer_win_de",
            "name": "Fallout 2 Classic",
            "version": null,
            "date": "",
            "size": "689 MB"
          }
        ]
      }
    ]
  ],
  "galaxyDownloads": [],
  "extras": [
    {
      "manualUrl": "/downloads/fallout_2_classic/2233",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2233",
      "name": "manual (166 pages)",
      "type": "manuals",
      "info": 1,
      "size": "1 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2253",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2253",
      "name": "HD wallpaper",
      "type": "wallpapers",
      "info": 1,
      "size": "6 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2283",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2283",
      "name": "Fallout series wallpaper",
      "type": "wallpapers",
      "info": 1,
      "size": "7 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2243",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2243",
      "name": "reference card",
      "type": "guides & reference ",
      "info": 1,
      "size": "1 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2303",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2303",
      "name": "Fallout Bible (205 pages)",
      "type": "guides & reference ",
      "info": 1,
      "size": "54 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2263",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2263",
      "name": "original soundtrack",
      "type": "audio",
      "info": 1,
      "size": "83 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2273",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2273",
      "name": "avatars",
      "type": "avatars",
      "info": 13,
      "size": "1 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2313",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2313",
      "name": "Vault Boy avatars",
      "type": "avatars",
      "info": 5,
      "size": "1 MB"
    },
    {
      "manualUrl": "/downloads/fallout_2_classic/2293",
      "downloaderUrl": "gogdownloader://fallout_2_classic/2293",
      "name": "artworks",
      "type": "artworks",
      "info": 2,
      "size": "2 MB"
    }
  ],
  "dlcs": [],
  "tags": [
    {
      "id": "427940348",
      "name": "3RPG ----- BAZ",
      "productCount": "65"
    }
  ],
  "isPreOrder": false,
  "releaseTimestamp": 0,
  "messages": [],
  "changelog": "",
  "forumLink": "https://embed.gog.com/forum/fallout_series",
  "isBaseProductMissing": false,
  "missingBaseProduct": null,
  "features": [],
  "simpleGalaxyInstallers": [
    {
      "path": "/downloads/fallout_2_classic/b1b67858e6701ddb76a1b6c1a04e7bd3",
      "os": "windows"
    },
    {
      "path": "/downloads/fallout_2_classic/e671c7410bdf555092ff79fc43b2deb7",
      "os": "mac"
    }
  ]
}

 

Edited by Strathos70
Link to comment
Share on other sites

It fails at

  "tags": [
    {
      "id": "427940348",
      "name": "3RPG ----- BAZ",
      "productCount": "65"
    }
  ],

There's no official specification of the api responses but this seems more like a messed up entry in gogs database anyway.

I'm working on implementing error handling for the json parser right now to make the plugin more robust and allow the import of games with incomplete or unexpected game information which should prevent such errors.

Link to comment
Share on other sites

  • 2 months later...
On 11/3/2018 at 2:18 PM, wasili said:

It fails at


  "tags": [
    {
      "id": "427940348",
      "name": "3RPG ----- BAZ",
      "productCount": "65"
    }
  ],

There's no official specification of the api responses but this seems more like a messed up entry in gogs database anyway.

I'm working on implementing error handling for the json parser right now to make the plugin more robust and allow the import of games with incomplete or unexpected game information which should prevent such errors.

First, I want to thank you for making this plugin.  I have many GOG games and this plugin makes it very easy to get them into launchBox.  However, like the steam import, I am unable to get a few games.  I cannot seem to get 4 of my GOG games and I get 4 errors when I use the plugin.  So, I was wondering if you had made any progress on the error handling?  If not, it's still a great plugin.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Thanks :)

I just uploaded the last version of the plugin that was sitting on my hard drive for the last three months. Parsing errors should now be skipped and logged @Strathos70, but games with incomplete or ill-formed information will still be skipped @Jade Aislin.

I didn't have the time to further improve the plugin (and won't have it in the near future...). So as long as nobody else does the job we will have to content ourselves with the basic functionality it provides and handle the games that can't be imported manually...

Link to comment
Share on other sites

  • 2 months later...

Just discovered this today.  Like the idea.  My collection on GOG is still quite small, though I am certain there are more than a few out there with massive collections that would find this VERY useful.  Perhaps you could get the word out by seeing if this could be covered in one of the semi-regular Launchbox videos?

Link to comment
Share on other sites

  • 3 weeks later...

Thanks :) If the Launchbox team wants to do a video on it they are free to do so and I would be humbled ;)

But I think the plugin also shows up if you search for launchbox and gog.com on google so i guess people who are looking for something like this should find it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...