Steam sessions can not return player count

Found steam sessions can not return player count or ping if not using the default online subsystem.
A game using the steam online subssytem will be unable to display the player count in the server browser.

There must be some way of solving this issue, any help is appreciated!
/Best Regards

1 Like

Hey MADHOUSE,

I’m currently talking this over with our developers, and I’ll get back to you as soon as I have more information.

Thanks for your patience.

1 Like

I’ve been unable to verify yet, but it is possible this functionality was never implemented with using steam online subsystem, (just like “get ping”).

The current workaround I’ve found is to use the “Advanced Sessions” plugin and use the attachable session “extra settings” (which can be updated and retrieved) to create a custom system for keeping track of and updating the session player count that way.

It would be better to be able to retrieve the session information directly tho as I believe it would be a more stable solution.

1 Like

Hey MADHOUSE,

After discussion with the developers, it appears that you are correct, this functionality has not yet been implemented using Steam OSS.

I’m glad you were able to find a workaround for the time being using Advanced Sessions.

Let me know if you have further questions.

Have a great day

Try getting the “Advanced Sessions” plugin, you can use “extra settings” to attach custom variables to a session which can be updated and retrieved. This would probably not work for dedicated servers tho.
/Best Regards

It’s April 10th, 2017 and this still doesn’t work. Any resolutions?

On this question, does anyone know how to use blueprints to update the extra settings info of a session? So that the server can update the player count? I have a blueprint only project that relies on listen server listing via steam.

[PacketHandlerComponents]

+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface

Add that to the Default Engine.ini

It won’t work on Steam without it. There is an issue with Authority, the players don’t have it until you give it to them.

3 Likes

@DLROKen This worked for me, thanks a bunch!

Hey I tried adding that line in my engine .ini files and it still doesnt work.

Result.Session.SessionSettings.NumPublicConnections - Result.Session.NumOpenPublicConnections

For me this always returns 1 and my servers are constantly 1/max player.

I looked around and couldnt find solutions, is is possible if you can share more info about how you got the player count to work? Im using listen servers on UE 5.2 and steam subsystem. (Logic is in c++, however if you have a BP solution please also let me know of it)

Im also currently using the test 480 app id, and im testing with people from other networks so it is not LAN

Not sure how much I can be of help @hassanjor, but I’ll explain my setup:

I’m using UE 5.2, dedicated server, Blueprints, Online Subsystem Steam (Advanced Sessions plugin), and the 480 app ID over a wireless connection.

I’m using the Get Current Players node, which takes an input from a Blueprint Session Result.

Hey, Thanks for the response.

I think it might be working for you because you are using a dedicated server while im using a listen server. Anyways I did figure out a way to manually do it through the gamemode using the update session function. so its all good now

2 Likes

Can you elaborate on that please? i’m also facing this issue.

There is a function called “Update Session” that you can access through the session interface that allows you to update the current session with new settings.

What you want to do is from the game mode call the update session and provide new settings. The gamemode offers 3 important things in this case

  1. post login, abiliy to detect when player joins
  2. logout, ability to detect when player leaves
  3. GetNumPlayers, has an accurate number of current players.
  • it only runs on server so makes sense to update server from there

What i did was basically set a server key that holds my num of active players and everytime I update the session (which is when a player joins or leaves) I reset the key with the GetNumPlayers function.

If you are in blueprints I assume you can still do something similar but I dont exactly know how.

1 Like

I ended up figuring this out, thank you for the response, however, on my end the server is no longer visible in the find sessions list after updating session. Any ideas as to why that is?

Are you possibly changing the server name in any way? I noticed when you update the session even if you pass in the same name again it will detect as you “changing it” which will make it not appear. if that might be your issue then update your session by getting settings then modifying only what you need modified.
image
something like this image where you get the already existing settings and then only modify the player count key and pass the same server name as you are not changing it.

Got it, turns out I actually reset all settings as a new settings variable but was not setting the session name so it wouldn’t appear. I implemented your GetSessionSettings() and it worked for me, thank you very much.

1 Like

Glad I could help!