Hello, I can not make a connection to a dedicated server for Steam. To make it appear in the list Steam servers.
I can not get the correct Steam server id.
LogOnline:Verbose: STEAM: Initializing Steam Game Server IP: 0x00000000 Port: 7777 SteamPort: 7778 QueryPort: 27015
DefaultEngine.ini
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
PollingIntervalInMs=20
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
GameServerQueryPort=27015
bRelaunchInSteam=false
GameVersion=1.0.0.0
bVACEnabled=1
bAllowP2PPacketRelay=true
P2PConnectionTimeout=90
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="/Script/OnlineSubsystemSteam.SteamNetConnection"
NetServer.Targer.cs
using UnrealBuildTool;
using System.Collections.Generic;
public class NetServerTarget : TargetRules
{
public NetServerTarget(TargetInfo Target)
{
Type = TargetType.Server;
UEBuildConfiguration.bCompileSteamOSS = true;
}
....
Net.Build.cs
using UnrealBuildTool;
public class Net : ModuleRules
{
public Net(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem",
"OnlineSubsystemUtils" });
DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
...
NetGameMode.cpp
#include "Net.h"
#include "NetGameMode.h"
#if !UE_EDITOR
bool bUseAuthentication = true;
#endif
GameSession.cpp
void AGameSession::RegisterServer()
{
UE_LOG(LogTemp, Log, TEXT("[LEET] GAME SESSION RegisterServer"));
UWorld* World = GetWorld();
IOnlineSessionPtr SessionInt = Online::GetSessionInterface();
FOnlineSessionSettings Settings;
Settings.NumPublicConnections = 3;
Settings.bShouldAdvertise = true;
Settings.bAllowJoinInProgress = true;
Settings.bIsLANMatch = true;
Settings.bUsesPresence = true;
Settings.bAllowJoinViaPresence = true;
SessionInt->CreateSession(0, GameSessionName, Settings);
return;
}