Open empjustine opened 1 year ago
Due to how Flatpak sandboxes processes, there is nothing we can really do about that. You will need the non-Flatpak version of Steam to use XIVLauncher.
It doesn't warn the user when "Use steam service" is toggled, it just logs (silently) to the console; that is usually not visible when just running a GUI.
Should it emit a visible GUI warning when "Use steam service" is toggled under flatpak then?
[empjustine@huixtocihuatl XIVLauncher.Core]$ git status
HEAD detached at 1.0.3
[empjustine@huixtocihuatl XIVLauncher.Core]$ dotnet publish -r linux-x64 src/XIVLauncher.Core
# (output supressed)
XIVLauncher.Core -> /var/home/empjustine/XIVLauncher.Core/src/XIVLauncher.Core/bin/Debug/net6.0/linux-x64/publish/
[empjustine@huixtocihuatl XIVLauncher.Core]$ /var/home/empjustine/XIVLauncher.Core/src/XIVLauncher.Core/bin/Debug/net6.0/linux-x64/publish/XIVLauncher.Core
[S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam.
dlopen failed trying to load:
/var/home/empjustine/.steam/sdk64/steamclient.so
with error:
/var/home/empjustine/.steam/sdk64/steamclient.so: cannot open shared object file: No such file or directory
[S_API] SteamAPI_Init(): Sys_LoadModule failed to load: /var/home/empjustine/.steam/sdk64/steamclient.so
[S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam.
dlopen failed trying to load:
/var/home/empjustine/.steam/sdk64/steamclient.so
with error:
/var/home/empjustine/.steam/sdk64/steamclient.so: cannot open shared object file: No such file or directory
[S_API] SteamAPI_Init(): Sys_LoadModule failed to load: /var/home/empjustine/.steam/sdk64/steamclient.so
Unhandled exception. System.TypeInitializationException: The type initializer for 'Veldrid.Sdl2.Sdl2Native' threw an exception.
---> System.Exception: Didn't find library.
at NativeLibraryLoader.NativeLibrary..ctor(IEnumerable`1 names)
at Veldrid.Sdl2.Sdl2Native.LoadSdl2()
at Veldrid.Sdl2.Sdl2Native..cctor()
--- End of inner exception stack trace ---
at Veldrid.Sdl2.Sdl2Native.SDL_Init(SDLInitFlags flags)
at Veldrid.StartupUtilities.VeldridStartup.CreateWindowAndGraphicsDevice(WindowCreateInfo windowCI, GraphicsDeviceOptions deviceOptions, GraphicsBackend preferredBackend, Sdl2Window& window, GraphicsDevice& gd)
at Veldrid.StartupUtilities.VeldridStartup.CreateWindowAndGraphicsDevice(WindowCreateInfo windowCI, GraphicsDeviceOptions deviceOptions, Sdl2Window& window, GraphicsDevice& gd)
at XIVLauncher.Core.Program.Main(String[] args) in /var/home/empjustine/XIVLauncher.Core/src/XIVLauncher.Core/Program.cs:line 185
Abortado (imagem do núcleo gravada)
Still can't find Flatpak Steam even when running native.
I said you need the non-Flatpak Steam. Native vs Flatpak XIVLauncher doesn't matter in this case.
im not too deep into how flatpak works, but isnt there a permission someone can check so that it has the chance to check for the steam service, ran as a flatpak? or how is xivlauncher trying to call into steam that its not possible in such a usecase?
Found a (somewhat dirty) workaround.
mkdir -p ~/.steam/sdk64
ln ~/.var/app/com.valvesoftware.Steam/.steam/sdk64/steamclient.so ~/.steam/sdk64
and now XIVLauncher detects Flatpak Steam
Going to take a look if we can incorporate a workaround for this into the launcher as I'd also love to move to flatpak steam myself
Found a (somewhat dirty) workaround.
mkdir -p ~/.steam/sdk64
ln ~/.var/app/com.valvesoftware.Steam/.steam/sdk64/steamclient.so ~/.steam/sdk64
and now XIVLauncher detects Flatpak Steam
Switching from steam runtime to steam flatpak, I needed to remove the ~/.steam
directory first and then I linked the whole .steam
directory - might not be necessary but I don't think it won't be an issue.
ln ~/.var/app/com.valvesoftware.Steam/.steam ~/
Found a (somewhat dirty) workaround.
mkdir -p ~/.steam/sdk64
ln ~/.var/app/com.valvesoftware.Steam/.steam/sdk64/steamclient.so ~/.steam/sdk64
and now XIVLauncher detects Flatpak SteamSwitching from steam runtime to steam flatpak, I needed to remove the
~/.steam
directory first and then I linked the whole.steam
directory - might not be necessary but I don't think it won't be an issue.ln ~/.var/app/com.valvesoftware.Steam/.steam ~/
while it detects Flatpak Steam through this, i still encounter the issue that it doesnt tell steam that i close the game for some reason. do you have any workaround for that, too?
I managed to login and download the game with XIVLauncher and Steam both as flatpak with this link :
ln ~/.var/app/com.valvesoftware.Steam/.steam/steam/linux64/steamclient.so ~/.steam/sdk64/
From this point you should be able to login and launch the game (if steam is running). however if you want to launch it from steam, we need to lower a little the steam sandbox :
And to launch it via steam you can add this permission to steam :
sudo flatpak override com.valvesoftware.Steam --talk-name=org.freedesktop.Flatpak
sudo flatpak override com.valvesoftware.Steam --socket=session-bus
Then you can add a dummy shortcut (doesn't matter what we'll change everything.)
Edit the shortcut and in target add :
flatpak-spawn --host /bin/flatpak run dev.goats.xivlauncher
and in the launch options add :
XL_SECRET_PROVIDER=FILE %command% run --parent-expose-pids --parent-share-pids --parent-pid=1 --branch=stable --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher
(it seem to not work as intended however.)
The only thing that doesn't work is that when you close ffxiv it will still say that the game is running on steam and killing it will crash steam.
I managed to login and download the game with XIVLauncher and Steam both as flatpak with this link :
ln ~/.var/app/com.valvesoftware.Steam/.steam/steam/linux64/steamclient.so ~/.steam/sdk64/
This worked perfectly. Flatpak is great, but it's required permissions often go undocumented.
This worked perfectly. Flatpak is great, but it's required permissions often go undocumented.
That's not using a flatpak in the intended manner. That's skirting around it entirely which is why we don't have anything related to that in XIVLauncher.Core's documentation/FAQs. What this does is completely bypass the flatpak environment altogether by making a link to where the non-flatpak application's files would have been.
This worked perfectly. Flatpak is great, but it's required permissions often go undocumented.
That's not using a flatpak in the intended manner. That's skirting around it entirely which is why we don't have anything related to that in XIVLauncher.Core's documentation/FAQs. What this does is completely bypass the flatpak environment altogether by making a link to where the non-flatpak application's files would have been.
That's a workaround we don't have a proper solution... or if anyone does then just write it down :)
A workaround is supposed to be a temporary solution. this should not close the issue. especially since it's not perfect and has it's flaws and drawbacks.
This worked perfectly. Flatpak is great, but it's required permissions often go undocumented.
That's not using a flatpak in the intended manner. That's skirting around it entirely which is why we don't have anything related to that in XIVLauncher.Core's documentation/FAQs. What this does is completely bypass the flatpak environment altogether by making a link to where the non-flatpak application's files would have been.
Yes, so it could be possible for the FFXIVLauncher flatpak to infect the Steam binary. Would it be possible to make it read only? I think this is still safer, because when I am not using FFXIV, steam is protected.
There must be a proper way for one flatpak to talk to another.
This worked perfectly. Flatpak is great, but it's required permissions often go undocumented.
That's not using a flatpak in the intended manner. That's skirting around it entirely which is why we don't have anything related to that in XIVLauncher.Core's documentation/FAQs. What this does is completely bypass the flatpak environment altogether by making a link to where the non-flatpak application's files would have been.
Yes, so it could be possible for the FFXIVLauncher flatpak to infect the Steam binary. Would it be possible to make it read only? I think this is still safer, because when I am not using FFXIV, steam is protected.
There must be a proper way for one flatpak to talk to another.
The good way of doing it would be to use portals but if the portal doesn't exist or if the protocol isn't well supported by the orignal devs (in that case steam) it's really tricky... discord had some workaround too for RPC. It's also up to flatpak to allow some more stuff to be exposed. when devs targets linux, they don't always target flatpak as many package are maintained by a person that only do that on the project (probably cause flathub verification process is a nightmare)
So short answer : using the portal standard (if it's even possible with steam.)
Related issue: https://github.com/flathub/dev.goats.xivlauncher/issues/26
SteamAPI_Init() fails because Flatpak XIVLauncher (
dev.goats.xivlauncher
) can't detect Flatpak Steam (com.valvesoftware.Steam
).What I'm using