I am trying to package the game which has PushModel enabled. I included necessary directives:
Game.Build.cs:
public Game(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
CppStandard = CppStandardVersion.Cpp20;
bUseRTTI = true;
PublicDependencyModuleNames.AddRange(new string[]
{
"Core", **"NetCore"**, ...
});
...
Game.Target.cs:
public GameTarget(TargetInfo Target) : base(Target)
{
bOverrideBuildEnvironment = true;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V4;
bEnableCppCoroutinesForEvaluation = true;
**bWithPushModel = true;**
ExtraModuleNames.AddRange(new string[] { "TrialByCombat", "Coroutine" });
}
DefaultEngine.ini
[SystemSettings]
net.UseAdaptiveNetUpdateFrequency=1
**net.IsPushModelEnabled=1**
net.PushModelSkipUndirtiedReplication=1
Still I get error:
TBCPlayerController.cpp.obj : error LNK2001: unresolved external symbol “void __cdecl UEPushModelPrivate::MarkPropertyDirty(class UObject const *,struct UEPushModelPrivate::FNetPushObjectId,int)” (?MarkPropertyDirty@UEPushModelPrivate@@YAXPEBVUObject@@UFNetPushObjectId@1@H@Z)
TBCPlayerController.h:
...
UPROPERTY(Replicated)
mutable TScriptInterface<IPlayerInterface> PlayerInterface;
UPROPERTY(Replicated)
FGameplayAbilitySpecHandle ChannelingAbilityHandle;
...
TBCPlayerController.cpp:
#include "Net/UnrealNetwork.h"
#include "Net/Core/PushModel/PushModel.h"
void ATBCPlayerController::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
FDoRepLifetimeParams Params;
Params.bIsPushBased = true;
Params.Condition = COND_OwnerOnly;
Params.RepNotifyCondition = REPNOTIFY_OnChanged;
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, ChannelingAbilityHandle, Params);
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, PlayerInterface, Params);
}
void ATBCPlayerController::OnPossess(APawn* InPawn)
{
...
MARK_PROPERTY_DIRTY_FROM_NAME(ThisClass, PlayerInterface, this);
...
}
My toolchain version:
Using Visual Studio 2022 14.40.33808 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10)
I tried deleting Binaries, Saved and Build folders and rebuilding, didn’t work.
What am I doing wrong?