I'm looking at the servers 2.0 dashboard and it looks like this:
What does the players column mean? My first guess would be that there are 200 players connected to this server or that this server has a capacity of 200 players, but neither seems to make sense to me. This is a test server with nobody connected to it at the moment. Also, if it's StandingBy, doesn't that mean nobody is connected to it?
Additionally, my matchmaking has two queues right now with match size of 8 and 4 and my setup is only running 1 server per machine, so again I don't know where this 200 is coming from.
Answer by Brandon Phillips · Aug 07, 2019 at 10:21 PM
I think something might be broken in your GSDK code, as the player count should only update when you call UpdateConnectedPlayers()
static private List<ConnectedPlayer> players = new List<ConnectedPlayer>(); static void OnPlayerConnected() { // When a new player connectes, you can let PlayFab know by adding it to the vector of players and calling updateConnectedPlayers players.Add(new ConnectedPlayer("player_tag")); GameserverSDK.UpdateConnectedPlayers(players); }
Thanks for the tip - I am actually not even calling UpdateConnectedPlayers yet; I haven't tried to connect to the server yet, I just wanted to see if the server could start up properly and that I could retrieve logs for debugging.
In your example, is "player_tag" just a hardcoded value or should I be replacing that with the player's ID of some kind?
@Brent Batas Sorry, that's PlayFab's example for their C# GSDK. Here's what we do in our Unity game server:
public override void OnServerAddPlayer(NetworkConnection conn, AddPlayerMessage message) { players.Add(new ConnectedPlayer(conn.connectionId.ToString())); if (isReady) { GameserverSDK.UpdateConnectedPlayers(players); } base.OnServerAddPlayer(conn, message); }
We use the player's server ConnectionID as the Player Tag, although it might be better practice to use the Player's username or PF ID or something like that.
To better answer your initial question: That player number you see in the Game Manager should only show the amount of players in the "players" List. For example, if one person connects to our game server and OnServerAddPlayer() is called, the Game Manager will show the number "1" for the Players number