ABaumher / galaxy-integration-steam

Integration with Steam for Galaxy
Other
800 stars 19 forks source link

Steam Integration

GOG Galaxy 2.0 Community integration for Steam.

Table of Contents

Open Beta

This project is in open beta. It is not completely bulletproof, but it has been extensively tested. We are hoping that crowdsourcing the error checking will help find anything we may have missed.

Known Issues

Installation

  1. Close GOG Galaxy.
  2. Download the windows.zip file of the latest version in the Releases page.
  3. Navigate to GOG Galaxy steam plugin directory:
    • Windows:
      %localappdata%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8
    • macOS:
      ~/Library/Application Support/GOG.com/Galaxy/plugins/installed/steam_ca27391f-2675-49b1-92c0-896d43afa4f8
  4. If the directory does not exist, create it. If it does, delete all its content.
  5. Extract the content of windows.zip to that directory.
  6. Start GOG Galaxy.

Logging

We tried to kill as many bugs and test as many behaviors as possible, but we aren't perfect.
You may find some case we haven't tested.
Please raise an issue here, and in the comment, attach your logs.
They can be found here:

We typically only need the steam_<numbers and letters>.log file.

Setup (For Developers)

You will need Python 3.7, and at least Python 3.7.9. If on Windows, you need to use the 32-bit version. You will then need to set up your python virtual environment, and then have pip get all the dependencies the project needs in your virtual environment. Once you have that, you can start making changes. Some IDEs will do this for you, but here are explicit instructions for doing it on your own.

Environment Setup (Windows)

Environment Setup (macOS)

Making Changes

Once you are set up, you can make whatever changes you need to. There are, however, a few commands we'd like to make you aware of.

Steam uses protobufs for its messages. Please see README_UPDATE_PROTOBUF_FILES.md in the protobuf_files directory for more information on how these work and how to update them.

There are several commands that make your life easier. These are done via the invoke python module. To do so, make sure your virtual environment is active (.venv\Scripts\activate.ps1 on Windows via cmd/powershell, .venv/Scripts/activate on macOS via Terminal) and then the following commands will be available to you:

To build your code, run inv build
To run the defined python tests on your code, run inv test
To install the changed code on your local GOG Galaxy instance, run inv install. Note that GOG Galaxy must not be running when you do this. To pack a zipped release file that you can share with others, run inv pack

Testing new Builds (non-developers)

For some testing, we will require you build to the latest version from scratch. For non-developers, however, the full developer install is overkill, so we've made a simplified version that only does the bare essentials to take the source code and install a plugin from it. There are only a few commands you need to run. If you want to know what they do, they are documented above each command. A tl;dr: version is below it.

Please do the following:

Installation (non-dev, TL;DR)

Windows (Powershell recommended)

@echo You must have installed python 3.7.9 (32 bit). If not, the rest of this won't work.
py.exe -3.7 -m venv .venv
@echo If the previous command did not work, you do not have py installed or py is not in your PATH.
@echo If you only have python 3.7.9, run the next command.
@echo If it worked, skip the next command.
python.exe -m venv .venv
@echo virtual environment is installed. on to the next step.
.venv\Scripts\activate
pip install -r requirements/install.txt
inv install

macOS (assumes your shell is bash, which is the default. if you are good enough to change that, you can figure out how to run these)

echo You must have installed python 3.7.9 (macOS). If not, the rest of this won't work.
py -3.7 -m venv .venv
echo If the previous command did not work, you do not have py installed or py is not in your PATH.
echo If you only have python 3.7.9, run the next command.
echo If it worked, skip the next command.
python -m venv .venv
echo virtual environment is installed. on to the next step.
.venv/Scripts/activate
pip install -r requirements/install.txt
inv install

Install Error fixes

If inv install throws a bunch of errors, make sure you have the proper python venv set up. It should complain about getargspec. If this happens, you created the wrong virtual environment. You can either delete the .venv folder and reinstall it, or create a new virtual environment with a different name and use that.

Make sure you use py -3.7 when creating your venv. If you don't have py, get it. You can specify the full path to python 3.7 instead if you want, but that's harder to do and harder to explain here.

Why this fork?

Well, without being too complicated, Steam changed how they do authentication. We used to be able to use one call and magically get a lot of info we needed. But, if we're being honest, it was a little insecure, and it easy. While we were using it for legitimate purposes, not everyone else was, and one of Valve's greatest deterrence to botting or DOS attacks (etc) is making things difficult. The new workflow uses a significant back-and-forth between a Steam Server and ourselves, closely resembling a common web form of authentication called OAuth2. This meant a lot of under-the-hood changes.

Credits

Current Version

This is a fork of https://github.com/FriendsOfGalaxy/galaxy-integration-steam

The new Authorization flow implementation is heavily influenced by SteamKit. https://github.com/SteamRE/SteamKit
While we have not utilized their source code, they have implemented the new authentication workflow before we did, and we used their knowledge of how to do so in order to implement it ourselves. If you are doing anything steam related in C#, you should check them out; their project has far more features than our own.

Some work was influenced by ValvePython. https://github.com/ValvePython/steam
Our projects do the same thing, but use different methods (we use asyncio, they use gevent, for example). Both projects were working on the new Auth Flow simultaneously, with little collaboration between us. That said, their scope is much larger than our own and lets you do a lot more things. If you are looking for a python means of implementing a steam network authentication, you should use their work instead.

The names of individual developers will appear here, soon(ish). Any thanks can be directed there

Original Version

Original Plugin was based on work and research done by others: