Multiplayer Steam LAN - NumOpenPublicConnections does not update
So as the title suggests, I have setup a multiplayer game using the OnlineSubsystemSteam, when I create a LAN session and Steam is running (I switch over to use the OnlineSubsystemNull for LAN matches since Steam does not handle that AFAIK) my log on the NumOpenPublicConnections remais the same as max players and does not update after new players join the session (yes they can join over LAN), but if Steam is closed NumOpenPublicConnections does update normally.
The problem is that if I want to check how many players are connected to the session it always returns zero. How can I fix that?
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
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
That doesn't take into account private connections, but my game doesn't use private connections, and the
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
answered Sep 02 '17 at 08:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here