Dedicated server getting all player's username
-
Hi, if I have a dedicated server that the (client)players joins for a match, if the client logs in with Client API Authenticate on their machine and I assume the client will send their profile id to the server.
Then, how can the server get the user name of all the client that are connected with their profile ids? -
That depends on how players will get matched and ultimately connect to your server. If you use our lobby-based matchmaking facilities, the sequence will go roughly like this:
- Players make a FIND_OR_CREATE_LOBBY call to the LobbyService.
- The lobby matchmaking process runs and a bunch of players get associated with a lobby instance.
- Once the launch conditions are satisfied, brainCloud will launch an instance of your dedicated server.
- The dedicated server will start and immediately make an S2S call to ask brainCloud for all the lobby instance details. These details will include each players name.
If you don't use lobby matchmaking, you'll need to use the S2S api to query brainCloud for the player details manually.
-
HI @tlim - the S2S API you are looking for is this:
https://docs.braincloudservers.com/api/capi/user/sysgetuserinfoI might suggest that you write a cloud code script though - and send the list of profile ids to it. It can use this call to retrieve the info for each of the players - and return just the information that you need in your server.
I hope that helps!
Paul.