Getting Started with Photon Chat Demo Scene

davidjfranco
edited January 2019 in Photon Chat
Hi there
I have downloaded the asset, and created an account online and setup an "application". Under the name it has the AppID, I have applied that to the ChatSettingsFile in unity.
However when I press Play I get the following error:

Chat Operation 0 unknown on server. Check your AppId and make sure it's for a Chat application.
UnityEngine.Debug:LogError(Object)
ChatNewGui:DebugReturn(DebugLevel, String) (at Assets/Demo Chat/ChatNewGui.cs:318)
ExitGames.Client.Photon.Chat.ChatClient:ExitGames.Client.Photon.IPhotonPeerListener.OnOperationResponse(OperationResponse) (at Assets/PhotonChatApi/ChatClient.cs:843)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.Chat.ChatClient:Service() (at Assets/PhotonChatApi/ChatClient.cs:269)
ChatNewGui:Update() (at Assets/Demo Chat/ChatNewGui.cs:151)


Any ideas on what steps I'm missing?

Thanks!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited January 2019
    Hi @davidjfranco,

    Thank you for choosing Photon!

    You probably created an application of type other than Photon Chat.

    Go to Photon dashbaord and create a new application of type Photon Chat.
    Use that AppId in your chat client/settings.
  • thanks so much! what a silly mistake I made :D
    So just curious, the names of people in the chat by default, are they just UI elements and essentially "fluff" ?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @davidjfranco,

    I guess you are talking about the names in the demo.
    Those are there for quick test purposes.

    In a real game scenario, you need to have UserIDs for your users.
    Read about it here.
  • so am I right in thinking that I can have one generic UserID for my chat that anyone who connects to the public room will automatically be assigned but they can also be distinguished by nicknames? sorry, complete noob in this multiplayer area :D
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @davidjfranco,

    You need to handle Chat Nicknames yourself as they are not built-in in Photon Chat.
    You can do this in two ways:

    1. in the client cache nicknames of users per UserId. You can get Nicknames from PUN (or Photon Realtime) or PlayFab or another service. So when a message is received get the nickname from the UserId.
    2. in each message send a data structure Photon Serializable that includes both the sender's Nickname and the actual message