Custom messages are not processed when sending to oneself
Describe the bug Custom messages are ignored on the host when the receiving ID is the host itself.
To Reproduce
- Start hosting.
- Register a custom message handler with a
Debug.Log("I expect to see this!"); - Send a custom message to
NetworkManager.Singleton.ServerClientId.
Actual outcome The log message will not appear. The custom message from client ID 0 to client ID 0 (itself) was ignored.
Expected outcome Since the host is both a client and a server I expect it to process all custom messages. It makes testing with a single client & server in 1 window much easier.
Environment (please complete the following information):
- OS: Windows 10
- Unity Version: 2022.1.0b1.2470
- Netcode Version: v1.0.0-pre3
Added to our backlog MTT-3050
this would be very nice indeed, have it work for dedicated servers too, not just host, so basically anytime the sender is also the receiver.
Could we get a confirmation if this will be implemented/fixed ? We're currently having to do a lot of boilerplate code to handle such situations, would be nice to know if we should stop and wait for the fix, or keep going.
This was fixed in #2296, and should be present in the upcoming 1.2.0 release.
Closing the issue as 1.2.0 has been released and the fixed is now live
Why is this behavior only limited to the host? Why can't any other clients (other than the host) send a message to themselves?