5.5.4 UEngine::Browse doesn't cancel pending net connection when starting as listen server host

Hi, it seems like the pending net driver is not being cancelled when it should be (as described in the “steps to reproduce”). We have fixed this crash by making the following modification to UEngine::Browse(). This prevents UWorld::SetGameMode from thinking that the instance is a NM_Client incorrectly.

`if( URL.IsLocalInternal() )
{
// Local map file.
//BEGIN: Cancel pending net game when attempting to host a listen server since you’re in a bad state
if( WorldContext.PendingNetGame && URL.HasOption(TEXT(“listen”)))
{
CancelPending(WorldContext);
}
//END: Cancel pending net game when attempting to host a listen server since you’re in a bad state

return LoadMap( WorldContext, URL, NULL, Error ) ? EBrowseReturnVal::Success : EBrowseReturnVal::Failure;
}`Is there any scenario where you’d want to keep your pending net connection when you’re going to a local internal URL that’s attempting to become a listen server? Does this seem like a fix that should be part of the engine going forward?

Thanks.

Hi,

Thank you for bringing this to our attention!

I’m not aware of any situation in which you’d want to keep the PendingNetGame when trying to create a listen server. It’s possible this is just a situation we haven’t run into before.

If you’re not having any issues, then your fix definitely seems reasonable. I’ve gone ahead and opened a new issue for this, UE-274620, which should be visible in the public tracker in a day or so.

Thanks,

Alex

Great thanks. We’ll keep that modification for the time being in that case.