Hi,
I can’t find session using dedicated server and client. I am using two computers and two steam accounts. Server computer has all ports open and public ip. Below are my configs. I am using AppId for my steam product, not default 480. Engine is 4.26 and I am using new SteamSockets subsystem. I have tried multiple combinations of flags with no luck. Well I do not want to connect directly to dedicated server, but to properly discover sessions as engine does not support to get sessions from ip. Of course for LAN everything works perfectly, so cpp functions are valid, but this is not what I want.
DefaultEngine.ini for client and server are the same, shoud they be different?
[URL]
GameName=Mythic
Port=7777
[OnlineSubsystemSteam]
SteamAppId=XXX
SteamDevAppId=XXX
bEnabled=True
bVACEnabled=True
GameServerQueryPort=27015
GameVersion=1.0.0.0
bUseSteamNetworking=True ;//NOT SURE OF THIS FLAG
bInitServerOnClient=false ;//NOT SURE OF THIS FLAG
[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="SteamSockets.SteamSocketsNetConnection"
Function for creating session:
void UMysticGameInstance::CreateServer(FString ServerName, FString HostName)
{
UE_LOG(LogMysticInstance, Warning, TEXT("Create Server..."));
FOnlineSessionSettings SessionSettings;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bAllowJoinInProgress = true;
SessionSettings.bAllowJoinViaPresence = true;
SessionSettings.bIsDedicated = true;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bAllowInvites = true;
SessionSettings.NumPublicConnections = 4;
MyDebugInfo();
SessionSettings.Set(FName("SERVER_NAME_KEY"), ServerName, EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
SessionSettings.Set(FName("SERVER_HOSTNAME_KEY"), HostName, EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
SessionInterface->CreateSession(0, GlobalSessionName, SessionSettings);
}
Function for searching session:
void UMysticGameInstance::FindSessions()
{
SessionSearch = MakeShared<FOnlineSessionSearch>();
SessionSearch->MaxSearchResults = 50;
SessionSearch->bIsLanQuery = false;
SessionSearch->TimeoutInSeconds = 10;
//this does not matter if it is turned on or off
SessionSearch->QuerySettings.Set(SEARCH_DEDICATED_ONLY, true, EOnlineComparisonOp::Equals);
SessionInterface->FindSessions(0, SessionSearch.ToSharedRef());
}
What the hell am I doing worng?