#Question on Unnamed Messages in NGO

1 messages · Page 1 of 1 (latest)

fossil wigeon
#

Does anyone know if calling the SendUnnamedMessage to yourself will defer local? That is, if the server sends an unnamed message to itself, will it take one network tick till that message arrives? Or will it be instant?

My gut says it will take a network tick to arrive, but I want to make sure so that I dont have to deal with an edge case

fossil wigeon
#

For those interested, I did a test where I used the NetworkTickSystem.ServerTime.Tick on both the send and received. These values matched, which leads me to believe that it doesn't defer locally and wont wait a netcode tick. I'm going to do a few further tests with a debugger to see if I have a stack I can follow

rotund quartz
#

If that's something you need, you can submit a github issue. It might be an easy add since RPCs can already do this

worldly leaf
fossil wigeon
#

Yeah, can confirm 100% that it occurs on the same tick. This is pretty useful for me, as I actually dont want it to defer in this case. Im building a sort of 'slow' network list, where its important that all the data arrive at some point, and arrive in order, but that time period doesn't have to be instant.

#

Specifically, I have a rather large set of text files (user uploaded and user controlled, so potentially very big) that need to be shared with connecting clients and edited in a semi synchronized way. In our stress tests, these files will cause scene sync issues if they're stored in a network variable or a networklist. So I'm using unnamed messages to make a personalized pub/sub channel.

fossil wigeon
#

@rotund quartz I think I found a bug on this old topic. Everything was working fine till I started getting tickets that certain operations in our system failed to execute when we ran them on our linux dedicated headless server. Specifically, I do something like _manager.CustomMessagingManager.SendUnnamedMessage(NetworkManager.ServerClientId, writer); as the server, but the server never seems to receive it. Having dived into the code, it appears that the server cant send an unnamed message to itself. Can you confirm this is intended? Or should I submit a bug report about it?

#

specifically, should the if statement in CustomMessageManager.SendUnnamedMessage (if (m_NetworkManager.IsHost) { if (clientId == m_NetworkManager.LocalClientId) { InvokeUnnamedMessage( m_NetworkManager.LocalClientId, new FastBufferReader(messageBuffer, Allocator.None), 0 ); return; } }) be checking for IsHost or should it be IsServer?

rotund quartz
# fossil wigeon <@86985386886201344> I think I found a bug on this old topic. Everything was wor...

This seems to be intentional. A dedicated server (or client) can not send a custom message to itself. If it's running as host then it is possible (the host server sends to the host client)
https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2801

GitHub

When sending a custom message to oneself they do not get received. Unless the sender is also the game host. com.unity.netcode.gameobjects/com.unity.netcode.gameobjects/Runtime/Messaging/CustomMessa...