Dedicated server with Steam is a joke

Oh? You can see the Server in the Online section of the Steam Client Server browser? Because that’s something that
did not work for me. :X

Did you use my exact code or added/removed something?

Maybe i can work with your current client log.

Yes, I can see the server in the online section of the Steam Client Server browser. I used your code without adding or removing anything. The problem is that I can’t find any session.
Now I’m attempting to authenticate a player to see if he’s got Steam when he joins the server, because if someone has got Subsystem Null on his client, he can join a Steam server without any problem.

I did this under the Login function in the GameMode class:


IOnlineSubsystem* OSub = IOnlineSubsystem::Get(FName("Steam"));
	bool bLoginStatus = OSub->GetIdentityInterface()->AutoLogin(0);
	if (!OSub || !bLoginStatus)
	{
		ErrorMessage = TEXT("Steam authentication failed");
		return false;
	}
	else
	{
		UE_LOG(LogOnline, Warning, TEXT("Authentication succeful"));
	}

but it’s returning always false. How can I check if the player has got the game on Steam, and if true, let him join the game, else if false, kick him?

If you show me the Clients Log with Verbose logging on, i can see why the Client does not get the Sessions.

For the Steam Auth problem i would suggest checking out the Steam Documentation and asking in the Steamworks boards.

Scienziatogm, Sounds like you have a setting`s mismatch when searching for sessions.
I had this same issue and i solved it by making sure you set the same settings related to pressence.

Take a look at this snippet of code from RegisterServer() method i can confirm is working.
You want a way for the end user can change some of these but try these settings as i know they work.


SessionSettings->bAllowInvites = true;
SessionSettings->bUsesPresence = false;
SessionSettings->bAllowJoinInProgress = true;
SessionSettings->bAllowJoinViaPresence = true;
SessionSettings->bAllowJoinViaPresenceFriendsOnly = false;
SessionSettings->bAntiCheatProtected = true;
SessionSettings->bIsLANMatch = false;
SessionSettings->bIsDedicated = true;
SessionSettings->bShouldAdvertise = true;
SessionSettings->NumPublicConnections = 10;
SessionSettings->NumPrivateConnections = 0;

In your Find Session method:


// NB: We only want to set this Query Setting if "bIsPresence" is true
if (bIsPresence)
{
	GameInstance->SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, bIsPresence, EOnlineComparisonOp::Equals);
}

Note the comment from .
You can use wiki as a base i have done very few modification`s to my implementation.

Hope it helps.

Yes, I’m trying to turn off the presence in FindSessions to see if it gets some results, but with compilations and similiar things, I’m losing a lot of time, and before saying “It works”, I want to test. If I find something in the Find Sessions, I’ll write . Anyway the real problem is the Steam authentication, because everyone can join with subsystem null in a Steam server. Now I’m trying to implement the Steam authentication system in the engine code (Auth tickets sent from client to the server and checks on their validity on the server), and if it works, I’ll do a pull request. Unfortunately Epic Games isn’t paying much attention at Steam.

EDIT: Ok, I found the session. I didn’t set the GameInstance class in the config file, so the cast was failing, and I couldn’t call the FindSessions function. The problem is that it’s returning only the P2P Address, and not the Host IP Address, but I’ll try to solve this. The important thing is that the session was found.

Glad it helped out and you now can find the session.
About the authentication you want to check out doc`s .

Better this: User Authentication and Ownership (Steamworks Documentation)

Sooo… you can host, find AND join the Dedicated Server now?

If yes, could you share the code around all those steps + source changes if you did any?

I must finish the Steam authentication system before releasing any change, because now players can join, but they aren’t authenticated. I’m doing these things in the engine code, so I have to wait 600+ actions to compile succefully.

any updates?

The authentication is done and now it’s working. Now I’m finishing the menu so I can see if the session system is working properly with Steam.

Well said Kris and a good source of resources as well.

Hey mate, it’s been a while. How’s the project going? Would still love to see some sort of wiki entry by you, so i and other people could actually learn what you had to do to get all
that Dedicated Server + Steam stuff to work. (:

I am with on this one, and the community worked really hard to help out, would be lovely to hear the full story of how you got it working so many others can benefit and this thread will serve many for years to come.

:slight_smile:

I’ll do a pull request on the Unreal Engine repository, and then a wiki post. Basically I added a variable on the GameMode (bUseAuthentication) that if is set to true, enables the Steam authentication code.
I didn’t it because I wanted to do a complete system well coded, but now I’ll do this pull request, so anyone that wants to have a workaround to the Steam authentication, can have it.

It’s not only about the Authentification. The Dedicated Server part is at least as important and interesting as the Auth part :stuck_out_tongue:

Pull request done : https://github.com/EpicGames/UnrealEngine/pull/2135

Now I’ll work on the wiki article.

EDIT: I saw that my pull request isn’t updated to the latest version of the engine. Now I’m updating it.

You should do the PullRequest to the Master branch. :stuck_out_tongue:

I’ll do that tomorrow maybe. Now I updated the code to work with the release branch.

EDIT: @ did it in release branch (https://github.com/EpicGames/UnrealEngine/pull/2134)

I highly recommend that.

:stuck_out_tongue: