Best way to add dynamic info to server session?

For my multiplayer game, I would like to transmit to players connecting to the game via the server browser the list of players currently present in each session on the network, their team number, etc…

I’m using C++, and I was planning to add these info in the OnlineGameSettings object related to my game session (via the get/set methods), and update these settings each time a player connects, leaves or update his name via the GameMode and GameState objects (on the server)… But I’m not really sure if it’s the most optimal way to do that, do you have a better solution for that?