com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Custom messages are not processed when sending to oneself

Open akyoto opened this issue 4 years ago • 2 comments

Describe the bug Custom messages are ignored on the host when the receiving ID is the host itself.

To Reproduce

  1. Start hosting.
  2. Register a custom message handler with a Debug.Log("I expect to see this!");
  3. 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

akyoto avatar Dec 12 '21 10:12 akyoto

Added to our backlog MTT-3050

ashwinimurt avatar Mar 29 '22 22:03 ashwinimurt

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.

TheCaveOfWonders avatar Aug 15 '22 14:08 TheCaveOfWonders

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.

TheCaveOfWonders avatar Dec 04 '22 23:12 TheCaveOfWonders

This was fixed in #2296, and should be present in the upcoming 1.2.0 release.

ShadauxCat avatar Dec 04 '22 23:12 ShadauxCat

Closing the issue as 1.2.0 has been released and the fixed is now live

RikuTheFuffs avatar Jan 30 '23 16:01 RikuTheFuffs

Why is this behavior only limited to the host? Why can't any other clients (other than the host) send a message to themselves?

TheAlexDev23 avatar Dec 31 '23 10:12 TheAlexDev23