question

cihan-gs avatar image
cihan-gs asked

Lobby memberProperties

    public void JoinLobby(string lobbyConnectionString)
    {
        Dictionary<string, string> customData = new Dictionary<string, string>();
        customData.Add("PlayerName", Username);

        PlayFabMultiplayer.JoinLobby(
          new PFEntityKey(PlayFabAuthenticationContext.EntityId, PlayFabAuthenticationContext.EntityType),
            lobbyConnectionString,
         customData
     );
    }

I tried to enter a lobby with this code snippet, and attempted to retrieve the customData dictionary I defined here, but I could only access the MemberProperties of the lobby creator. Am I possibly misusing customData

  public void GetLobbyPlayer()
  {
      List&lt;PFEntityKey&gt; lobbyMembers = new List&lt;PFEntityKey&gt;(Lobby.GetMembers());
      Dictionary&lt;string, string&gt; memberProperties = new Dictionary&lt;string, string&gt;(Lobby.GetMemberProperties(lobbyMembers[0]));
      foreach (var item in memberProperties)
      {
          UtilityMethods.Log("MemberName: " + item.Value);
      }
  }
multiplayer
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.

Xiao Zha avatar image Xiao Zha commented ·

Since your code only uses the EntityKey of the first member in the members list, it can only get the member data of the first member, which is the lobby owner. If you want to obtain the member data of the newly joined player, you can use the EntityKey of the newly joined player to obtain the player's member data.

0 Likes 0 ·

0 Answers