Macro in server target is not setting Steam game name

I have two games (Sarlack & Plexus) and bought two Steam AppIds.

I have been trying to get the games to work over the internet. I see them on the Steam Server’s LAN tab but not on the Internet tab.

I have the Steam info in the *Server.Target.cs for the games. The ProjectDefinitions.Add() is not adding the name to the macro in OnlineSessionAsyncServerSteam.cpp. The name remains “Unreal Test!”

I believe this is why the game is not showing on the Internet tab because the name has to match what is set in the Steamworks’ Dedicated Server section.

On my 1st game I got it to work by adding the game name directly to “UE5_Release\Engine\Plugins\Online\OnlineSubsystemSteam\Source\Private\OnlineSessionAsyncServerSteam.cpp”

I reverted the OnlineSessionAsyncServerSteam.cpp file back to it’s original to undo my changes (I don’t like to edit engine files if I can help it). Strangely now when I package the the 1st game’s server the name is still being correctly set to the macro and I can see the game on the Steam Internet tab.

So I wanted to see if I could get the 2nd game to work and the name still remains “Unreal Test!”.

Why is the *Server.Target.cs not setting the macros? I’m I missing something or is it a bug?

I think I solved the issue.

In the *Server.Target.cs I was using…
ProjectDefinitions.Add("***");

I switched it to…
GlobalDefinitions.Add("***");

It is working with GlobalDefinitions.Add()

I’m guessing that since the macros are located in the OnlineSubsystemSteam plugin which is part of the engine, ProjectDefinitions is not able to set the macros there.

I will test further to make sure it works consistently.

EDIT:
I tested it and it works.
I have three target files (I’m not sure if the macros need to be added to editor target)…

Use ProjectDefinitions.Add("***") for editor target or it will not compile in Visual Studio
*Editor.Target.cs

Use GlobalDefinitions.Add("***") for game and server targets
*Server.Target.cs
*.Target.cs

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.