question

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

What is the recommended way to get the list of players in a match, from a game server?

What is the recommended way to get the list of players in a match, from a game server? (servers 2.0)

I want to use this list to assign players to slots and lookup player skill ratings in order to compute rating changes.

It seems like the way things work is as follows:

1. Matchmaker forms a match.

2. Matchmaker creates a game server

3. At this point, the game server has no idea who is in the match

^ this kind of baffles me. Why is this information seemingly not readily available?

With legacy servers, I passed the match information via command line arguments quite simply.

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.

v-humcin avatar image
v-humcin answered

When using matchmaking to create a game server, it passes in some information automatically including initial players. The GSDK has a "GetInitialPlayers" call which can be used to access this list.

You can read more about the initial information passed to the server here: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/matchmaking/multiplayer-servers#information-passed-to-the-game-server

1 comment
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 ·

This is the correct answer, thanks!

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

Do you mean from the server application itself or from some other application using a PlayFab API?

If you mean from the server itself, I think you need to provide that information to the server from the clients. For example, what we do is, when a client connects to the server it tells the server its PlayFab ID, and the server updates its list of players. I'm not sure there is another way to do it.

3 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 ·

Yeah, I mean from the server itself. Couldn't the client send a fake PlayFab ID in that case? How does the server know to trust what the client tells it?

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

A hacked client could definitely send a fake PF ID and DisplayName/etc, although you could do some validation instead like maybe have the client send the device ID it logged in with and its PF ID, then have the server validate that the PF ID belongs to that device. The issue that we've reached is that you usually have to trade off some security with ease of access and usability.

0 Likes 0 ·
jpgordon00 avatar image jpgordon00 brandon@uprootstudios.com commented ·

To be clear: the server should authenticate players using AuthenticateSession API. Clients send their session or get booted. That's the policy I follow.

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.