Hi,
I would like to know if this is a known issue:
Starting the editor with two clients and one acting as listen server, the client will randomly but with a high repro rate, disconnect from the server due to a visibility request on a package the server is not aware of.
At first it seemed to be an issue after an upgrade to 5.6 but looking at the code it seems this could be problematic on earlier versions as well.
The issue disappears with `net.SkipMissingLevelDisconnect=True` but we do not want to enable this CVar.
Cell names stored in `UWorldPartition::GeneratedLevelStreamingPackageNames` when starting PIE mismatch the package names determined during `UWorldPartitionRuntimeLevelStreamingCell::CreateLevelStreaming`, due to the world type being `Editor` when `PrepareEditorGameWorld()` is called, but `PIE` when `UWorldPartitionRuntimeLevelStreamingCell::CreateLevelStreaming` is called so `UWorldPartition::IsValidPackageName()` returns false.
`UWorldPartition::IsValidPackageName()` is called in `NetConnection.cpp::ValidateLevelVisibility` (`FLevelUtils::IsValidStreamingLevel()`).
On our end this is how we fixed it:
`Engine\Source\Runtime\Engine\Public\WorldPartition\WorldPartition.h`:
```
+ //Fix for listen server PIE disconnecting clients
+ public:
+ bool IsPIE() const { return bIsPIE; }
+
+ private:
//
```
`Engine\Source\Runtime\Engine\Private\WorldPartition\WorldPartitionLevelStreamingPolicy.cpp`:
```
FString UWorldPartitionLevelStreamingPolicy::GetCellPackagePath(const FName& InCellName, const UWorld* InWorld)
{
+ // Fix for listen server PIE disconnecting clients
+ const bool bIsPIE = InWorld->GetWorldPartition()->IsPIE();
+ if (InWorld->IsGameWorld() || bIsPIE)
+ //
{
+ // Fix for listen server PIE disconnecting clients
+ if (InWorld->IsPlayInEditor() || InWorld->IsPlayInPreview() || bIsPIE)
+ //
{
// Set as memory package to avoid wasting time in FPackageName::DoesPackageExist
return FString::Printf(TEXT("/Memory/%s\_%s"), \*FPackageName::GetShortName(InWorld\-\>GetPackage()), \*InCellName.ToString());
}
// This is for non\-PIE mode in editor, such as with \-game and \-server. It kind of mimics OFPAs being
// flattened into the level list upon cooking.
return FString::Printf(TEXT("%s/%s"), \*InWorld\-\>GetPackage()\-\>GetName(), \*InCellName.ToString());
}
return FString::Printf(TEXT(“/%s”), *InCellName.ToString());
}
```
Please let me know if you create an issue for this so we can remove the engine change when it is addressed in a future version and if you see an issue with our fix.
Thanks in advance,
Hugo