question

Trevor Godley avatar image
Trevor Godley asked

How to resolve "Unknown message id: 1702. This can happen if no handler was registered for this message"

In previous stable builds of my project, I never had to register any messages with NetworkClient.RegisterHandler, I only ever implemented NetworkServer.RegisterHandler and it worked fine.

Now when I try to connect my client build to my server build (already uploaded to PlayFab with status "Deployed") I get the warning "Unknown message id: 1702. This can happen if no handler was registered for this message." I'm not sure how I should register the handler for this message since I don't even know what type of message it is.04092021-203943-rec.png

unity3d
10 |1200

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

Trevor Godley avatar image
Trevor Godley answered

I solved the issue! My problem was that I was registering the NetworkClient message handler at the wrong time. It worked after I changed it to this:

public override void OnClientConnect(NetworkConnection conn)
    {
        base.OnClientConnect(conn);
        NetworkClient.RegisterHandler<PlayerInfo>(OnReceivePlayerInfo);
    }
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.

Rick Chen avatar image Rick Chen ♦ commented ·

I am glad that you have figured it out. If you have any further questions, please feel free to ask.

0 Likes 0 ·
Rick Chen avatar image
Rick Chen answered

Which version of the Unity Mirror you are using? Have you changed any code in NetworkClient.cs? From the image you provide, the error was traced to Assets/Mirror/Runtime/NetworkClient.cs:313. But in this code of the official UnityMirror project, the line 313 is inside the Obsoleted RegisterHandler function. Please provide the detail of your project for me to reproduce this issue. And I will do some test to troubleshoot the issue.

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.