Hello
I have a trouble with Photon Chat using PlayFab. I can connect to the Chat perfectly, but when I get the messages (OnGetMessages function) the senders list are the PlayFabId of each sender, and not the UserId(the real name). This is my code:
void ConnectChat()
{
string Username = "Charles";
ExitGames.Client.Photon.Chat.AuthenticationValues authVals = new ExitGames.Client.Photon.Chat.AuthenticationValues(Username);
authVals.AuthType = ExitGames.Client.Photon.Chat.CustomAuthenticationType.Custom;
authVals.AddAuthParameter("username", playFabGameManager.PlayFabId);
authVals.AddAuthParameter("token", playFabGameManager.photonAutToken);
this.chatClient = new ChatClient(this);
this.chatClient.AuthValues = authVals;
this.chatClient.ChatRegion = PhotonNetwork.PhotonServerSettings.PreferredRegion.ToString();
this.chatClient.Connect(chatAppId, "1.0", authVals);
}
public void OnGetMessages(string channelName, string[] senders, object[] messages)
{
for (int i = 0; i < senders.Length; i++)
Debug.Log(senders[i] + ": " + messages[i].ToString()); //This shows, for example: 4F3HJUHB45954U:"Hello"
}
I have no idea about this problem. Somebody help me? Thanks in advance.
Hello
I have a trouble with Photon Chat using PlayFab. I can connect to the Chat perfectly, but when I get the messages (OnGetMessages function) the senders list has the PlayFabId of each sender, and not the UserId(the real name). This is my code of two functions:
void ConnectChat()
{
string Username = "Charles";
ExitGames.Client.Photon.Chat.AuthenticationValues authVals = new ExitGames.Client.Photon.Chat.AuthenticationValues(Username);
authVals.AuthType = ExitGames.Client.Photon.Chat.CustomAuthenticationType.Custom;
authVals.AddAuthParameter("username", playFabGameManager.PlayFabId);
authVals.AddAuthParameter("token", playFabGameManager.photonAutToken);
this.chatClient = new ChatClient(this);
this.chatClient.AuthValues = authVals;
this.chatClient.ChatRegion = PhotonNetwork.PhotonServerSettings.PreferredRegion.ToString();
this.chatClient.Connect(chatAppId, "1.0", authVals);
}
public void OnGetMessages(string channelName, string[] senders, object[] messages)
{
for (int i = 0; i < senders.Length; i++)
Debug.Log(senders[i] + ": " + messages[i].ToString()); //This show, for example: 4F3HJUHB45954U:"Hello"
}
I have no idea about this problem. Somebody help me? Thanks in advance.