So I’m trying integrate the steam subsystem to support online play with multiple people. I got it working so far and 2 people (the host and 1 client) are able to join. But when a third person tries to join, it is not able to find the online session anymore. I’m not sure why this is happening. I made it a lobby matchmaking system by enabling presence. I think the issue is with finding a match. I’ll list some of the relevant code below.
So the issue is not with not enabled steam or something because it works perfectly fine with 2 people. Its just with 2+ people, it doesn’t. I tried this same logic with the NULL subsystem (so LAN) and it works fine with any amount of people joining. Just for steam, it doesn’t work (limit of 2).
in GameInstance.cpp
const static FName SESSION_NAME = TEXT("GameSession");
const static FName SERVER_SETTINGS = TEXT("ServerName");
void UTheGameInstance::CreateSession(FString DesiredServerName)
{
FOnlineSessionSettings SessionSettings;
SessionSettings.bIsLANMatch = false;
SessionSettings.NumPublicConnections = 6;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bUsesPresence = true;
SessionSettings.Set(SERVER_SETTINGS, DesiredServerName, EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
SessionInterface->CreateSession(0, SESSION_NAME, SessionSettings);
}
void UTheGameInstance::FindGames()
{
SessionSearch = MakeShareable(new FOnlineSessionSearch());
SessionSearch->MaxSearchResults = 100;
SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
SessionInterface->FindSessions(0, SessionSearch.ToSharedRef());
}