Jump to content
LaunchBox Community Forums

Recommended Posts

Posted (edited)

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 4

Share this post


Link to post
Share on other sites
Posted (edited)

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 1

Share this post


Link to post
Share on other sites

I must be doing something wrong... it's not loading. 

I've extracted the files to the plugins folder, unblocked the files using powershell. firedup LB... nothing.. how do i know if the plug in works ? 

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)

Sorry for not reporting back.. it works now.. this hairless ape that is sitting behind the keyboard was working out of launchbox.next  :S it works, it works in launchbox! thanks !

Edited by Klopjero

Share this post


Link to post
Share on other sites

Thank you for this plugin.

Now that the launchbox next became the default launchbox, are you planning to make this compatible?

Share this post


Link to post
Share on other sites

You're welcome!

I would, but the plugin API documentation hasn't been updated for Launchbox Next and there's no info on how to make plugins compatible, at least when I last checked.

If anybody could point me in the right direction tough...

Share this post


Link to post
Share on other sites

I think I found the reason

From skimming the thread I take that the plugin should work with the latest beta release. Did anybody try?

Edited by wasili

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×