Dedicated server with Steam is a joke

Now it’s saying “Image CDN upload failed: couldn’t copy files to remote host. Error code 23” when I click on the Publish button.

EDIT: It was a Steam problem, now I published the changes, but it’s still not working.

Really? We’ve been attempting to get dedicated servers working for over 4 days (all day) without success.
After numerous attempts, including the fact that Steam servers don’t seem to work even with a clean version of Shooter Game (using our Steam APP ID) we suspect this is indeed a bug in UE4.

I could not tell you about Shooter Game.
But yes Steam is working for both dedicated server and client`s 4.10.x.
I am able to host a game and find them using FindSession in the client.

Best advice i can give you is to start from a “clean” project.
And implement Steam yourself using the wiki Rama wrote on Steam Implementation.
And the session wiki writen by eXi
That way you will see if server is available using steam server list.

If it is then you have a project issue, if not i whould think its a port forwarding issue or something of that nature.
Keep in mind for the server to be available it needs the port open for the services as well take a look here.
Required Ports for Steam

Anything else I think you guys need to post some code for the session creation and so 4th so we can be of more help.

Forget using a VPS - stick with your own local PC for now.

is the Steam API even being initilised?

This is my local machine running a dedicated server without Steam running and no way to contact the master server list:



[2016.01.19-03.52.24:058]  0]LogOnline:Display: STEAM: Loading Steam SDK 1.32
[2016.01.19-03.52.24:068]  0]LogOnline:Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
[2016.01.19-03.52.24:068]  0]LogOnline:Display: STEAM: OnlineSubsystemSteam::Shutdown()
[2016.01.19-03.52.24:068]  0]LogOnline:Warning: STEAM: Steam API failed to initialize!
[2016.01.19-03.52.24:068]  0]LogOnline:Display: STEAM: OnlineSubsystemSteam::Shutdown()


What does the log on your local machine without Steam running say?

I read this thread on the AnswerHub: Unreal Engine 4.8 Pre. 4 Steam Issues - Platform & Builds - Unreal Engine Forums
I tried to run the project that TheMunky linked at the bottom of the thread (File Dropper - Online file sharing), and I can find my session but it says “Failed” when I’m joining it.

Confirmed bug. It’s not possible that multiple game projects fail to work.

This build of UE4 is thus definately bugged and needs fixing ASAP. This is NOT a port issue since with ports closed it won’t even load the map when attempting to host a game.


[2016.01.19-17.50.51:911][122]LogOnline:Warning: STEAM: Failed to obtain steam user stats, user: Zeb89 [0x1100001032B7ECB] has no stats entries
[2016.01.19-17.50.55:152][322]LogBlueprintUserMessages: [FirstPersonCharacter_C_0] Setting up host.
[2016.01.19-17.51.05:201][946]LogOnline:Warning: Async task 'FOnlineAsyncTaskSteamCreateLobby bWasSuccessful: 0 LobbyId: 0 LobbyType: 2 Result: '16' k_EResultTimeout (operation timed out)' failed in 10.040405 seconds

It will always time out if Steam is used.
Also people downrating this thread simply because we’re pointing out a bug in their beloved software are funny.

Like a poster already mentioned before me: create a completely blank project implement the steam api and run it only locally.

Ok so,

let’s take it slow. I just used up like 5 hours of my free time getting a working solution for you or at least try to understand why
your stuff is failing.

Thanks to “maide” on the SlackChat i got some insights, although i’m still not 100% sure if everything is working now.

(Other people here in the Forum could share their Dedicated Server Session Creation code to help too…)

Things i found out:

This happens, because you are setting


Settings.bUsesPresence = true;

This results in the


FOnlineSessionSteam::CreateSession(int32 HostingPlayerNum, FName SessionName, const FOnlineSessionSettings& NewSessionSettings)

calling this


if (Session->SessionSettings.bUsesPresence)
{
    Result = CreateLobbySession(HostingPlayerNum, Session);
}

instead of this



else
{
     Result = CreateInternetSession(HostingPlayerNum, Session);
}


Why is this bad? Well, the Dedicated Servers won’t work in the Lobby Systems of Steam. I don’t even know if that is possible or ever meant to be possible.
Games like “ARK” should not be able to use the Lobby System either. Only way this can be achieved is by rewriting code in the Source yourself or by finding
someone who is willing to share that knowledge.

And YES, you can directly forget Epic to address this “problem” (some may call it problem…), since it’s nowhere near there current priority.

When you change the presence bool to false, you will be able to create the Session in the RegisterServer functions of your GameSession class.

That will then look similar to this in the log:

[spoiler]



[2016.01.20-00.01.51:205]  0]LogOnline:Verbose: STEAM: Initializing Steam game server
[2016.01.20-00.01.51:205]  0]LogTemp:Warning: InitGame---------------------------------------------------
[2016.01.20-00.01.51:205]  0]LogTemp:Warning: Not Standalone
[2016.01.20-00.01.54:170]  0]LogWorld: Bringing up level for play took: 2.975297
[2016.01.20-00.01.54:171]  0]LogOnline: GotoState: NewState: Playing
[2016.01.20-00.01.54:171]  0]LogInit:Display: Game Engine Initialized.
[2016.01.20-00.01.54:171]  0]LogLoad: Full Startup: 18.46 seconds (BP compile: 0.00 seconds)
[2016.01.20-00.01.55:135] 30]LogOnline:Verbose: STEAM: FOnlineAsyncEventSteamServerConnectedGS ServerId: Server [0x1401897A292C805]
[2016.01.20-00.01.55:391] 38]LogOnline:Verbose: STEAM: FOnlineAsyncEventSteamServerPolicyResponseGS Secure: 1
[2016.01.20-00.01.55:423] 39]LogOnline:Verbose: Async task 'FOnlineAsyncTaskSteamCreateServer bWasSuccessful: 1' succeeded in 4.187077 seconds
[2016.01.20-00.01.55:423] 39]LogOnline:Verbose: STEAM: Server SteamP2P IP: 90099032094066693:7777
[2016.01.20-00.01.55:424] 39]LogOnline:Verbose: STEAM: Server IP: 87.151.63.254:7777
[2016.01.20-00.01.55:424] 39]LogOnline:Verbose: STEAM: Master Server Data (OWNINGID, 90099032094066693)
[2016.01.20-00.01.55:424] 39]LogOnline:Verbose: STEAM: Master Server Data (OWNINGNAME, 90099032094066693)
[2016.01.20-00.01.55:424] 39]LogOnline:Verbose: STEAM: Master Server Data (P2PADDR, 90099032094066693)
[2016.01.20-00.01.55:424] 39]LogOnline:Verbose: STEAM: Master Server Data (P2PPORT, 7777)
[2016.01.20-00.01.55:424] 39]LogOnline:Verbose: STEAM: Master Server Data (SESSIONFLAGS, 683)
[2016.01.20-00.01.55:424] 39]LogOnline:Warning: STEAM: Server setting ,SESSIONFLAGS:683 overflows Steam SetGameTags call
[2016.01.20-00.01.55:425] 39]LogOnline:Verbose: STEAM: Master Server Data (GameMode_s, TeamDeathmatch)
[2016.01.20-00.01.55:425] 39]LogOnline:Warning: STEAM: Server setting ,GameMode_s:TeamDeathmatch overflows Steam SetGameTags call
[2016.01.20-00.01.55:425] 39]LogOnline:Verbose: STEAM: Master Server Data (MATCHTIMEOUT_f, 120.000000)
[2016.01.20-00.01.55:425] 39]LogOnline:Warning: STEAM: Server setting ,MATCHTIMEOUT_f:120.000000 overflows Steam SetGameTags call
[2016.01.20-00.01.55:425] 39]LogOnline:Verbose: STEAM: Master Server Data (SEARCHKEYWORDS_s, Custom)
[2016.01.20-00.01.55:425] 39]LogOnline:Warning: STEAM: Server setting ,SEARCHKEYWORDS_s:Custom overflows Steam SetGameTags call
[2016.01.20-00.01.55:425] 39]LogOnline:Verbose: STEAM: SetGameTags(BUILDID:955982468,OWNINGID:90099032094066693,OWNINGNAME:90099032094066693,P2PADDR:90099032094066693,P2PPORT:7777)
[2016.01.20-00.01.55:425] 39]LogOnline:Verbose: STEAM: SetGameData(OWNINGID:90099032094066693,OWNINGNAME:90099032094066693,P2PADDR:90099032094066693,P2PPORT:7777,SESSIONFLAGS:683,GameMode_s:TeamDeathmatch,MATCHTIMEOUT_f:120.000000,SEARCHKEYWORDS_s:Custom)
[2016.01.20-00.01.55:425] 39]LogOnline:Verbose: STEAM: Aux Server Data (OWNINGID, 90099032094066693)
[2016.01.20-00.01.55:426] 39]LogOnline:Verbose: STEAM: Aux Server Data (OWNINGNAME, 90099032094066693)
[2016.01.20-00.01.55:426] 39]LogOnline:Verbose: STEAM: Aux Server Data (P2PADDR, 90099032094066693)
[2016.01.20-00.01.55:426] 39]LogOnline:Verbose: STEAM: Aux Server Data (P2PPORT, 7777)
[2016.01.20-00.01.55:426] 39]LogOnline:Verbose: STEAM: Aux Server Data (SESSIONFLAGS, 683)
[2016.01.20-00.01.55:426] 39]LogOnline:Verbose: STEAM: Aux Server Data (GameMode_s, TeamDeathmatch)
[2016.01.20-00.01.55:426] 39]LogOnline:Verbose: STEAM: Aux Server Data (MATCHTIMEOUT_f, 120.000000)
[2016.01.20-00.01.55:426] 39]LogOnline:Verbose: STEAM: Aux Server Data (SEARCHKEYWORDS_s, Custom)


[/spoiler]

This is from the ShooterGame Example i tried.
Sadly you can’t host a dedicated Server on the same PC you are trying to play the Game on. So i have no way to test the ServerList right now.
I can do that tomorrow with a friend though.

But in the meantime you can change the bool and do this yourself.
This is the code i added to the Session class of the ShooterGame:



void AShooterGameSession::RegisterServer()
{
	UE_LOG(LogTemp, Warning, TEXT("Trying to register Server!"));

	IOnlineSubsystem* const OnlineSub = IOnlineSubsystem::Get();
	if (OnlineSub)
	{
		IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
		if (Sessions.IsValid())
		{
			UE_LOG(LogTemp, Warning, TEXT("Trying to register Server! Session Valid"));

			HostSettings = MakeShareable(new FShooterOnlineSessionSettings(false, false, 2));

			HostSettings->Set(SETTING_GAMEMODE, FString("TeamDeathmatch"), EOnlineDataAdvertisementType::ViaOnlineService);
			HostSettings->Set(SETTING_MAPNAME, FString("Sanctuary"), EOnlineDataAdvertisementType::ViaOnlineService);
			HostSettings->Set(SETTING_MATCHING_HOPPER, FString("TeamDeathmatch"), EOnlineDataAdvertisementType::DontAdvertise);
			HostSettings->Set(SETTING_MATCHING_TIMEOUT, 120.0f, EOnlineDataAdvertisementType::ViaOnlineService);
			HostSettings->Set(SETTING_SESSION_TEMPLATE_NAME, FString("GameSession"), EOnlineDataAdvertisementType::DontAdvertise);
			HostSettings->Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineDataAdvertisementType::ViaOnlineService);

			HostSettings->bIsDedicated = true;

			OnCreateSessionCompleteDelegateHandle = Sessions->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);

			Sessions->CreateSession(0, GameSessionName, *HostSettings);
	
		}

		UE_LOG(LogTemp, Warning, TEXT("Trying to register Server! OnlineSub Valid"));
	}
}


But now i will go to bed. Have good one.

@eXi:

We highy appreciate your time. You have been very helpful so far.
The dedicated server logs are now yeilding the same results as yours. However, the dedicated server still isn’t listed in the Steam master server.

We managed to get a connection with a listen server (hooray!) but dedicated server still isn’t working. When searching for sessions, listen server is now found but dedicated still isn’t.
Something may be missing here, but it looks like we could be close to a solution, maybe.

Hey, yes it might be that the GameTags and GameData are overflowting. I made a change to the OnlineSearchSettings class that fixes that (also handed over by maide) but i had no time testing it till now. Will report back.

RIP Unreal Engine 4 dedicated server. Is staff too busy to look into this?

At least the engine supports HD dwarves.

@eXi:
K3raI0cXTkzNC.gif

Nice find out :slight_smile:

Well UE4 Supports Dedicated Servers too. It’s just the interface between Steam and UE4 that is misleading here.

Most companies have no problem fixing these small issues by looking into the code. It’s not like Epic needs to do
everything for us. A bit coding here and there is needed of course. That’s why we have an open source Engine. :stuck_out_tongue:

Just be a bit more patient. I heard someone is working on a plugin to make this easier.

I tried with the code of eXi and maide inside the engine (taken by Unreal Slackers chat group), and now I can join a dedicated server via “open IP:Port” command with Steam. The server is listed on the Steam master server, but I can’t find sessions for the game, and I can’t join via the Steam “Connect to server” command.

Are you creating a server session?

Are you registering the server session with Steam?

Are you registering the players with the session?

Yeah we use the Register Server function to create a non presence session for the Server.
It’s not listed sadly. I was told to wait for a plugin release, because it’s tricky to get it working.

Any ETA on that? We can wait, but I hope it’s not a question of months as 7000 people are already waiting.

Not listed?
As in, Steam Client -> Servers or Find Sessions failed?

Find Sessions is failing, but Steam Client -> Servers is working.