FriendsOfGalaxy / galaxy-integration-steam

Integration with Steam for Galaxy
367 stars 76 forks source link

Steam offline bug #159

Open m1cha3l02 opened 1 year ago

m1cha3l02 commented 1 year ago

Describe the bug While trying to log in to steam with plugin in the GOG app tries to load but it always ends with a message "Offline. Try again."

To Reproduce

  1. Launch GOG Galaxy
  2. Try to log in with your steam account
  3. The "Offline" message should pop up

Expected behavior An expcted behaviour should be the abillity to log in and synchronise my games within the GOG Galaxy launcher

gOOvER commented 1 year ago

Someone should for FriendsOfGalaxy and start again. Looks like, FriendsOfGalaxy is dead

gOOvER commented 1 year ago

I found https://playnite.link/

and switched to this.

marvelvang commented 1 year ago

To be honest I am also trying out playnite myself now.. after being a GOG Galaxy fan all these years since it came out.

mauro-merconchini commented 1 year ago

I found https://playnite.link/

and switched to this.

Nowhere near as nice of an interface or as simple to use as GOG Galaxy. The answer to wanting to have the Steam integration functionality restored in GOG Galaxy isn't "switch to a completely different launcher".

salvador-lax commented 1 year ago

i saw some people talking about this playnite app and after some time figuring out how to set some plugins and themes, have to say its a really good alternative to gog galaxy, it even has a gog theme that feels a lot like the real thing, for now and since it seems the community in this app is more active, i will be using this one

Pilogoude commented 1 year ago

I found https://playnite.link/

and switched to this.

Ok I tried, it's just amazing how much customization is possible. No turning back now, just too good

PescheHelfer commented 1 year ago

I found https://playnite.link/ and switched to this.

Ok I tried, it's just amazing how much customization is possible. No turning back now, just too good

I have been using it for roughly a year, now. It is indeed absolutely great! The only thing I really miss which GoG does pretty well: you can't synchronize across devices. If you play a game on your laptop/Steam Deck and on your PC, you have to manually update the play count on the devices, or depending on the platform, also the playtime. But that's only an issue if you even care about those statistics ;) I am currently using Playnite as my main launcher on the PC, and GoG Galaxy on the laptop for that reason.

OpenRift412 commented 1 year ago

Guys, we're getting off track here, take the Playnite stuff somewhere else please.

RaveVR commented 1 year ago

i saw some people talking about this playnite app and after some time figuring out how to set some plugins and themes, have to say its a really good alternative to gog galaxy, it even has a gog theme that feels a lot like the real thing, for now and since it seems the community in this app is more active, i will be using this one

Indeed, it's decent, i checked it and i just can't get over it, i even downloaded this GOG theme. I don't feel it, it's weird, not many options and features like GOG Galaxy has. This issue is dedicated to GOG Galaxy and let it stay that way, a replacement application has been given for those who are willing and let's finish the Playnite topic. I just add downloaded games on Steam with option "Add game manually" and I will continue to use our Galaxy application. Let's hope someone who knows how, will get this done.

wp4nuv commented 1 year ago

Has anyone considered using their web API at https://steamcommunity.com/dev?snr= I agree that, at this point, whatever login functions exist, they were based on an older Steam client. Steam has revamped its login process to use QR codes as the preferred method.

mrwensveen commented 1 year ago

I've created a fork so I can try my hand at this. I'm not really into the Python ecosystem, so if anyone knows how to create a workable build (including manifest.json, etc.) I would be much obliged.

skull-squadron commented 1 year ago

I've created a fork so I can try my hand at this. I'm not really into the Python ecosystem, so if anyone knows how to create a workable build (including manifest.json, etc.) I would be much obliged.

pip3 (or pip) install fog.buildtools invoke source is here

invoke release from the source dir of this

PS: I use Python maybe once a year, but found this with about 3 minutes of Googling. It's not rocket surgery.

mrwensveen commented 1 year ago

@steakknife interesting, I guess your google-fu is better than mine. However, I still can't get this to build. It looks like the humblebundle and amazon integrations have a tasks.py file defining a release task.

Bertaz commented 1 year ago

@thibmo maybe you already found it, but this is a live implementation of https://github.com/SteamRE/SteamKit/pull/1129.

Might also be useful to look at the rest of JustArchiNET/ArchiSteamFarm steam authentication code

mauro-merconchini commented 1 year ago

@steakknife interesting, I guess your google-fu is better than mine. However, I still can't get this to build. It looks like the humblebundle and amazon integrations have a tasks.py file defining a release task.

Hi, @thibmo's forked branch has updated instructions on the README for how to build and test. I was able to follow through each step successfully to build the Steam integration from scratch. Hope that helps.

skull-squadron commented 1 year ago

Interesting. I'll have to give it a shot when I get home. Some of these commercial OSS things don't release workable code to the world. They pull such stunts at work because they're not incentivized to make FOSS usable.

On Tue, Mar 21, 2023 at 3:09 PM Matthijs Wensveen @.***> wrote:

@steakknife https://github.com/steakknife interesting, I guess your google-fu is better than mine. However, I still can't get this to build. It looks like the humblebundle and amazon integrations have a tasks.py file defining a release task.

— Reply to this email directly, view it on GitHub https://github.com/FriendsOfGalaxy/galaxy-integration-steam/issues/159#issuecomment-1478517045, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABWYMD6YFY3YH67GNGNNYTW5IDGHANCNFSM6AAAAAAVUP7BY4 . You are receiving this because you were mentioned.Message ID: @.*** com>

Fikus25 commented 1 year ago

I have the same issue too. I see the latest version of this integration is kinda old - Nov 4, 2021.

letallan commented 1 year ago

Is there any solution for mac users? 32-bit version of python 3.7.9 doesn't exist for mac to build from source :(

FaithTheSlayer commented 1 year ago

I started having this issue for the first time today

FaithTheSlayer commented 1 year ago

@steakknife interesting, I guess your google-fu is better than mine. However, I still can't get this to build. It looks like the humblebundle and amazon integrations have a tasks.py file defining a release task.

Hi, @thibmo's forked branch has updated instructions on the README for how to build and test. I was able to follow through each step successfully to build the Steam integration from scratch. Hope that helps.

I tried all this and it's all greek to me, can you please help me out? It sounds like you fixed yours?

MichalMichalak commented 1 year ago

I found this in logs. Maybe can be of help. I am not familiar with Python.

2023-03-23 22:44:01,369 - galaxy.task_manager - ERROR - Task manager plugin internal: exception raised in task 1 (shutdown)
Traceback (most recent call last):
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\galaxy\task_manager.py", line 21, in task_wrapper
    result = await coro
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\galaxy\api\plugin.py", line 283, in shutdown
    await asyncio.wait_for(self.shutdown(), 30)
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\tasks.py", line 416, in wait_for
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\plugin.py", line 190, in shutdown
    await self._backend.shutdown()
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\backend_steam_network.py", line 148, in shutdown
    await self._cancel_task(self._steam_run_task)
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\backend_steam_network.py", line 153, in _cancel_task
    await task
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py", line 102, in run
    await run_task
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\protocol_client.py", line 192, in run
    await self._protobuf_client.run()
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\protocol\protobuf_client.py", line 92, in run
    packet = await asyncio.wait_for(self._socket.recv(), 0.1)
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\tasks.py", line 416, in wait_for
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\websockets\protocol.py", line 474, in recv
    "cannot call recv while another coroutine "
RuntimeError: cannot call recv while another coroutine is already waiting for the next message
2023-03-23 22:44:01,372 - steam_network.websocket_client - DEBUG - Expected WebSocket disconnection
2023-03-23 22:44:01,372 - steam_network.websocket_client - INFO - Closing websocket
2023-03-23 22:44:01,372 - steam_network.websocket_client - INFO - Closing protocol client
2023-03-23 22:44:01,372 - steam_network.websocket_client - ERROR - Failed to establish authenticated WebSocket connection RuntimeError('Session is closed')
2023-03-23 22:44:01,373 - root - ERROR - Task exception was never retrieved
future: <Task finished coro=<WebSocketClient.run() done, defined at [REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py:74> exception=RuntimeError('Session is closed')>
Traceback (most recent call last):
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py", line 77, in run
    await self._ensure_connected()
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_client.py", line 199, in _ensure_connected
    async for ws_address in self._websocket_list.get(self.used_server_cell_id):
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_list.py", line 38, in get
    sockets = await self._fetch_new_list(cell_id)
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\websocket_list.py", line 33, in _fetch_new_list
    servers = await self._http_client.get_servers(cell_id)
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\steam_http_client.py", line 18, in get_servers
    response = await self._http_client.get(url)
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\http_client.py", line 22, in get
    return await self._request("GET", url, *args, **kwargs)
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\http_client.py", line 19, in _request
    return await self._session.request(method, url, *args, **kwargs)
  File "[REDACTED]\AppData\Local\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\aiohttp\client.py", line 399, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed
FaithTheSlayer commented 1 year ago

Can anyone please fix this or find a solution to have this work? I can throw you 5 or 10 bucks via pay pal sometime around the 1st

HexagonIsTheBestagon commented 1 year ago

@FaithTheSlayer I concur, I would also throw in another 10€ as a bugfixing bounty!

ShadowDrakken commented 1 year ago

@steakknife interesting, I guess your google-fu is better than mine. However, I still can't get this to build. It looks like the humblebundle and amazon integrations have a tasks.py file defining a release task.

Hi, @thibmo's forked branch has updated instructions on the README for how to build and test. I was able to follow through each step successfully to build the Steam integration from scratch. Hope that helps.

Really needs a built download available. Most people aren't going to want to install Python just for this. Trying to build other people's source is a pain in the backside, and the average user isn't going to have a clue anyway.

skull-squadron commented 1 year ago
  1. Installed python 3.7.9 winget install Python.Python.3.7
  2. protoc-3.18.1 -> protoc.exe in %LOCALAPPDATA%\Programs\Python\Python37
  3. $env:PATH += ";${env:LOCALAPPDATA}\Programs\Python\Python37"
  4. Grab the code @ 9ef43407c389a39382e539d7956acfa4415aca72
  5. Extract somewhere
  6. pip install -r requirements\dev.txt
  7. inv generate-protobuf-messages build test pack # note: test_integration.py fails, but it's unrelated
  8. inv install # installs to the local machine
  9. Start GOG
  10. (No change as of 9ef43407c389a39382e539d7956acfa4415aca72.)
skull-squadron commented 1 year ago

I found this in logs. Maybe can be of help. I am not familiar with Python.


2023-03-23 22:44:01,369 - galaxy.task_manager - ERROR - Task manager plugin internal: exception raised in task 1 (shutdown)

More than likely, authentication failed because of a protobuf problem where the client didn't send what the server expected. The server hung up while the client tried to read from a closed connection. I wouldn't put much effort into this because it's clearly deprecated and abandoned. Any multiple game platform app should be a compiled native app because performance of GOG Galaxy written in Python is comparable to the speed of the DMV. It needs a rewrite rather than trying to keep it on ECMO in the code hospital when it needs hospice and to pull the plug.

FaithTheSlayer commented 1 year ago
  1. Installed python 3.7.9 winget install Python.Python.3.7
  2. protoc-3.18.1 -> protoc.exe in %LOCALAPPDATA%\Programs\Python\Python37
  3. $env:PATH += ";${env:LOCALAPPDATA}\Programs\Python\Python37"
  4. Grab the code @ 9ef43407c389a39382e539d7956acfa4415aca72
  5. Extract somewhere
  6. pip install -r requirements\dev.txt
  7. inv generate-protobuf-messages build test pack # note: test_integration.py fails, but it's unrelated
  8. inv install # installs to the local machine
  9. Start GOG
  10. (No change as of 9ef4340.)

Soo by no changes I take it this didn't work?

mrwensveen commented 1 year ago

Would it be worth checking out OAuth authentication instead? (https://partner.steamgames.com/doc/webapi_overview/oauth)

ohad-seltzer commented 1 year ago
  1. Installed python 3.7.9 winget install Python.Python.3.7

    1. protoc-3.18.1 -> protoc.exe in %LOCALAPPDATA%\Programs\Python\Python37

    2. $env:PATH += ";${env:LOCALAPPDATA}\Programs\Python\Python37"

    3. Grab the code @ 9ef43407c389a39382e539d7956acfa4415aca72

    4. Extract somewhere

    5. pip install -r requirements\dev.txt

    6. inv generate-protobuf-messages build test pack # note: test_integration.py fails, but it's unrelated

    7. inv install # installs to the local machine

    8. Start GOG

    9. (No change as of 9ef4340.)

@steakknife Did this solve the issue?

FaithTheSlayer commented 1 year ago
  1. Installed python 3.7.9 winget install Python.Python.3.7

    1. protoc-3.18.1 -> protoc.exe in %LOCALAPPDATA%\Programs\Python\Python37
    2. $env:PATH += ";${env:LOCALAPPDATA}\Programs\Python\Python37"
    3. Grab the code @ 9ef43407c389a39382e539d7956acfa4415aca72
    4. Extract somewhere
    5. pip install -r requirements\dev.txt
    6. inv generate-protobuf-messages build test pack # note: test_integration.py fails, but it's unrelated
    7. inv install # installs to the local machine
    8. Start GOG
    9. (No change as of 9ef4340.)

@steakknife Did this solve the issue?

I've been waiting 4 days for an answer to that lol

GrTsPat commented 1 year ago

Same problem for me also.

gOOvER commented 1 year ago

Same problem for me also.

everyone have this problem and sind FoG is dead, there are not really updates anymore

JohnnyNoArms commented 1 year ago

I've given up on GOG Galaxy and switched to Playnite. It authenticated my steam account on the first try with no issues.

gOOvER commented 1 year ago

same for me; Galaxy was fine; Playnite is a lot better

Danyelalejandro commented 1 year ago

I would love a fix because I like how GOG Galaxy groups a game and shows the icons in which platform you have it. Playnite repeats them all. You can have the same game in Epic, Steam, gog, Humble, Playstation, 4 or 5 times repeated

gOOvER commented 1 year ago

I would love a fix because I like how GOG Galaxy groups a game and shows the icons in which platform you have it. Playnite repeats them all. You can have the same game in Epic, Steam, gog, Humble, Playstation, 4 or 5 times repeated

https://playnite.link/addons.html#felixkmh_DuplicateHider_Plugin

;)

Only shown 1 time with a little icon in the corner where you own the game

Allexedge commented 1 year ago

I was able to make it work somehow by two small fixes in %LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\backend_steam_network.py file: 1) _get_websocket_auth_step(self) function (line 186): comment out or delete exception raising and return success operation code instead (timeout value was also decreased to 20 seconds, not sure if it has affected something):

async def _get_websocket_auth_step(self):
        try:
            result = await asyncio.wait_for(
                self._websocket_client.communication_queues["plugin"].get(), 20
            )
            return result["auth_result"]
        except asyncio.TimeoutError:
            return UserActionRequired.NoActionRequired
            #raise BackendTimeout() 

2) _handle_two_step(self, params, fail, finish) function (line 229): explicitly return Authentication object instead of self._check_public_profile(). Without this edit the plugin shows warning "2FA authentication failed, falling back to public profile" but still imports Steam library.

        if result != UserActionRequired.NoActionRequired:
            return next_step_response(fail, finish)
        else:
            self._auth_data = None
            self._store_credentials(self._user_info_cache.to_dict())
            return Authentication(self._user_info_cache.steam_id, self._user_info_cache.persona_name)

3) Restart GOG Galaxy and re-enter Steam credentials.

ShadowDrakken commented 1 year ago

I was able to make it work somehow by two small fixes in %LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\backend_steam_network.py file:

Can confirm, this worked for me as well

Fredoias commented 1 year ago

Same issue.

Chalice commented 1 year ago

I was able to make it work somehow by two small fixes in %LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\backend_steam_network.py file:

1. `_get_websocket_auth_step(self)` function (line 186): comment out or delete exception raising and return success operation code instead (timeout value was also decreased to 20 seconds, not sure if it has affected something):

2. `_handle_two_step(self, params, fail, finish)` function (line 229): explicitly return Authentication object instead of `self._check_public_profile()`. Without this edit the plugin shows warning  "2FA authentication failed, falling back to public profile" but still imports Steam library.

3. Restart GOG Galaxy and re-enter Steam credentials.

Can confirm, this fixed it!

Chalice commented 1 year ago

But, to add to my last reply - even if this is a working, temporary fix, we still need a long term solution. The next time Steam change their API or access requirements, things might be (even more) dire without any active development on the integration.

Drejzer commented 1 year ago

I was able to make it work somehow by two small fixes in %LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\backend_steam_network.py file:

The file was one directory higher for me.

The sync took a long while, but it did update the library and gametime. Though restarting the galaxy client makes it go to "offline" again and clicking "retry" does absolutely nothing.

At least for me.

jckorlian commented 1 year ago

I was able to make it work somehow by two small fixes in %LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\backend_steam_network.py file:

I wonder if I have a bigger problem, I don't even have the backend_steam_network.py file in my folder.

MrMody0 commented 1 year ago

I was able to make it work somehow by two small fixes in %LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\backend_steam_network.py file:

Few problems.

  1. I don't have this file in steam_network folder, even if i delete whole plugin and download it again.
  2. My backend_steam_network.py file is directly in steam_ca27391f-2675-49b1-92c0-896d43afa4f8 folder.
  3. If i edit this file with Notepad++ and save it. I do not even get ask for Steam Credentials, it just goes straight to Plugin has crashed.

I also try with https://github.com/thibmo/galaxy-integration-steam/tree/fix_steam_2023_01 looks promising, but 0 results, cause i probably don't understand something. Any help please? I really would love to make it work in any way ^_^

Yes, restarted GOG and tried to do everything when GOG was disabled, also in task manager.

Dorque commented 1 year ago

I was able to make it work somehow by two small fixes in %LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\steam_network\backend_steam_network.py file:

The file was one directory higher for me.

The sync took a long while, but it did update the library and gametime. Though restarting the galaxy client makes it go to "offline" again and clicking "retry" does absolutely nothing.

At least for me.

Yeah this looks to be a temporary solution only. The plugin does log in with username+password+2FA successfully, but the plugin is not grabbing the token correctly to use for subsequent authentication calls, like when you restart galaxy. This temporary fix makes it continue even without getting the correct token.

I have been looking through the code for days but am not familiar with the way it uses web sockets to authenticate so have not been successful in figuring out how to get, store, and authenticate with this token.

OpenRift412 commented 1 year ago

Yeah no, this solution is just crashing for me. I don't think step 2 lines up with what's showing up in the code. Also backend_steam_network.py is also in the folder above steam_network for me.

ShadowDrakken commented 1 year ago

Yeah no, this solution is just crashing for me. I don't think step 2 lines up with what's showing up in the code. Also backend_steam_network.py is also in the folder above steam_network for me.

for everyone that's crashing; make sure your indentation is correct. Python annoyingly cares about whitespace. Each indent should be 4 spaces, no tabs. So if something is indented twice that's 8 spaces, three times is 12 spaces, etc.

Danyelalejandro commented 1 year ago

Yeah no, this solution is just crashing for me. I don't think step 2 lines up with what's showing up in the code. Also backend_steam_network.py is also in the folder above steam_network for me.

for everyone that's crashing; make sure your indentation is correct. Python annoyingly cares about whitespace. Each indent should be 4 spaces, no tabs. So if something is indented twice that's 8 spaces, three times is 12 spaces, etc.

Someone could share please, a working file backend_steam_network.py with no mistakes for all of us? please?

Allexedge commented 1 year ago

Someone could share please, a working file backend_steam_network.py with no mistakes for all of us? please?

Attached mine. Yes, it's actually in the root folder of plugin, apparently I've copy-pasted incorrect directory path. Just extract the archive contents into "%LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8\" folder. backend_steam_network.zip

MrMody0 commented 1 year ago

Someone could share please, a working file backend_steam_network.py with no mistakes for all of us? please?

Attached mine. Yes, it's actually in the root folder of plugin, apparently I've copy-pasted incorrect directory path. Just extract the archive contents into "%LOCALAPPDATA%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8" folder. backend_steam_network.zip

Worked like a charm! Thanks, great work for sharing ready file. It is something and i am happy till my games will dissappear. I hope that someone will get this done for the future.