UE 5.1 Steam Sockets Problem

I fixed this code and compiled the engine but it still don’t connecting. What am I missing?

I also had to make those flags to false, now I’m connecting successfully.

I’m passing by here just to emphasize this bug is still a thing and that I and others are suffering from it.

I investigated the main branch and the StatelessConnectHandlerComponent.cpp got a few updates, though am not sure if the intention of those would be addressing this issue specifically.

Also, as mentioned by @matthew9090, there’s also this commit from months ago that fixes the “typo” involving this issue, though that doesn’t seem enough because as others have pointed out, there’s still the need of setting both VerifyNetSessionID and VerifyNetClientID to 0.

That said, please Epic, do something about it. I know you may have your protocols and all for releasing new patches/updates, but really, this thing has been out for months and is cursing those in need to work with Steam and sessions.

Just bumped into this to tell you that I am also experiencing this issue. :cold_sweat:

1 Like

And yet not released on 5.1.1.

Just bumped again to say that this is not fixed in 5.1.1.

I encountered myself with this issue.

My SessionID always matches fine with GlobalNetTravelCount.
But ClientID never matches with CachedClientID, the last variable is always +1.

LogHandshake: Incoming: Rejecting game packet with invalid session id (1 vs 1) or connection id (0 vs 1).

ClientID: Connection id incremented clientside every connection per-NetDriver, to prevent non-ephemeral old/new-connection crosstalk.

Now look at the following part of the code:
UnrealEngine/StatelessConnectHandlerComponent.cpp at release · EpicGames/UnrealEngine (github.com)

Why is this +1?

CachedClientID = FMath::Max(ConfigCachedClientID, 0) + 1;

Are you packaging the game as client or Game?

As game, I’m testing with Lyra, so no dedicated server.

So I changed this to

CachedClientID = FMath::Max(ConfigCachedClientID, 0);

And now I can connect fine to a server hosted by another player.
Both running “Game” target build using the Lyra sample project with Steam as the default platform service.
Engine compiled from source using ue5-main branch as of today.

I’m not sure if this is a real fix, I don’t understand why this is “+1”.

Also this topic should not be marked as solved.

2 Likes

It looks like an issue has been opened for this.

UE-174140
Unreal Engine Issues and Bug Tracker (UE-174140)

1 Like

I think we need more upvotes, target fix is 5.3 which sounds like it will be a while off. -_-

How the heck haven’t they fixed this yet and pushed it back to 5.3??!?!? EPIC YOU’RE KILLIN ME BROOO

Add this to defaultengine.ini and it should work

[ConsoleVariables]
net.CurrentHandshakeVersion=2
net.MinHandshakeVersion=2

7 Likes

That’s it? No need to alter the engine/plugins?

1 Like

That is correct

1 Like

Did anyone try this solution? Does it work?

1 Like

Confirmed this myself. This worked for me. Thank you so much :slight_smile:

2 Likes

You guys are just using steam sockets normally right, no extra fixes or anything? I talked to someone that tried just putting that text in the ini file and nothing changed, still can’t join sessions.

Our team uses the SteamCore plugin. It basically calls the steamAPI from blueprints for us and we barely use any steam functionality aside from joining eachother. From my knowledge we use no alternate fixes. Just the ini file changes.

1 Like