question

casas2006 avatar image
casas2006 asked

Photon Chat and UserId

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.

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

·
brendan avatar image
brendan answered

The Exit Games team will be updating Chat to be able to provide this in a future update, but they do have a couple of recommendations for working around this right now: http://forum.photonengine.com/discussion/comment/29320#Comment_29320.

10 |1200

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

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.