Why does Steam session info always report incorrect player count (zero)
Has anyone come across an issue with the Steam OSS (using server browsing) that the session always reports that NumOpenPublicConnections is always equal to NumPublicConnections.
That is, it appears that there are no players in the session.
Our code works fine with the NULL OSS and reports the correct number of players.
Documentation on both Steamworks and the OSS is somewhat thin on the ground and so I'm currently stumbling around in the dark trying to fix this. We're only temporarily using the Steam server browsing, but it does make it more difficult to find a server that has players in it.
Any suggestions gratefully received.
It took me quite some time to figure this one out so I will share what I know in here.
When searching for a dedicated server, getting player count of 0 is expected behavior for OnlineSubsystemSteam since the it never go through the Steam User Authentication process when joining a dedicated server.
Player count for a Presence Session search will always works since SteamMatchmaking()->JoinLobby(LobbyId) gets called upon player join a Presence Session to let steam backend knows that player is in that session. the corresponding step is missing while player join a Dedicated Session.
It would make more sense to do the authentication in the stage of "JoinSession" like what a Presence Session do, But unlike join a steam lobby, authentication on dedicated server require sending data from client to server to complete, Which is not easy to do since a stateful connection between client and server haven't been established yet and Session-less connection messages are not easily accessible.
It looks strange to me that OnlineSubsystemSteam didn't handle this process since it is required for some useful server matchmaking functionalities provided by steam to be functional (i.e. backend side query filters like "noplayers", "notfull" and VAC).
The work around I use is doing authentication in PlayerController after connection have been established and I can use RPC calls to send data needed for authentication.
In MyPlayerController.h define a struct for authentication token:
Define RPC functions, our AuthTicket and Steamcallback:
Are you guys testing it in the editor i.e. using stand alone? I had this issue but when I packaged using the "Development" configuration it was correct.
answered Mar 29 '15 at 08:04 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here