Unable to start steam dedicated server

Been trying to get a steam dedicated server working, but haven’t had much luck. I more or less copied the code from ShooterGame. I am using a source built engine (4.17.1), compiling a dedicated server build (TDSServer.exe) and then copying that into my built game directory. When I launch the steam dedicated server, I get an error:

[2017.09.15-19.10.25:776][
32]LogOnline: Warning: STEAM: Server
setting ,SESSIONFLAGS:683 overflows
Steam SetGameTags call

Even knowing I haven’t set any extra options! I talked a bit with eXi on discord, who mentioned that it’s a bit of an error with the engine. On line 242 of OnlineSessionAsyncServerSteam.cpp you’ll see theres a conditional check

	if (GameTagsString.Len() + NewKey.Len() < k_cbMaxGameServerTags)
	{
		GameTagsString = GameTagsString + "," + NewKey;
	}
	else
	{
		UE_LOG_ONLINE(Warning, TEXT("Server setting %s overflows Steam SetGameTags call"), *NewKey);
	}

I’ve been told that there is an issue with this check, I’m hoping someone from the Epic staff department can help out, or others that have run into this issue before.

Just to confirm, I have my own application ID, and I have setup my IPs on steam partner page. I have steam working if I do a listen server. I just can’t get the dedicated server to launch properly. Just to show, this is my current GameSession class:

#include "TDS.h"
#include "TDSGameMode.h"
#include "TDSGameSession.h"


ATDSGameSession::ATDSGameSession()
{
	OnCreateSessionCompleteDelegate = FOnCreateSessionCompleteDelegate::CreateUObject(this, &ATDSGameSession::OnCreateSessionComplete);
	MaxPlayers = 64;
}

void ATDSGameSession::BeginPlay()
{
	Super::BeginPlay();	
}

void ATDSGameSession::RegisterServer()
{
	
	
	IOnlineSubsystem* const OnlineSub = IOnlineSubsystem::Get();
	if (OnlineSub)
	{
		IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
		if (Sessions.IsValid())
		{
			ATDSGameMode* GameMode = Cast<ATDSGameMode>(GetWorld()->GetAuthGameMode());
			if (GameMode)
			{
				UE_LOG(LogTemp, Warning, TEXT("game session register server"));

				TSharedPtr<class FOnlineSessionSettings> HostSettings = MakeShareable(new FOnlineSessionSettings());

				/*HostSettings->Set(FName(TEXT("MATCHHOPPER")), FString("TeamDeathmatch"), EOnlineDataAdvertisementType::DontAdvertise);
				HostSettings->Set(FName(TEXT("MATCHTIMEOUT")), 120.0f, EOnlineDataAdvertisementType::ViaOnlineService);
				HostSettings->Set(FName(TEXT("SESSIONTEMPLATENAME")), FString("GameSession"), EOnlineDataAdvertisementType::DontAdvertise);*/
				//HostSettings->Set(SETTING_MAPNAME, GetWorld()->GetMapName(), EOnlineDataAdvertisementType::ViaOnlineService);

				HostSettings->NumPublicConnections = 64;
				HostSettings->NumPrivateConnections = 0;
				HostSettings->bIsLANMatch = false;
				HostSettings->bShouldAdvertise = true;
				HostSettings->bAllowJoinInProgress = true;
				HostSettings->bAllowInvites = true;
				HostSettings->bUsesPresence = false;
				HostSettings->bAllowJoinViaPresence = true;
				HostSettings->bAllowJoinViaPresenceFriendsOnly = false;
				HostSettings->bIsDedicated = true;
				
				OnCreateSessionCompleteDelegateHandle = Sessions->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);
				UE_LOG(LogTemp, Warning, TEXT("starting create session"));
				Sessions->CreateSession(0, GameSessionName, *HostSettings);
				
			}
		}
	}
}

void ATDSGameSession::OnCreateSessionComplete(FName InSessionName, bool bWasSuccessful)
{
	UE_LOG(LogTemp, Verbose, TEXT("OnCreateSessionComplete %s bSuccess: %d"), *InSessionName.ToString(), bWasSuccessful);

	IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
	if (OnlineSub)
	{
		IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
		Sessions->ClearOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegateHandle);
	}

	OnCreatePresenceSessionComplete().Broadcast(InSessionName, bWasSuccessful);
}

Hey Null7238, I think I remember this bug from a while back. Could you add the full string to the print-out for GameTagsString in that warning?

Like this:

UE_LOG_ONLINE(Warning, TEXT("Server setting %s overflows Steam SetGameTags call; current string: %s"), *NewKey, *GameTagsString);

That will help us figure out what is using all of the space. If I remember correctly though, it’s the IP/Port and the SteamP2P Address and Port that are taking up a majority of the 128 characters that fit in the GameTags.

[2017.09.16-18.14.37:518][ 33]LogOnline: Warning: STEAM: Server setting ,SESSIONFLAGS:683 overflows Steam SetGameTags call; current string: BUILDID:1703233442,OWNINGID:90111113513107465,OWNINGNAME:90111113513107465,P2PADDR:90111113513107465,P2PPORT:7777

That should work, to make sure you can get it in. I wonder if that field is necessary, and if you can just not set it at all, as you can query the owner’s name from their ID. Setting “bob” for everyone may be a surprise, when someone actually tries to use that field and gets a hard-coded value.

I managed to get it to not spit out an error using this “hacky workaround”.

now I just need to see if I can actually connect

Still not able to connect unfortunately. This is what my logs look like:

but yet, my friend can’t see the server, and can’t connect to the server.

I may have had things configured incorrectly on the client side for finding sessions, so just trying a different build now. If you say that’s how it should look, then I won’t mess with the server side code any more. Thank you for all your help so far!

I had to change over to advanced sessions plugin’s version of “find sessions” in BP. the regular UE4 one didn’t find anything. now it works properly. thanks again!

That looks like the server registered itself correctly. Ensure you have opened the query port (27015 by default) on any firewall your server is behind; this is the port that Steam will use to communicate for Gameserver lists. For connection, you will need port 7777 opened as well. I believe it is UDP traffic for both.

When in doubt, try “open IP:PORT” in your console when the game is up, and directly connect to it; that’ll at least make sure your server is up.

Also worth noting, when you call find sessions, make sure you’re setting “bUsesPresence” to false in your search settings, as that signifies the Steam OSS to search for Dedicated Server sessions, instead of Lobby sessions.

A note here for those coming across this in the future:
This warning does not actually affect the connection process. ‘GameTags’ are used for filtering servers using the Steam Matchmaking API.

I’m actually using this warning as an indicator that it successfully ran the registration process. If everything is configured correctly and you have it configured it to do so in Steamworks. it should show up in the Steam Server browser in at this point.

If you reach this warning, but the connection process is not working, make sure you are forwarding this port an have allowed the application through your firewall.

(One issue I’ve come across is the server disappearing from the Server Browser after several seconds. Switching from 27015 to 27016/27017 seems to fix this)