Skip to content

Commit 1897f7d

Browse files
authored
Merge pull request #84 from hxhb/dev
v81.0
2 parents 6071309 + cafe6e4 commit 1897f7d

24 files changed

+327
-182
lines changed

HotPatcher/Source/CmdHandler/Private/CmdHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool AddMultiCookerBackendToConfig(const FString& DDCAddr)
4646
{
4747
Section->Remove(*Key);
4848
}
49-
UE_LOG(LogCmdHandler, Display, TEXT("Override Section MultiCookerDDC key: %s to %d."),*Key,*Value);
49+
UE_LOG(LogCmdHandler, Display, TEXT("Override Section MultiCookerDDC key: %s to %s."),*Key,*Value);
5050
Section->Add(*Key,FConfigValue(*Value));
5151
};
5252

@@ -57,7 +57,7 @@ bool AddMultiCookerBackendToConfig(const FString& DDCAddr)
5757
UpdateKeyLambda(MultiCookerDDCBackendSection,TEXT("Boot"),TEXT("(Type=Boot, Filename=\"%GAMEDIR%DerivedDataCache/Boot.ddc\", MaxCacheSize=512)"));
5858

5959
FString DDC = FString::Printf(
60-
TEXT("(Type=FileSystem, ReadOnly=false, Clean=true, Flush=false, DeleteUnused=false, UnusedFileAge=10, FoldersToClean=10, MaxFileChecksPerSec=1, Path=%s, EnvPathOverride=UE-SharedDataCachePath, EditorOverrideSetting=SharedDerivedDataCache)"),
60+
TEXT("(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, DeleteUnused=false, UnusedFileAge=10, FoldersToClean=10, MaxFileChecksPerSec=1, Path=%s, EnvPathOverride=UE-SharedDataCachePath, EditorOverrideSetting=SharedDerivedDataCache)"),
6161
*DDCAddr
6262
);
6363
UpdateKeyLambda(MultiCookerDDCBackendSection,TEXT("Shared"),DDC);

HotPatcher/Source/HotPatcherCore/Classes/Commandlets/CommandletHelper.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,17 @@ TArray<FString> CommandletHelper::GetCookCommandletTargetPlatformName()
182182

183183
return result;
184184
}
185+
186+
187+
void CommandletHelper::ModifyTargetPlatforms(const FString& InParams,const FString& InToken,TArray<ETargetPlatform>& OutTargetPlatforms,bool Replace)
188+
{
189+
TArray<ETargetPlatform> TargetPlatforms = CommandletHelper::ParserPlatforms(InParams,InToken);
190+
if(TargetPlatforms.Num())
191+
{
192+
if(Replace){
193+
OutTargetPlatforms = TargetPlatforms;
194+
}else{
195+
for(ETargetPlatform Platform:TargetPlatforms){ OutTargetPlatforms.AddUnique(Platform); }
196+
}
197+
}
198+
};

HotPatcher/Source/HotPatcherCore/Classes/Commandlets/Cooker/HotSingleCookerCommandlet.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ int32 UHotSingleCookerCommandlet::Main(const FString& Params)
3434
TMap<FString, FString> KeyValues = THotPatcherTemplateHelper::GetCommandLineParamsMap(Params);
3535
THotPatcherTemplateHelper::ReplaceProperty(*ExportSingleCookerSetting, KeyValues);
3636

37+
CommandletHelper::ModifyTargetPlatforms(Params,TARGET_PLATFORMS_OVERRIDE,ExportSingleCookerSetting->CookTargetPlatforms,true);
3738
if(ExportSingleCookerSetting->bDisplayConfig)
3839
{
3940
FString FinalConfig;

HotPatcher/Source/HotPatcherCore/Classes/Commandlets/HotPatcherCommandlet.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ int32 UHotPatcherCommandlet::Main(const FString& Params)
4040
bool bExportStatus = false;
4141
if (FFileHelper::LoadFileToString(JsonContent, *config_path))
4242
{
43-
44-
if(IsRunningCommandlet())
43+
if(IsRunningCommandlet() && !FParse::Param(FCommandLine::Get(), TEXT("NoSearchAllAssets")))
4544
{
45+
SCOPED_NAMED_EVENT_TEXT("SearchAllAssets",FColor::Red);
4646
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
4747
AssetRegistryModule.Get().SearchAllAssets(true);
4848
}
@@ -63,6 +63,7 @@ int32 UHotPatcherCommandlet::Main(const FString& Params)
6363
ExportPatchSetting->PakTargetPlatforms.AddUnique(Platform);
6464
}
6565
}
66+
CommandletHelper::ModifyTargetPlatforms(Params,TARGET_PLATFORMS_OVERRIDE,ExportPatchSetting->PakTargetPlatforms,true);
6667
ExportPatchSetting->GetAssetScanConfigRef().AssetIncludeFilters.Append(CommandletHelper::ParserPatchFilters(Params,TEXT("AssetIncludeFilters")));
6768
ExportPatchSetting->GetAssetScanConfigRef().AssetIgnoreFilters.Append(CommandletHelper::ParserPatchFilters(Params,TEXT("AssetIgnoreFilters")));
6869

HotPatcher/Source/HotPatcherCore/HotPatcherCore.Build.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public HotPatcherCore(ReadOnlyTargetRules Target) : base(Target)
6161
"InputCore",
6262
"CoreUObject",
6363
"Engine",
64-
"Sockets"
64+
"Sockets",
65+
"DerivedDataCache"
6566
// ... add private dependencies that you statically link with here ...
6667
}
6768
);
@@ -189,8 +190,8 @@ public HotPatcherCore(ReadOnlyTargetRules Target) : base(Target)
189190
PublicDefinitions.AddRange(new string[]
190191
{
191192
"TOOL_NAME=\"HotPatcher\"",
192-
"CURRENT_VERSION_ID=80",
193-
"CURRENT_PATCH_ID=1",
193+
"CURRENT_VERSION_ID=81",
194+
"CURRENT_PATCH_ID=0",
194195
"REMOTE_VERSION_FILE=\"https://imzlp.com/opensource/version.json\""
195196
});
196197
}

HotPatcher/Source/HotPatcherCore/Private/Cooker/MultiCooker/SingleCookerProxy.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ void USingleCookerProxy::ExecCookCluster(const FCookCluster& CookCluster)
281281
{
282282
SCOPED_NAMED_EVENT_TEXT("ExecCookCluster",FColor::Red);
283283

284+
// for GC
285+
{
286+
UE_LOG(LogHotPatcher,Display,TEXT("ExecuteCookCluster Try GC..."));
287+
GEngine->ForceGarbageCollection(false);
288+
CollectGarbage(RF_NoFlags, false);
289+
}
290+
284291
CookedClusterCount++;
285292
UE_LOG(LogHotPatcher,Display,TEXT("ExecuteCookCluster %d with %d assets, total cluster %d"),CookedClusterCount,CookCluster.AssetDetails.Num(),ClusterCount);
286293

@@ -372,11 +379,7 @@ void USingleCookerProxy::ExecCookCluster(const FCookCluster& CookCluster)
372379
// CleanClusterCachedPlatformData(CookCluster);
373380
UFlibShaderCodeLibraryHelper::WaitShaderCompilingComplete();
374381
UFlibHotPatcherCoreHelper::WaitForAsyncFileWrites();
375-
// for GC
376-
{
377-
GEngine->ForceGarbageCollection(true);
378-
CollectGarbage(RF_NoFlags, true);
379-
}
382+
UFlibHotPatcherCoreHelper::WaitDDCComplete();
380383
}
381384

382385
void USingleCookerProxy::Tick(float DeltaTime)

0 commit comments

Comments
 (0)