We recently updated our Epic Online Services SDK from 1.16.1 to 1.17.1.3. After making the necessary updates and fixes, we were able to get our multiplayer flow up and running again, but only between Android devices.
When we try to create a lobby on an Android device and join from an iOS device (or vice versa), we can’t find the lobby.
I have tried the following things:
- Change EOS_Lobby_CreateLobbyOptions and EOS_Lobby_JoinLobbyOptions by setting bCrossplayOptOut to false.
- Change EOS_Lobby_CreateLobbyOptions and EOS_Lobby_JoinLobbyOptions by setting bPresenceEnabled to false in both (instead of true)
- Changing EOS_Lobby_CreateLobbyOptions by setting the allowed platformIds as shown in the snippet below.
- This creates a warning: LogEOS: Warning: LogEOSLobby: Error response received from backend. StatusCode=[400], ErrorCode=[errors.com.epicgames.lobbies.invalid_session], ErrorMessage=[AllowedPlatforms contains an unknown value, supported values are HashSet(0, 2000, 3000, 4000, 1000)]
- EOS_OPT_Epic is 100. Shouldn’t that be a valid platform?
- Changing EOS_Lobby_CreateLobbyOptions by setting the platformIds to EOS_OPT_Android and EOS_OPT_IOS, but those do not exist
- Explicitly setting AllowedPlatformIds to nullptr and AllowedPlatformIdsCount to 0 in EOS_Lobby_CreateLobbyOptions.
Snippet
TArray<uint32> AllowedPlatforms;
AllowedPlatforms.Add(EOS_OPT_Epic);
CreateOptions.AllowedPlatformIds = AllowedPlatforms.GetData();
CreateOptions.AllowedPlatformIdsCount = AllowedPlatforms.Num();
CreateOptions.bCrossplayOptOut = false;
Sadly, none of these issues seem to have fixed the issue.
This is how we create a lobby:
EOS_Lobby_CreateLobbyOptions CreateOptions = {};
CreateOptions.ApiVersion = EOS_LOBBY_CREATELOBBY_API_LATEST;
CreateOptions.LocalUserId = CurrentUserProductId;
CreateOptions.MaxLobbyMembers = Lobby.MaxNumLobbyMembers;
CreateOptions.PermissionLevel = Lobby.Permission;
CreateOptions.bPresenceEnabled = true;
CreateOptions.bAllowInvites = true;
CreateOptions.BucketId = BucketString;
CreateOptions.bDisableHostMigration = false;
CreateOptions.bEnableRTCRoom = false;
CreateOptions.LocalRTCOptions = nullptr;
CreateOptions.LobbyId = nullptr;
CreateOptions.bEnableJoinById = true;
CreateOptions.bRejoinAfterKickRequiresInvite = false;
EOS_Lobby_CreateLobby(LobbyHandle, &CreateOptions, nullptr, OnCreateLobbyFinished);
We search for the lobby using:
TArray<FLobbyAttribute> Attributes;
FLobbyAttribute Attribute;
Attribute.Key = TCHAR_TO_UTF8(*PropertyName.ToUpper());
Attribute.Visibility = EOS_ELobbyAttributeVisibility::EOS_LAT_PUBLIC;
Attribute.ValueType = FLobbyAttribute::Type::String;
Attribute.AsString = TCHAR_TO_UTF8(*JoinCode);
Attributes.Add(Attribute);
EOS_Lobby_CreateLobbySearchOptions CreateSearchOptions = {};
CreateSearchOptions.ApiVersion = EOS_LOBBY_CREATELOBBYSEARCH_API_LATEST;
CreateSearchOptions.MaxResults = MaxNumResults;
EOS_HLobbySearch LobbySearch = nullptr;
EOS_EResult Result = EOS_Lobby_CreateLobbySearch(LobbyHandle, &CreateSearchOptions, &LobbySearch);
if (Result != EOS_EResult::EOS_Success)
{
UE_LOG_LOBBY(Error, TEXT("Could not create search. Error code: %s"), *FString(EOS_EResult_ToString(Result)));
return;
}
EOS_LobbySearch_SetParameterOptions ParamOptions = {};
ParamOptions.ApiVersion = EOS_LOBBYSEARCH_SETPARAMETER_API_LATEST;
ParamOptions.ComparisonOp = EOS_EComparisonOp::EOS_CO_EQUAL;
EOS_Lobby_AttributeData AttrData;
AttrData.ApiVersion = EOS_LOBBY_ATTRIBUTEDATA_API_LATEST;
ParamOptions.Parameter = &AttrData;
for (const FLobbyAttribute& NextAttr : SearchAttributes)
{
AttrData.Key = NextAttr.Key.c_str();
switch (NextAttr.ValueType)
{
case FLobbyAttribute::String:
AttrData.ValueType = EOS_ELobbyAttributeType::EOS_AT_STRING;
AttrData.Value.AsUtf8 = NextAttr.AsString.c_str();
break;
}
Result = EOS_LobbySearch_SetParameter(LobbySearch, &ParamOptions);
if (Result != EOS_EResult::EOS_Success)
{
UE_LOG_LOBBY(Error, TEXT("Failed to update lobby search with parameter. Error code: %s"), *FString(EOS_EResult_ToString(Result)));
return;
}
}
EOS_LobbySearch_FindOptions FindOptions = {};
FindOptions.ApiVersion = EOS_LOBBYSEARCH_FIND_API_LATEST;
FindOptions.LocalUserId = CurrentUserProductId;
EOS_LobbySearch_Find(LobbySearch, &FindOptions, nullptr, OnLobbySearchFinished);
Why would our lobby search have broken from this update, but only in cross platform?