redromnon / HeroicBashLauncher

Directly launch any Epic Games Store and GOG game from anywhere without Heroic on Linux.
GNU General Public License v3.0
354 stars 17 forks source link

[Feature Request] cache epic authorization file for Epic games installed by heroic launcher using multiple epic accounts #100

Open shuozhifenxi opened 2 years ago

shuozhifenxi commented 2 years ago

Is your feature request related to a problem? Please describe. I installed several games by heroic launcher using multiple epic accounts. I found only the games associated with the epic account currently logged with heroic launcher can be played

Describe the solution you'd like Could we cache the user authorization file within the game start script so that all game installed by heroic launcher using multiple epic accounts can be played instantly?

Describe alternatives you've considered If the above solution is not possible, can we at least have a way to switch account in place (with saved username and password) without go to the heroic launcher (heroic launcher does not provide method to save passwords for multiple epic accounts) ?

Additional context Thank you very much in advance.

redromnon commented 2 years ago

Epic Store games are supposed to be launched via Legendary (the unofficial Epic Games launcher Heroic uses) for authorization and other purposes (updates, etc.). For instance, you cannot play some games like Rocket League directly via the exe file and is not recommended. Some other games will work.

I cannot implement this feature until Heroic does. And I'm pretty sure Heroic won't.

dadadawin commented 2 years ago

For my understanding (please correct me if I am wrong), the Legendary has a command line based interface and there is an "legendary auth" command with the "--import" flag to import the authentication from the Epic Games Launcher (or Heroic launcher, in our case here), and the authentication file for Heroic laucher is just in the "/home/deck/.var/app/com.heroicgameslauncher.hgl/config/heroic/" directory. Could we backup the authentication file when heroicbashlauncher build the start script for the game and in the script, call the "legendary auth" command with the "--import" flag right before it try to run the game?

redromnon commented 2 years ago

That may be possible. I'm not sure how the --import flag exactly works.

There's even a legendary folder that holds the info about the logged-in user. Can you point out the authentication file that you've mentioned?

dadadawin commented 2 years ago

That may be possible. I'm not sure how the --import flag exactly works.

There's even a legendary folder that holds the info about the logged-in user. Can you point out the authentication file that you've mentioned?

I think it is the file /home/deck/.var/app/com.heroicgameslauncher.hgl/config/heroic/legendary/user.json. Although I am not 100% sure that is the format that the command lagendary auth --import wants, it does have the very long token for authentication, so even the format is not correct I guess at least we can construct the required auth file based the info in it.

redromnon commented 2 years ago

Okay, so here's what Legendary's readme states -

Alternatively you can use the --import flag to import the authentication from the Epic Games Launcher (manually specifying the used WINE prefix may be required on Linux). Note that this will log you out of the Epic Launcher.

I think the user needs to mention the wine prefix path where EGS is installed (like if it's installed via Lutris).