question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

What does the players column mean in Servers 2.0?

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.

Custom Game ServersMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

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);
}
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

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?

0 Likes 0 ·
brandon@uprootstudios.com avatar image brandon@uprootstudios.com Brent Batas (Lisk) commented ·

@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

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.