C++ Issues & multiplayer

The reason why I’m using a source build of the engine is cuz I’m trying to develop a dedicated server for multiplayer. According to the Unreal documentation on setting up a dedicated server Setting Up Dedicated Servers | Unreal Engine Documentation On the requirements list it says “You must be using a source build of Unreal Engine” I don’t have any plans to work on consoles or making engine changes. My plan right now is just personal computers.

Though many of my issues I posted earlier are cleared up, I am running into another issue. I decided to stop doing the above tutorial because I was running into issues with setting up the short cut to access the server map. I tried 2 different Youtube tutorials on setting up a dedicated server. In both tutorials my short cuts failed even though my syntax was identical to theirs. Every time it said invalid path.

To by pass this issue I decided to start doing the Unreal dedicated server tutorial: https://docs.unrealengine.com/en-US/…ers/index.html The problem arises at this point in the tutorial. It says…

  1. In the Solution Explorer, unfold the Source folder and locate the [Project].Target.cs file. This is the default build target for your project. There is also a [Project]Editor.Target.cs file for configuring how the Unreal Editor builds for this project. We will create the server build target in this same directory.
  2. Open the Source folder in Windows Explorer. Create a copy of [ProjectName].Target.cs and rename it [ProjectName]Server.Target.cs. Here, the resulting file is called TestProjectServer.Target.cs.
  3. Return to Visual Studio, then click and drag *Server.Target.cs from your Explorer window into the Source folder in the Solution Explorer.
  4. Open [ProjectName]Server.Target.cs and replace its contents with the following target file instructions:

using UnrealBuildTool; using System.Collections.Generic;

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

Warning: Be sure to replace all instances of TestProject with the name of your own project.
5. Locate the .uproject file for your project in its base directory, then right-click it and select Generate Visual Studio Project Files. This will regenerate the Visual Studio solution for your game, and it will discover your *Server.Target.cs file.

I replace the old code with the above code in the file TestProjectServer.Target.cs, and then I click generate visual studio files. After this though, I get this error message:

Failed to Generate Files
Running C:/UnrealEngine-4.24.1-release/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“C:/TestProject/TestProject.uproject” -game -engine -progress -log=“C:\TestProject/Saved/Logs/UnrealVersionSelector-2020.09.01-20.55.48.log”
Discovering modules, targets and source code for project…
While compiling C:\TestProject\Intermediate\Build\BuildRules\TestProjectModuleRules.dll:
c:\TestProject\Source\TestProjectServer.Target.cs(6,14) : error CS0101: The namespace ‘<global namespace>’ already contains a definition for ‘TestProjectTarget’
ERROR: Unable to compile source files.

I know they say replace line according to the name of your project, but I purposely named my project TestProject to keep things as simple as possible. My code is exactly identical to theirs and yet I’m still getting error messages. It appears VS is getting the original file I copied from TestProject.Target.cs mixed up with the one I renamed TestProjectServer.Target.cs. I even experimented with changing the name of the class TestProjectServerTarget to a different name such as TestProjectServer or TestProject. No dice, the same error message pops up when I go to generate.

Do you have any idea why its refusing my class name? Or if as you suggested, is there an easier way to set up a dedicated server without having to use the source code? So far it feels like a slow trudge dealing with all this source code and C++. I just barely know the basics of C++. I’d gladly purchase an asset on the Unreal store if I could easily bypass all this nonsense.