mordentral / AdvancedSessionsPlugin

Advanced Sessions Plugin for UE4
https://www.vreue4.com
MIT License
593 stars 140 forks source link

UE 5.5 Join Session always fails #99

Open Hanayou opened 5 days ago

Hanayou commented 5 days ago

I would like to preface this by acknowledging that 'Join Session' is a native functionality provided by the engine, and not directly related with the Advanced Sessions or Steam Sessions.

For more detail/screenshots, I've addressed this issue in the unreal forum post below, however to summarise it seems that 'Join Session' always fails when running a packaged (all types - Debug, Dev, etc.) build on Unreal 5.5 and trying to connect 2 remote Steam clients (same region, different PCs/accounts).

I've replicated my existing 5.5 project's DefaultEngine.ini and used the plugins for advanced session 5-4-4 (which to my understanding are no different to those used in the 5-5 binaries) to recreate the same project in UE 5.4.4 and joining works flawlessly.

Interstingly I get the following warning (but no obvious error) in my UE5.5 project (more full logs are available in the forum post linked below), which seems weird as my 'Create Advanced Session` definitely has both of these booleans enabled:

[2024.11.17-07.48.17:979][ 40]LogOnlineSession: Warning: STEAM: [FOnlineSessionSteam::JoinSession] The values of FOnlineSessionSettings::bUsesPresence and FOnlineSessionSettings::bUseLobbiesIfAvailable are treated as equal and have to match

https://forums.unrealengine.com/t/ue-5-5-online-subsystem-join-session-always-results-in-on-failure/2125579/5

01F0 commented 4 days ago

Looks like that warning is important: https://github.com/EpicGames/UnrealEngine/blob/1308e62273a620dd4584b830f6b32cd8200c2ad3/Engine/Plugins/Online/OnlineSubsystemSteam/Source/Private/OnlineSessionInterfaceSteam.cpp#L859C1-L864C3

I'm in the same boat as you. I have those settings set to true as well. I wonder why DesiredSession in JoinSession ends up differently when received from the search results. Hmm..

For what it's worth, I get the same result when JoinSession is called through a game invite.

Hanayou commented 4 days ago

@01F0 Thanks for that input. I've played around with this further and logged my findings alongside a few other users in the original forum post linked above. It seems that bUseLobbiesIfAvailable is set when creating the lobby, however when using 'Find Sessions' it always returns false for some reason. If you override this value before passing the session into Join Session then everything works as expected.

Not sure if it's entirely related, but there are a couple of presence/lobby-related changes in the 5.5 release notes:

Think I'll just stick with 5.4.4 on my project until there's an update to fix this from Epic or elsewhere.

I've likewise had the same experience with Joining via invites (works in 5.4.4 but not in 5.5 with the same issues). Either something is weird with the Create Session and it's not setting bUseLobbiesIfAvailable correctly aganist the steam session (which as far as I can tell this is not the case), or Find Session is mistakenly losing/overwriting the value somewhere.

mordentral commented 3 days ago

Sounds like they aren't filling in the struct correctly with their new changes they made and their new api interface for steam (not surprising, the online status string is still not being converted correctly and crashing if its queried).

I can check the value of bIsDedicated on the session settings and force those values, pretty much anything using AS should always have those true on non dedicated sessions. I'll just have to revert the changes when they fix the engine.

Hanayou commented 3 days ago

Thanks for getting back on this and making changes so quickly. I've validated this change in the 5.5 version of my project and it all works as expected now.

Hopefully Epic can sort out the Steam interface at some point, but I think the workaround provided should continue to work well as, as you say, the booleans are always set one way or the other depending on if the session is dedicated or not.

I'll update the forum post to share that the new binaries resolve the issue for now.

devCore1 commented 3 days ago

Thank you so much guys for opening this issue and fixing it

@mordentral goat