FInternetAddressEOS and client travel appears broken in 5.7

We recently upgraded to 5.7 and client travel has broken for us

To establish our current setup:

We use the common session plugin, lobbies and OSSv2. When a prospective client tries to join a host, it finds the host’s lobby, calls join, which calls InternalTravelToSession, which ends up calling FOnlineServicesEOSGS::GetResolvedConnectString which returns:

          //It should look like this: "EOS:0002aeeb5b2d4388a3752dd6d31222ec"
          FInternetAddrEOS TempAddr(GetProductUserIdChecked(Lobby->OwnerAccountId));
          return TOnlineResult<FGetResolvedConnectString>({ TempAddr.ToString(true) });

It uses that as the travel URL. With the EOS:{id} format, the FURL being created prior to client travel ends up being marked as invalid.

When attached w/ a debugger, I’ve noticed that this function

FURL::FURL( FURL* Base, const TCHAR* TextURL, ETravelType Type )
{
// [...]
// Parse protocol. Don't consider colons that occur after the opening square brace,
// because they are valid characters in an IPv6 address.
if (!bParsedProtocol && FirstColonIdx != INDEX_NONE && FirstColonIdx > 1 &&
        ((SquareBracketIdx == INDEX_NONE && !bMultipleColons) || (FirstColonIdx < SquareBracketIdx) || (bMultipleColons && URLStr[FirstColonIdx+1] == '/')) &&
        (DotIdx == INDEX_NONE || FirstColonIdx < DotIdx))
{
        Protocol = URLStr.Left(FirstColonIdx);
        URLStr = URLStr.Mid(FirstColonIdx + 1);
}

gets called. The protocol changes from ‘unreal’ to ‘EOS’, which flags the URL as no longer internal, Additionally, URLStr changes from ‘EOS:0002aeeb5b2d4388a3752dd6d31222ec’ to ‘0002aeeb5b2d4388a3752dd6d31222ec’ (stripping out the ‘EOS:’ portion), which causes this section to not get run

      // Square bracket indicates an IPv6 address, but IPv6 addresses can contain dots also
      // They also typically have multiple colons in them as well.
      if (bIsHostnameWithDot || bPotentialIPv6Address || (ColonIdx != INDEX_NONE && ColonIdx == LastColonIdx) || bMultipleColons)
      {
            // [... This portion sets up the host and map values ...]
      }

Because it doesn’t run, the Host and Map parameter aren’t set, remaining empty. From what I can tell, these need to be set or the URL doesn’t get through the UEngine::Browse function correctly.

Is my understanding correct?

Has anyone else experienced any issues w/ 5.7 when using lobbies w/ OSSv2?

FOnlineServicesEOSGS::GetResolvedConnectString used to look like this

          //It should look like this: "EOS:0002aeeb5b2d4388a3752dd6d31222ec:GameNetDriver:97"
          FString NetDriverName = GetDefault<UNetDriverEOS>()->NetDriverName.ToString();
          FInternetAddrEOS TempAddr(GetProductUserIdChecked(Lobby->OwnerAccountId), NetDriverName, GetTypeHash(NetDriverName));

and now looks like this

          //It should look like this: "EOS:0002aeeb5b2d4388a3752dd6d31222ec"
          FInternetAddrEOS TempAddr(GetProductUserIdChecked(Lobby->OwnerAccountId));
          return TOnlineResult<FGetResolvedConnectString>({ TempAddr.ToString(true) });

It’s possible we have some other engine change that broke things, but I can’t think of anything in this flow of code. Is there a missing changelist or some error with how we use the FInternetAddrEOS to get the client to travel?

[Attachment Removed]

I don’t know if this is the correct fix but, this change

FString FInternetAddrEOS::ToString(bool bAppendPort) const
{
	char PuidBuffer[64];
	int32 BufferLen = 64;
#if WITH_EOS_SDK
	if (EOS_ProductUserId_ToString(ProductUserId, PuidBuffer, &BufferLen) != EOS_EResult::EOS_Success)
#endif
	{
		PuidBuffer[0] = '\0';
	}
 
	return FString::Printf(TEXT("%s%s%s"), EOS_CONNECTION_URL_PREFIX, EOS_URL_SEPARATOR, UTF8_TO_TCHAR(PuidBuffer));
}

to

FString FInternetAddrEOS::ToString(bool bAppendPort) const
{
	char PuidBuffer[64];
	int32 BufferLen = 64;
#if WITH_EOS_SDK
	if (EOS_ProductUserId_ToString(ProductUserId, PuidBuffer, &BufferLen) != EOS_EResult::EOS_Success)
#endif
	{
		PuidBuffer[0] = '\0';
	}
 
	return FString::Printf(TEXT("[%s%s%s]"), EOS_CONNECTION_URL_PREFIX, EOS_URL_SEPARATOR, UTF8_TO_TCHAR(PuidBuffer));
}

so the string goes from:

TEXT(“%s%s%s”) to TEXT(“[%s%s%s]”)

EOS:{LobbyID} to [EOS:{LobbyID}]

it fixes the issue

[Attachment Removed]

Thank you for flagging the issue and for sharing your workaround.

I’ve spoken with the team, and it looks like this is a known issue that we’ve already investigated.

Could you please review the following change and let me know if it resolves the issue for you?

https://github.com/EpicGames/UnrealEngine/commit/f9a15fb7733dae128c6881efea87c4259fbc04d9

[Attachment Removed]

Thank you for checking and confirming. Apologies for missing that this change didn’t cover the Online Services API.

We’ve shared this with the engineering team, who will look into implementing this fix.

[Attachment Removed]

Thank you again. We found the issue in the Online Services API and have made a change to fix this.

This will come down as Change 51343069, which is similar to the change you provided.

[Attachment Removed]

I tried it out and this does not fix the issue. When using EOS Online Services, the resolve connect string still can’t be formed into an URL correctly.

I noticed that the EOS sessions version of the GetResolvedConnectString calls GetConnectStringFromSessionInfo, which then creates the string from the address like this:

ConnectInfo = FString::Printf(TEXT("[%s]"), *AddrString);which adds the brackets to the address.

The EOS online services version just looks like this:

//It should look like this: "EOS:0002aeeb5b2d4388a3752dd6d31222ec"
FInternetAddrEOS TempAddr(GetProductUserIdChecked(Lobby->OwnerAccountId));
return TOnlineResult<FGetResolvedConnectString>({ TempAddr.ToString(true) });

which uses the address raw instead of adding the ‘[’ ‘]’ brackets.

Previously, I had made the change in FInternetAddrEOS to add the brackets, but I think to keep it consistent, it should be something like:

//It should look like this: "[EOS:0002aeeb5b2d4388a3752dd6d31222ec]"
FInternetAddrEOS TempAddr(GetProductUserIdChecked(Lobby->OwnerAccountId));
FString AddrString = FString::Printf(TEXT("[%s]", TempAddr.ToString(true)));
return TOnlineResult<FGetResolvedConnectString>({ AddrString });

I tried that out w/ our setup and it appears to fix the issue with connecting

[Attachment Removed]