Hi, I have a server development build where I’m loading files from my module. This scenario is working perfectly fine when I run the build from the uproject file. When I run the same from development build I’m getting null reference, means that object is not getting created on the other end.
I’ve added the screenshot of the project. Have a look, I’ve added for both of the scenarios. Below is the package debugging information where you can see OriginalFileName and FileName columns are empty.
And below is the scenario where I run the uproject file. And it works fine in the below condition. I found the reference of the dll.
How should I build project so that my custom module can be used in the package as well.
I’ve added the target.cs files of both of my game packages (one package is server and other is gameclient )
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class VizGame : ModuleRules
{
public VizGame(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
new string[] {
"VizGame/Classes/Player",
"VizGame/Private",
"VizGame/Private/UI",
"VizGame/Private/UI/Menu",
"VizGame/Private/UI/Style",
"VizGame/Private/UI/Widgets",
}
);
PublicDependencyModuleNames.AddRange(
new string[] {
"Core",
"CoreUObject",
"Engine",
"OnlineSubsystem",
"OnlineSubsystemUtils",
"AssetRegistry",
"AIModule",
"GameplayTasks",
"XmlParser",
"UMG",
"VizNetwork",
"Voice",
"CISQLite3",
"Landscape",
}
);
PrivateDependencyModuleNames.AddRange(
new string[] {
"InputCore",
"Slate",
"SlateCore",
"VizGameLoadingScreen",
"Json",
"ProceduralMeshComponent",
"Landscape"
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[] {
"OnlineSubsystemNull",
"NetworkReplayStreaming",
"NullNetworkReplayStreaming",
"HttpNetworkReplayStreaming"
}
);
PrivateIncludePathModuleNames.AddRange(
new string[] {
"NetworkReplayStreaming"
}
);
if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac))
{
}
else if (Target.Platform == UnrealTargetPlatform.PS4)
{
DynamicallyLoadedModuleNames.Add("OnlineSubsystemPS4");
}
else if (Target.Platform == UnrealTargetPlatform.XboxOne)
{
DynamicallyLoadedModuleNames.Add("OnlineSubsystemLive");
}
}
}
and
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class VizGameServerTarget : TargetRules
{
public VizGameServerTarget(TargetInfo Target)
{
Type = TargetType.Server;
//bUsesSteam = true;
}
//
// TargetRules interface.
//
public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatform> OutPlatforms)
{
// It is valid for only server platforms
return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatforms, false);
}
public override void SetupBinaries(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
OutExtraModuleNames.Add("VizGame");
OutExtraModuleNames.Add("VizServer");
OutExtraModuleNames.Add("VizServerNull");
OutExtraModuleNames.Add("VizNetwork");
}
}
Below is the Build.cs files of my Client (VizGame)
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class VizGameTarget : TargetRules
{
public VizGameTarget(TargetInfo Target)
{
Type = TargetType.Game;
bUsesSteam = true;
}
//
// TargetRules interface.
//
public override void SetupBinaries(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
OutExtraModuleNames.Add("VizGame");
OutExtraModuleNames.Add("VizServerNull");
}
public override void SetupGlobalEnvironment(
TargetInfo Target,
ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration,
ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration
)
{
if (Target.Platform == UnrealTargetPlatform.PS4)
{
OutCPPEnvironmentConfiguration.Definitions.Add("GARLIC_HEAP_SIZE=(2600ULL * 1024 * 1024)");
OutCPPEnvironmentConfiguration.Definitions.Add("ONION_HEAP_SIZE=(200ULL * 1024 * 1024)");
OutCPPEnvironmentConfiguration.Definitions.Add("RESERVED_MEMORY_SIZE=(1ULL * 1024 * 1024)");
OutCPPEnvironmentConfiguration.Definitions.Add("LIBC_MALLOC_SIZE=(32ULL * 1024 * 1024)");
OutCPPEnvironmentConfiguration.Definitions.Add("LIBC_MALLOC_SIZE=(32ULL * 1024 * 1024)");
//for a real game these could be behind a call to a virtual function defined in a partial class in a protected folder also.
OutCPPEnvironmentConfiguration.Definitions.Add("UE4_PROJECT_NPTITLEID=NPXX51358_00");
OutCPPEnvironmentConfiguration.Definitions.Add("UE4_PROJECT_NPTITLESECRET=81ae213eafbc64777574955bf921c9be3c60a3bddef70c357d8fe49ad64e0d0402d2249de390174832c5e4098114c93c33705b597cfbe9b1153d58fe9fae1f0de1466daf18ef25d06122cff7c95bde07bc060109e20c865305692dfbf9d7b726460893c4abd86dc9e8fd6b5db7dca4ffd4eefcb1771baccd576109bea862d6d4");
}
}
}
and Server(VizGameServer)
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class VizGameServerTarget : TargetRules
{
public VizGameServerTarget(TargetInfo Target)
{
Type = TargetType.Server;
//bUsesSteam = true;
}
//
// TargetRules interface.
//
public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatform> OutPlatforms)
{
// It is valid for only server platforms
return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatforms, false);
}
public override void SetupBinaries(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
OutExtraModuleNames.Add("VizGame");
OutExtraModuleNames.Add("VizServer");
OutExtraModuleNames.Add("VizServerNull");
OutExtraModuleNames.Add("VizNetwork");
}
}