Server welcomes game client but client restarts the handshake process, then times out

We have AWS GameLift setup correctly such that once a game session was active the game client could connect to it using the “Open Level” node in BP passing in the ip, port, and playersessionid.

We then set up Steam, editing our DefaultEngine.ini so it contained the required elements as outlined in the documentation for UE4.22.3 .
Steam now pops up correctly upon launch of the game client, as long as the Steam Client is also running.
We have set up a system where we can get the SteamID of the player then check that the player owns the game using that SteamID and Steam’s API. This is the only feature want to use from Steam, and we do not want to use Steam on the server. Hence we have added bUseSteamNetworking=false and have removed

[PacketHandlerComponents]
+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface

from the DefaultEngine.ini.

But now we have found that:
If the Steam client is not running on the game client, hence Steam fails to initialize, we can connect to the GameLift server just fine as before (see logs ENoHandshakeIssueClientSteamNotEnabled.log and ENoHandshakeIssueServer.log)

If the Steam Client is running however it seems to begin to connect fine and the server welcomes the client, but then the client seems to restart the handshake process and then has difficulties reconnecting and eventually times out. (see logs EHandshakeIssueClientSteamEnabled.log and EHandshakeIssueServer.log)

I have tried adjusting the config to take out more steam components but it either resulted in the SteamID not being returned on the client or the same handshake issues. Also tried adjusting the net drivers, increasing the timeout again, adding some command line arguments but no luck.
The issue seems to be more to do with how unreal handles handshakes and packets under the various onlinesubsystems.

The “Ignoring restart handshake request” warnings that are spammed in the failing client come from UnrealEngine\Engine\Source\Runtime\Engine\Private\PacketHandlers\StatelessConnectHandlerComponent.cpp but we can’t make any sense out of it.

The Logs and DefaultEngine.ini file are attached.

If anyone could give us a hint to what is going on here we would really appreciate it.
Thanks!

This is the DefaultEngine.ini I’m using: DefaultEngine.ini · GitHub

I haven’t added the SteamAuthComponentModuleInterface yet - Was planning on doing that later. Maybe this auth component is whats messing up your system? I’m very unfamiliar in UE4, so can’t help that much, sorry :frowning:

Thanks @RobQuistNL! We will try minus the"NetDriverDefinitions" changes and see if that sorts it.

I have the same issue and adding bUseSteamNetworking=false didn’t help me either. Did you come to any solution how to fix this?

Have you tried looking at OverrideFailureDelegate?

I am having the same issue (cannot host for both Steam and non-Steam players), so I’m currently also trying to drill down on this problem. I’m not sure how to override the delegate though, but it looks like it might be the cause.

Bump. Note that I have the same problem (the same in terms of your title and log errors), but I do not use Steam, but Epic Online Services instead (via EOSCore plugin).

In my case the error comes to light when I (successfully) connect to server, than disconnect and connect right after I exited. It seems like client or server thinks some connection data is still valid (not cleared), so after reconnect client refuses to make a handshake and after some time it is disconnected by timeout, as if the client did not ever being connected.

Still searching the solution.

Note, I am not using steam on my dedicated server, connecting via raw IP, and so I removed all steam net definitions in the DefaultEngine.ini

[OnlineSubsystemSteam]
bUseSteamNetworking=false
... other stuff

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam
... other stuff

DO NOT HAVE THESE SECTIONS
[PacketHandlerComponents]
[/Script/OnlineSubsystemSteam.SteamNetDriver]

Common Pitfalls: 1) Make sure you restart the Editor after updating the DefaultEngine.ini 2) Make sure you recompile both your server and client with the new ini so they have the same NetDriver.

After doing that I was getting disconnected due to incompatible_unique_net_id
So I then had to hack the engine in PendingNetGame.cpp by commenting out the following line
//Connection->PlayerId = LocalPlayer->GetPreferredUniqueNetId();

WARNING: I have zero clue what other ramifications there are having a default PlayerId, but I know that’s whats happening if you run the game via editor or run the game without the steam client running. However since the id was simply Steam : DisplayName the value is not actually unique anyway.

Have you found the solution? We have a similar problem with EOSCore. Everything is fine until a fifth player tries to join - then the game starts to lag and the new player is stuck connecting. There’s “Ignoring restart handshake request, due to recent NetConnection packets.” being spammed in the log file.

Well, I see that the fifth player is real a problem, not a coincidence. We too had such a problem.

We just dropped the option of using EOS for now. Connect directly, so host should have public IP.
I think EOS is too young to be fully used as it is expected. If you really want to use it, you should wait until it will be polished enough.

This worked for me as well thank you :slight_smile: I also made a quick video on how to do this for anyone that needs it MP WithBlueprints AWS SteamSubsystemTut Read Description - YouTube