Skip to content

[Feat] Add support for Amazon Games #2831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Jul 15, 2023

Conversation

Gustash
Copy link
Contributor

@Gustash Gustash commented Jun 30, 2023

Amazon Games Support

This PR adds support for Amazon Games.

It uses Nile to interface with your Amazon Games library.

2023-06-30-215042_hyprshot

I have tested on Linux, macOS and Windows. All the basic features have been seen as working, as noted in the TODO list below.

EDIT:

Also tested the .flatpak artifact on the Steam Deck, all features are working there too.

TODO:

  • Display list of games
  • Filter by Amazon Games only
  • Game Info page
  • Installing game
  • Running game
  • Download progress
  • Authentication
  • Game Updates
  • Importing (?)

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@Gustash

This comment was marked as resolved.

@Gustash Gustash force-pushed the feat/amazon-games branch from 49054f6 to e5e6e66 Compare July 3, 2023 19:21
@Gustash Gustash marked this pull request as ready for review July 4, 2023 17:14
@Gustash Gustash changed the title [DRAFT] feat: Add support for Amazon Games feat: Add support for Amazon Games Jul 4, 2023
@imLinguin imLinguin added the pr:ready-for-review Feature-complete, ready for the grind! :P label Jul 4, 2023
@imLinguin imLinguin requested review from a team, arielj, flavioislima, CommandMC, Nocccer and imLinguin and removed request for a team July 4, 2023 17:24
@derrod
Copy link

derrod commented Jul 5, 2023

Currently this appears to not detect if a user has already logged in manually via the CLI. Otherwise seems to work fine for me (on Windows).

@imLinguin
Copy link
Member

@derrod this is due to sandboxed config of Nile. Same we do with legendary now

@derrod
Copy link

derrod commented Jul 5, 2023

@derrod this is due to sandboxed config of Nile. Same we do with legendary now

The config file is migrated still, so Nile was logged in when running from Heroic. But it still showed as logged out and clicking the login button just did nothing. Also noteworthy that even deleting the Nile config didn't work as it would then copy the global one again, thus getting into a bad state again.

@imLinguin
Copy link
Member

Ah yes. I encountered same issue. Heroic doesn't detect that Nile is logged in already

@Gustash
Copy link
Contributor Author

Gustash commented Jul 5, 2023

Currently this appears to not detect if a user has already logged in manually via the CLI. Otherwise seems to work fine for me (on Windows).

This has been resolved now

EDIT:

If you've previously tested this PR the fix won't take effect as it only loads the user into the cache store when copying the global config directory. If you already have a local config directory for Heroic, it won't follow that branch.

This is not an issue for users opening Heroic for the first time with the changes from the latest commit

@flavioislima
Copy link
Member

That is pretty cool. Thanks for that.
One comment, not related though, is that we need to figure it out a better way of having those store filters since now it is not that practical. We should change it to be a select with the options instead.

I will test as soon as possible on all platforms.

@Gustash
Copy link
Contributor Author

Gustash commented Jul 5, 2023

That is pretty cool. Thanks for that.

I'm happy to contribute ☺️

One comment, not related though, is that we need to figure it out a better way of having those store filters since now it is not that practical. We should change it to be a select with the options instead.

Is this something you want me to do on this PR, or would it be more relevant in a separate PR after this?

@Gustash Gustash force-pushed the feat/amazon-games branch from 76920e6 to 59cc217 Compare July 9, 2023 20:02
Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing here.
One thing that can be improved:
if there are only windows games on Prime, then we could hide the OS filter. Right now it disables macOS but keeps the browser button, Browser should actually only show when OTHER is selected.
Clicking on it while the amazon is selected does nothing.

@@ -96,7 +98,7 @@ export interface ExtraInfo {
export type GameConfigVersion = 'auto' | 'v0' | 'v0.1'

export interface GameInfo {
runner: 'legendary' | 'gog' | 'sideload'
runner: 'legendary' | 'gog' | 'sideload' | 'nile'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use Runner here at some point.

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested here on macOS and works pretty well. Was able to log in, install, uninstall, play, etc.
That's a pretty good job. Ofc it will have bugs but I think it is ready for the next release :)

@flavioislima flavioislima changed the title feat: Add support for Amazon Games [Feat] Add support for Amazon Games Jul 14, 2023
@flavioislima
Copy link
Member

@Gustash
Let's do the other stuff I said on another PR.
For now just update the nile binaries and fix the conflicts and then it should be ready to merge 👍🏽

@Gustash Gustash force-pushed the feat/amazon-games branch from e4dc93a to 07a661e Compare July 15, 2023 09:13
@Gustash
Copy link
Contributor Author

Gustash commented Jul 15, 2023

@flavioislima I've fixed the merge conflicts. I'm just waiting on Linguin fixing subprocess reaping in nile for Windows and macOS, as it currently doesn't work for killing games from Heroic.

EDIT:

As mentioned on Discord, this can be merged as is. We'll try to figure out subprocess termination on Windows/macOS in Nile. When that's fixed, a binary update should be all that's needed

@Gustash
Copy link
Contributor Author

Gustash commented Jul 15, 2023

Force stopping games is now working properly for Linux and macOS. On Windows it still doesn't work, but I found that gogdl also doesn't force stop the game on Windows. Since Nile shares pretty much a 1-to-1 mechanism for subprocesses as gogdl, this is not an isolated issue and has probably existed on Windows for a while.

I say we get this PR merged and deal with gogdl and nile not stopping games on Windows in a separate PR.

Copy link
Member

@imLinguin imLinguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left small comment, but overall it looks good to me.

Amazing work ⚔️

@flavioislima flavioislima merged commit 18f60f2 into Heroic-Games-Launcher:main Jul 15, 2023
@Gustash Gustash deleted the feat/amazon-games branch July 15, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amazon Games / Twitch support
4 participants