Default BeaconListenPort is not used due to invalid logic in FOnlineSessionNull

Please see comments in code below where I point out error in logic.

bool FOnlineSessionNull::GetResolvedConnectString(const class FOnlineSessionSearchResult& SearchResult, FName PortType, FString& ConnectInfo)
{
	bool bSuccess = false;
	if (SearchResult.Session.SessionInfo.IsValid())
	{
		TSharedPtr<FOnlineSessionInfoNull> SessionInfo = StaticCastSharedPtr<FOnlineSessionInfoNull>(SearchResult.Session.SessionInfo);

		if (PortType == BeaconPort)
		{

Notice default port here is 15000

			int32 BeaconListenPort = 15000;
			if (SearchResult.Session.SessionSettings.Get(SETTING_BEACONPORT, BeaconListenPort) && BeaconListenPort > 0)
			{

But if statement above uses && instead of || so default never gets used if SETTING_BEACONPORT has not been set.

				bSuccess = GetConnectStringFromSessionInfo(SessionInfo, ConnectInfo, BeaconListenPort);
			}
		}
		else if (PortType == GamePort)
		{
			bSuccess = GetConnectStringFromSessionInfo(SessionInfo, ConnectInfo);
		}
	}
	
	if (!bSuccess || ConnectInfo.IsEmpty())
	{
		UE_LOG_ONLINE(Warning, TEXT("Invalid session info in search result to GetResolvedConnectString()"));
	}

	return bSuccess;
}

This one should be a simple fix of changing && to ||. Thanks guys!

Hi ,

Thank you for pointing this out to us. I have submitted a report about this to have it investigated further (UE-7088).

I hate to bring up an old topic, especially one almost a year old, but was anything determined regarding this? I notice this line of code still exists and I’ll happily edit it but I want to ensure that that is accepted answer.

You know it’s funny, I was just looking at this line of code again about a month ago and was thinking same thing. It seems like best way to get it integrated is to do a pull request nowadays. But I just don’t have time to do that right now. I’ve been working 80-90 hours a week so that we are ready for steam. I hope they fix it soon as I’m sure many others encounter this issues as well.

Hi all,

There hasn’t been an update on bug report at this time. We’ll post here once we see any change. If you do create a pull request, let us know and we’ll link reports. Thanks!

https://github.com/EpicGames/UnrealEngine/pull/1759

Sorry guys, I never saw this thread or it wasn’t assigned properly. I’ll be working on getting this submitted today.

https://github.com/EpicGames/UnrealEngine/pull/1759

Thanks for submission, I added code to Steam as well. CL#2768532 in one of our streams, it will make its way into mainline shortly.