Steam sessions can not return player count

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