SoftwareGuy / Ignorance

Ignorance utilizes the power of ENet to provide a reliable UDP networking transport for Mirror Networking.
Other
248 stars 31 forks source link

Ignorance does not respect Transport.enabled if the transport was disabled by another message within the same frame #63

Closed NarryG closed 4 years ago

NarryG commented 4 years ago

Continuing my trend of reporting the same issue in every single transport...

Certain code in Mirror (specifically the scene load code) is dependent on pausing the transport on the client/server to ensure messages don't get sent out of order. As such, there are two checks within Telepathy.

            // note: we need to check enabled in case we set it to false
            // when LateUpdate already started.
            // (https://github.com/vis2k/Mirror/pull/379)
            if (!enabled)
                return;

            // process a maximum amount of client messages per tick
            for (int i = 0; i < clientMaxReceivesPerTick; ++i)
            {
                // stop when there is no more message
                if (!ProcessClientMessage())
                {
                    break;
                }

                // Some messages can disable transport
                // If this is disabled stop processing message in queue
                if (!enabled)
                {
                    break;
                }
            }

In Ignorance, only the first check is in place https://github.com/SoftwareGuy/Ignorance/blob/master/Assets/Mirror/Runtime/Transport/Ignorance/IgnoranceThreaded.cs#L122 The second check is nowhere to be found.

This is most likely the cause of #58 as well.