Multiplayer Steam LAN - NumOpenPublicConnections does not update

Ok, well I had what I assume to be the same issue (although I never tested it for LAN, so far as I can remember). I was able to get the player count showing correctly, for my purposes at least, by making a small addition to the engine code. I’m still on UE4.10, so I can’t guarantee this will work for later engine versions, but I imagine it will.

In OnlineSessionAsyncLobbySteam.cpp
I added the lines below to the implementation of the function FillSessionFromLobbyData

const int32 LobbyMemberCount = SteamMatchmakingPtr->GetNumLobbyMembers(LobbyId);
Session.NumOpenPublicConnections = Session.SessionSettings.NumPublicConnections – LobbyMemberCount;

I inserted these lines at line 350, although this might be different for different engine versions for all I know, so just make sure you’re in FillSessionFromLobbyData right after the for loop.

That doesn’t take into account private connections, but my game doesn’t use private connections, and the GetNumLobbyMembers function does always seem to accurately reflect the total number of players in the session.

Anyway, I added this to my game about a year ago now, and it seems to have worked since. I hope it does for you too, but I don’t know how watertight the solution is.

Best of luck,
Jon