I’m trying to use OnlineService (aka OSSv2) for an online game. A game client can create a lobby, but another game client cannot find the lobby via GetLabbiesInterface()->FindLobbyes()>.
2 game clients A and B. A and B use different Epic Accound logins:
- [Success] Use A to create the lobby. Lobbies can be found in the Epic Development Portal.
- [Success] Use A to find the lobby. FindLobbys() returned the correct lobby.
- [Failed] Use B to find the lobby. But got error:
2023-10-09 00:20:28.799 UnrealEditor[80654:18855762] [UE] [2023.10.08-16.20.28:799][142]LogEOSSDK: Warning: LogEOSLobby: Lobby membership count inconsistency
2023-10-09 00:20:28.799 UnrealEditor[80654:18855762] [UE] [2023.10.08-16.20.28:799][142]LogOnlineServices: Warning: [FLobbyDetailsEOS::GetLobbySnapshot] ResolveAccountIds Failed: Expected Count[1], Received Count[0], Lobby[f6ad313ebef0413380ba7c3cc232bf57]
2023-10-09 00:20:28.799 UnrealEditor[80654:18855762] [UE] [2023.10.08-16.20.28:799][142]LogOnlineServices: Warning: [FLobbyDataEOS::Create] FLobbyDetailsEOS::GetLobbySnapshot Failed: Lobby[Epic:1], Result[unknown]
2023-10-09 00:20:28.799 UnrealEditor[80654:18855762] [UE] [2023.10.08-16.20.28:799][142]LogOnlineServices: Warning: [FLobbyDataRegistryEOS::FindOrCreateFromLobbyDetails] FLobbyDataEOS::Create Failed: User[Epic:1 (EAS=[8cc24319af034b21842b27a508d15c4a] EOS=[000216e4bfc04842a690217ff9cebece])], Lobby[f6ad313ebef0413380ba7c3cc232bf57], Result[unknown]
2023-10-09 00:20:28.799 UnrealEditor[80654:18855762] [UE] [2023.10.08-16.20.28:799][142]LogOnlineServices: Warning: [FLobbySearchEOS::Create] FLobbyDataRegistryEOS::FindOrCreateFromLobbyDetails Failed: Unable to resolve search result. User[Epic:1 (EAS=[8cc24319af034b21842b27a508d15c4a] EOS=[000216e4bfc04842a690217ff9cebece])], Result[unknown]
2023-10-09 00:20:28.801 UnrealEditor[80654:18855762] [UE] [2023.10.08-16.20.28:801][142]LogOnlineServices: Warning: [FLobbiesEOSGS::JoinLobby] FLobbySearchEOS::Create Failed: User[Epic:1 (EAS=[8cc24319af034b21842b27a508d15c4a] EOS=[000216e4bfc04842a690217ff9cebece])], Result[unknown]
Login Params:
FExternalUIShowLoginUI::Params Params;
UIService->ShowLoginUI(MoveTemp(Params)).OnComplete([this](const TOnlineResult<FExternalUIShowLoginUI>& Result)
...
Create Params:
FCreateLobby::Params Params;
Params.LocalAccountId = PlayerAccountInfo->AccountId;
Params.LocalName = FName(GetNickName());
Params.MaxMembers = 2;
Params.SchemaId = FName(TEXT("GameLobby"));
Params.bPresenceEnabled = true;
Params.JoinPolicy = ELobbyJoinPolicy::PublicAdvertised;
Params.Attributes.Emplace(FSchemaAttributeId(TEXT("MapName")), FString(TEXT("DefaultMap2")));
LobbiesService->CreateLobby(MoveTemp(Params)).OnComplete([this](const TOnlineResult<FCreateLobby>& Result)
...
Find Params:
FFindLobbies::Params Params;
Params.LocalAccountId = PlayerAccountInfo->AccountId;
Params.MaxResults = 10;
LobbiesService->FindLobbies(MoveTemp(Params)).OnComplete([this](const TOnlineResult<FFindLobbies>& Result)
...
DefaultEngine.ini:
[OnlineServices]
DefaultServices = Epic
[OnlineServices.EOS]
ProductId = ...
SandboxId = p-...
DeploymentId = ...
ClientId = ...
ClientSecret = ...
[OnlineServices.Lobbies]
+SchemaDescriptors = (Id="GameLobby", ParentId="LobbyBase")
!SchemaCategoryAttributeDescriptors = ClearArray
+SchemaCategoryAttributeDescriptors = (SchemaId="LobbyBase", CategoryId="Lobby", AttributeIds=("SchemaCompatibilityId"))
+SchemaCategoryAttributeDescriptors = (SchemaId="LobbyBase", CategoryId="LobbyMember")
+SchemaCategoryAttributeDescriptors = (SchemaId="GameLobby", CategoryId="Lobby", AttributeIds=("GameMode", "GameSessionId", "MapName", "MatchTimeout"))
+SchemaCategoryAttributeDescriptors = (SchemaId="GameLobby", CategoryId="LobbyMember", AttributeIds=("Appearance"))
+SchemaAttributeDescriptors = (Id="SchemaCompatibilityId", Type="Int64", Flags=("Public", "SchemaCompatibilityId"))
+SchemaAttributeDescriptors = (Id="GameMode", Type="String", Flags=("Public"), MaxSize=64)
+SchemaAttributeDescriptors = (Id="GameSessionId", Type="String", Flags=("Private"), MaxSize=64)
+SchemaAttributeDescriptors = (Id="MapName", Type="String", Flags=("Public"), MaxSize=64)
+SchemaAttributeDescriptors = (Id="MatchTimeout", Type="Double", Flags=("Public"))
+SchemaAttributeDescriptors = (Id="Appearance", Type="String", Flags=("Public"), MaxSize=64)
UE Version:
Version: 5.3.1-28051148+++UE5+Release-5.3
Platform: macOS 13.5.2 (x86_64)