Hi,
Thank you for the logs and the additional information! I’ve been able to reproduce this in Lyra, and I believe I have a better understanding of what is happening.
As you pointed out, if the client loads these streaming levels before the connection is opened, ULevelStreaming::IsConcernedByNetVisibilityTransactionAck will return false, so the client won’t wait for acknowledgement from the server before making these levels visible and adding them to the world. When UNetConnection::HandleClientPlayer is later called, the client will send a ServerUpdateMultipleLevelsVisibility RPC containing all of its visible levels.
Because the client didn’t send visibility transaction requests for these levels, the server may not have them loaded, causing the MissingLevelPackage error and disconnect when the server receives this RPC.
Like you said, BeginPlay will force async loading of these levels to complete, so it makes sense that if OnRep_ReplicatedHasBegunPlay is called before HandleClientPlayer, this error can occur. We don’t guarantee that actors will be received in any specific order on the client, so depending on packet loss and latency, its possible for the client to receive the PlayerController before the GameState and vice versa, regardless of priority.
Your workaround does make sense, but it’s worth noting that I was able to observe this error occur even when the player controller was received before the GameState. In that case, some streaming levels completed loading on the client and were added to the world before the client had received either received the PlayerController or the GameState.
I’m not sure what the best solution here would be. We may need to make sure the client can’t add levels to the world when the connection is pending, but I’m not sure if that would cause some other undesirable side effects. I’ve opened a new issue for this, UE-364613, which should be visible in the public tracker in a day or so.
In the meanwhile, your workaround does seem reasonable if that is the only situation in which you’re seeing the disconnect occur. In some cases, you can also enable the “net.SkipMissingLevelDisconnect” CVar to ignore these warnings, although we only recommend doing so for testing purposes.
Thanks,
Alex
[Attachment Removed]