No server.build.cs file when making a dedicated server?

So I was told I should have a projectname.server.build.cs file in my source folder after packaging my dedicated server.

My dedicated server is working, package works and it runs fine, but I cannot find that file anywhere and need it so I can input some steam settings to get my servers to show up in game.

Has anyone ever heard of this happening / have any ideas about it?

Thanks for any help anyone may be able to lend

build.cs files are for defining a code module, I’ve never made one for my servers. Are you looking for ProjectNameServer.Target.cs? That’s the file that defines a build target which you need for a dedicated server. It should in your source directory next to ProjectNameEditor.Target.cs and ProjectName.Target.cs

If it is something you need to add to a .build.cs file, you should be able to add it to your ProjectName.Build.cs which will be in Source/ProjectName/

Thank you for the response GrumbleBunny!. I did indeed look at my projectname.build.cs file, but when I inputted the lines needed there was a packaging error when I try to re-package it as a server.

error CS0103: The name ‘GlobalDefinitions’ does not exist in the current context.

Lines I added:

    GlobalDefinitions.Add("UE4_PROJECT_STEAMSHIPPINGID = 480");
    GlobalDefinitions.Add("UE4_PROJECT_STEAMPRODUCTNAME = \"TestName\"");
    GlobalDefinitions.Add("UE4_PROJECT_STEAMGAMEDIR = \"xxx\"");
    GlobalDefinitions.Add("UE4_PROJECT_STEAMGAMEDESC = \"Test Game Desc\"");

I have the servers working otherwise, just they never show up in-game in the server browser, Only in the steam server browser. So was told this would help but maybe thats the wrong information?

Nonetheless thank you for your assistance.

Where did you put those lines in the file?

I put them in my projectnameserver.target.cs file

Theyre in the second section of the file.

Blockquote

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class SCPFFServerTarget : TargetRules //Change this line according to the name of your project
{
public SCPFFServerTarget(TargetInfo Target) : base(Target) //Change this line according to the name of your project
{
Type = TargetType.Server;
DefaultBuildSettings = BuildSettingsVersion.V2;
ExtraModuleNames.Add(“testgame”); //Change this line according to the name of your project

    GlobalDefinitions.Add("UE4_PROJECT_STEAMSHIPPINGID = 1425660");
    GlobalDefinitions.Add("UE4_PROJECT_STEAMPRODUCTNAME = \"testgame\"");
    GlobalDefinitions.Add("UE4_PROJECT_STEAMGAMEDIR = \"xxx\"");
    GlobalDefinitions.Add("UE4_PROJECT_STEAMGAMEDESC = \"Test Game Desc\"");

}

}

I now just get this error though when building the game in VS"

It seems its thinking those GlobalDefintions are references to files oddly.