Trouble with Connecting to PhotonChat Error ChatClient not implemented

Hello, I have been struggling with photon chat specifically, with connecting to C# unity, it seems that I got hit with the error NotImplementedException in chatClient(param). Is there anyone who knows how to fix this or where I might do something wrong?


Thank you in Advance.

Answers

  • Help us help you. Let us know the full error message (with callstack).

    Some Unity versions produces incorrect project files for VS and VS Code. Maybe that's related?

  • Hello, thank you for replying, @Tobias About the connection, I have managed to fix that it seems I may have connected the wrong id with the wrong pun version. But I still get stuck as It seems that IChatClientListener, some of it is just not implemented. And I still get this error even though I have tried to recreate the unity project. Any idea what's wrong?

    NotImplementedException: The method or operation is not implemented.

    ChatManager.OnGetMessages (System.String channelName, System.String[] senders, System.Object[] messages) (at Assets/Scripts/ChatManager.cs:103)

    Photon.Chat.ChatClient.HandleChatMessagesEvent (ExitGames.Client.Photon.EventData eventData) (at Assets/Photon/PhotonChat/Code/ChatClient.cs:1270)

    Photon.Chat.ChatClient.ExitGames.Client.Photon.IPhotonPeerListener.OnEvent (ExitGames.Client.Photon.EventData eventData) (at Assets/Photon/PhotonChat/Code/ChatClient.cs:974)

    ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/PeerBase.cs:898)

    ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/EnetPeer.cs:565)

    ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/PhotonPeer.cs:1771)

    Photon.Chat.ChatClient.Service () (at Assets/Photon/PhotonChat/Code/ChatClient.cs:347)

    ChatManager.Update () (at Assets/Scripts/ChatManager.cs:47)

  • [Deleted User]
    edited October 2021

    IChatClientListener isn't supposed to have implementations, it's an interface. You're supposed to implement the functions yourself.

    This is most likely an issue with your implementation of it as you can see at the top of the call stack. You probably forgot to remove one of the throw new NotImplementedException(); lines after automatically generating all of the functions for the interface.

    If this isn't the problem, then more info is needed. Please post the code of your function ChatManager.OnGetMessages.

  • It's starting to get a little bit better but I got this as the display message instead of the Text in the InputField

    b538c769-b7ce-447c-985f-d629766b7d31: 


    I assumed that there might still be something wrong with the publish text implementation. Is this correct?

  • But it seems like that, I have no idea how to fix this, any suggestion?

  • We need to see the code, otherwise we cannot know. Please send how you're sending the display message and also how you're displaying it.

  • KayFi
    KayFi
    edited October 2021

    @MeepPun Hello, this is the code, that I am currently using for the message.

  • [Deleted User]
    edited October 2021

    Hi, that long string of numbers and letters before the colon are your UserID, that is the unique identifier for the user which sent the message. The sender does not include the nickname of the person who sent it unless you use the custom authentication service, which would replace the UserID with some other identifiable information.

    As for the missing message, Debug.Log(currentChat); before it gets sent and check whether it actually has a value. Be sure that you are sending the correct text, I noticed you have chatField.text right under the line, is that related to anything? why is it being set to empty if it's not used?

  • KayFi
    KayFi
    edited October 2021

    It should erase the field after it is used, or else, the previous chat will be stuck In the UI. Is it possible because it doesn't recognize the string userID? I put DebugLog in the OnConnected method, but it seemed that the userID is empty. I try to put it on before Connecting as well it seems like it also empty.

  • I try to use a default user ID as well but it seems like it's not working as well and try to print it to before calling the user method and it somehow didn't print out as well

  • The code and the result. But I am not sure, is it because the userID is null?

  • I guess not. I try to declare it like this and the result is still the same

    chatClient.Connect(PhotonNetwork.PhotonServerSettings.AppSettings.AppIdChat, PhotonNetwork.AppVersion, new AuthenticationValues("player1"));

  • KayFi
    KayFi
    edited October 2021

    This is partially unity part but it seems like it is because the userID is not properly identified.

    at least there's a progress, now need to try to look what's wrong with unity.