Skip to content

Commit 6071309

Browse files
hxhblipengzha
andauthored
v80.1 (#77)
* fix 4.27 error * update submodule * optimize impl * support 5.1 * fix 5.1 WP error * optimize impl * optimize impl * optimize impl * optimize impl * optimize impl * update version to v78.1 * fix compile error * update mods * fix shipping error & update version to v79.0 * split ByGameFeature as GameFeaturePacker * add ShaderPatcher Mod * optimize mod * delete GameFeature Mod * add GameFeaturePacker Mod * add HDiffPatchUE Mod * update version to v80 * optimize impl * fix Property Category issue * update Mod * update Mods * support UE5.1 * update Mods commit * Update UpdaterWidget * optimize Mod impl * update Updater * fix Localization key dumplicate * remove GameFeaturePacker * add GameFeaturePacker Mod * update Mods * optimize mod impl * rm ShaderPacther Mod * add ShaderPatcher Mod * delete mod * add ShaderPatcherUE Mod * fix -ddcurl= issue * update Mods * optimize CmdHandler/MultiCooker * update MultiCooker Mod * optimize DDC Backend Hierarchy * update * update mods * add PakAnalyzerUE Mod * UpdateMods * optimize impl * add submodule * update * fix multi-thread assetparser issue * optimize impl * fix ushaderbytecode ignore issue * 1. 修复TargetPlatform注册时机晚于CDO的问题 2. 支持获取参与打包的资源列表 3. 修复PackageTracker的资源没有进包的问题(PackageTracker的资源会进行ForceSkip检测) * update submodule * optimize/fix forceskip directory/asset issue * fix issue * update submodule * support override property by cmdlet * optimize impl * update version to v80.1 --------- Co-authored-by: lipengzha <lipengzha@tencent.com>
1 parent 78203c7 commit 6071309

27 files changed

+250
-69
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919
[submodule "Mods/ShaderPatcherUE"]
2020
path = Mods/ShaderPatcherUE
2121
url = git@github.com:hxhb/ShaderPatcherUE.git
22+
[submodule "Mods/PakAnalyzerUE"]
23+
path = Mods/PakAnalyzerUE
24+
url = git@github.com:hxhb/PakAnalyzerUE.git

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,4 @@ TArray<FString> CommandletHelper::GetCookCommandletTargetPlatformName()
181181
}
182182

183183
return result;
184-
}
184+
}

HotPatcher/Source/HotPatcherCore/HotPatcherCore.Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public HotPatcherCore(ReadOnlyTargetRules Target) : base(Target)
190190
{
191191
"TOOL_NAME=\"HotPatcher\"",
192192
"CURRENT_VERSION_ID=80",
193-
"CURRENT_PATCH_ID=0",
193+
"CURRENT_PATCH_ID=1",
194194
"REMOTE_VERSION_FILE=\"https://imzlp.com/opensource/version.json\""
195195
});
196196
}

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,15 @@ FCookCluster USingleCookerProxy::GetPackageTrackerAsCluster()
603603
PackageTrackerCluster.AssetDetails.Empty();
604604
for(FName LongPackageName:PackageTracker->GetPendingPackageSet())
605605
{
606+
if(!FPackageName::DoesPackageExist(LongPackageName.ToString()))
607+
{
608+
continue;
609+
}
610+
606611
// make asset data to asset registry
607-
FSoftObjectPath ObjectPath(
608-
UFlibAssetManageHelper::LongPackageNameToPackagePath(LongPackageName.ToString())
609-
);
612+
FString PackagePath = UFlibAssetManageHelper::LongPackageNameToPackagePath(LongPackageName.ToString());
613+
614+
FSoftObjectPath ObjectPath(PackagePath);
610615
UFlibAssetManageHelper::UpdateAssetRegistryData(ObjectPath.GetLongPackageName());
611616

612617
FAssetData AssetData;

HotPatcher/Source/HotPatcherCore/Private/CreatePatch/PatcherProxy.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ namespace PatchWorker
504504
{
505505
for(auto& Chunk:Context.PakChunks)
506506
{
507-
FString SavePath = FPaths::Combine(Context.GetSettingObject()->GetSaveAbsPath(),Context.CurrentVersion.VersionId,TEXT("Metadatas"),Chunk.ChunkName,PlatformName);
507+
FString SavePath = FPaths::Combine(Context.GetSettingObject()->GetSaveAbsPath(),Context.CurrentVersion.VersionId,PlatformName,TEXT("Metadatas"),PlatformName,TEXT("Metadata/ShaderLibrarySource"));
508508
TArray<FString> FoundShaderLibs = UFlibShaderCodeLibraryHelper::FindCookedShaderLibByPlatform(PlatformName,SavePath);
509509

510510
if(Context.PakChunks.Num())
@@ -563,7 +563,8 @@ namespace PatchWorker
563563
);
564564

565565
const TArray<FAssetDetail>& ChunkAssets = ChunkAssetsDescrible.Assets.GetAssetDetails();
566-
566+
Context.PatchProxy->GetPatcherResult().PatcherAssetDetails.Append(ChunkAssets);
567+
567568
if(Context.GetSettingObject()->IsCookPatchAssets())
568569
{
569570
FTrackPackageAction TrackChunkPackageAction(Context,Chunk,TArray<ETargetPlatform>{Platform});
@@ -605,6 +606,22 @@ namespace PatchWorker
605606
SingleCookerProxy->AddToRoot();
606607
SingleCookerProxy->Init(&EmptySetting);
607608
bool bExportStatus = SingleCookerProxy->DoExport();
609+
const FCookCluster& AdditionalCluster = SingleCookerProxy->GetPackageTrackerAsCluster();
610+
for(const auto& AssetDetail:AdditionalCluster.AssetDetails)
611+
{
612+
FSoftObjectPath ObjectPath{AssetDetail.PackagePath};
613+
FString ReceiveReason;
614+
if(!Context.GetSettingObject()->GetAssetScanConfig().IsMatchForceSkip(ObjectPath,ReceiveReason))
615+
{
616+
Context.PatchProxy->GetPatcherResult().PatcherAssetDetails.Add(AssetDetail);
617+
Context.VersionDiff.AssetDiffInfo.AddAssetDependInfo.AddAssetsDetail(AssetDetail);
618+
}
619+
else
620+
{
621+
UE_LOG(LogHotPatcher,Display,TEXT("[PackageTracker] %s Match ForceSkipRule,Reason %s"),*ObjectPath.GetLongPackageName(),*ReceiveReason);
622+
}
623+
}
624+
608625
SingleCookerProxy->Shutdown();
609626
SingleCookerProxy->RemoveFromRoot();
610627
}

HotPatcher/Source/HotPatcherCore/Private/FlibHotPatcherCoreHelper.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "Serialization/ArrayWriter.h"
2828
#include "Settings/ProjectPackagingSettings.h"
2929
#include "ShaderCompiler.h"
30+
#include "Async/ParallelFor.h"
3031
#include "CreatePatch/PatcherProxy.h"
3132
#include "Materials/MaterialInstance.h"
3233
#include "Materials/MaterialInstanceConstant.h"
@@ -1199,10 +1200,10 @@ FPatchVersionDiff UFlibHotPatcherCoreHelper::DiffPatchVersionWithPatchSetting(co
11991200

12001201
if(PatchSetting.IsForceSkipContent())
12011202
{
1202-
TArray<FString> AllSkipContents;
1203-
AllSkipContents.Append(UFlibAssetManageHelper::DirectoriesToStrings(PatchSetting.GetForceSkipContentRules()));
1204-
AllSkipContents.Append(UFlibAssetManageHelper::SoftObjectPathsToStrings(PatchSetting.GetForceSkipAssets()));
1205-
UFlibPatchParserHelper::ExcludeContentForVersionDiff(VersionDiffInfo,AllSkipContents);
1203+
TArray<FString> AllSkipDirContents = UFlibAssetManageHelper::DirectoriesToStrings(PatchSetting.GetForceSkipContentRules());
1204+
UFlibPatchParserHelper::ExcludeContentForVersionDiff(VersionDiffInfo,AllSkipDirContents,EHotPatcherMatchModEx::StartWith);
1205+
TArray<FString> AllSkipAssets = UFlibAssetManageHelper::SoftObjectPathsToStrings(PatchSetting.GetForceSkipAssets());
1206+
UFlibPatchParserHelper::ExcludeContentForVersionDiff(VersionDiffInfo,AllSkipAssets,EHotPatcherMatchModEx::Equal);
12061207
}
12071208
// clean deleted asset info in patch
12081209
if(PatchSetting.IsIgnoreDeletedAssetsInfo())
@@ -1620,8 +1621,9 @@ void UFlibHotPatcherCoreHelper::AppendPakCommandOptions(TArray<FString>& OriginC
16201621
const TArray<FString>& Options, bool bAppendAllMatch, const TArray<FString>& AppendFileExtersions,
16211622
const TArray<FString>& IgnoreFormats, const TArray<FString>& InIgnoreOptions)
16221623
{
1623-
for(auto& Command:OriginCommands)
1624+
ParallelFor(OriginCommands.Num(),[&](int32 index)
16241625
{
1626+
FString& Command = OriginCommands[index];
16251627
FString PakOptionsStr;
16261628
for (const auto& Param : Options)
16271629
{
@@ -1640,7 +1642,7 @@ void UFlibHotPatcherCoreHelper::AppendPakCommandOptions(TArray<FString>& OriginC
16401642
PakOptionsStr += AppendOptionStr;
16411643
}
16421644
Command = FString::Printf(TEXT("%s%s"),*Command,*PakOptionsStr);
1643-
}
1645+
});
16441646
}
16451647

16461648
FProjectPackageAssetCollection UFlibHotPatcherCoreHelper::ImportProjectSettingsPackages()

HotPatcher/Source/HotPatcherCore/Public/CommandletBase/CommandletHelper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ namespace CommandletHelper
2626
HOTPATCHERCORE_API bool IsCookCommandlet();
2727
HOTPATCHERCORE_API TArray<ETargetPlatform> GetCookCommandletTargetPlatforms();
2828
HOTPATCHERCORE_API TArray<FString> GetCookCommandletTargetPlatformName();
29-
3029
}

HotPatcher/Source/HotPatcherCore/Public/CreatePatch/PatcherProxy.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ using FPatchWorkers = TMap<FString,FPatchWorkerType>;
2323
DECLARE_MULTICAST_DELEGATE_FourParams(FOnPakListGenerated,FHotPatcherPatchContext&,FChunkInfo&,ETargetPlatform,TArray<FPakCommand>&);
2424
DECLARE_MULTICAST_DELEGATE_FourParams(FAddPatchWorkerEvent,FHotPatcherPatchContext&,FChunkInfo&,ETargetPlatform,TArray<FPakCommand>&);
2525

26+
27+
USTRUCT()
28+
struct HOTPATCHERCORE_API FPatherResult
29+
{
30+
GENERATED_BODY()
31+
UPROPERTY()
32+
TArray<FAssetDetail> PatcherAssetDetails;
33+
};
34+
2635
UCLASS()
2736
class HOTPATCHERCORE_API UPatcherProxy:public UHotPatcherProxyBase
2837
{
@@ -40,11 +49,14 @@ class HOTPATCHERCORE_API UPatcherProxy:public UHotPatcherProxyBase
4049
PatchWorkers.Add(WorkerName,Worker);
4150
}
4251
FORCEINLINE const FPatchWorkers& GetPatchWorkers()const{ return PatchWorkers; }
52+
FORCEINLINE FPatherResult& GetPatcherResult(){ return PatcherResult; }
53+
4354
public:
4455
FOnPakListGenerated OnPakListGenerated;
45-
56+
4657
protected:
4758
FPatchWorkers PatchWorkers;
4859
private:
4960
TSharedPtr<FHotPatcherPatchContext> PatchContext;
61+
FPatherResult PatcherResult;
5062
};

HotPatcher/Source/HotPatcherEditor/Private/HotPatcherEditor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ void FHotPatcherEditorModule::OpenDockTab()
166166

167167
void FHotPatcherEditorModule::PluginButtonClicked()
168168
{
169-
if(!DockTab.IsValid())
169+
if (!DockTab.IsValid())
170170
{
171171
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(HotPatcherTabName, FOnSpawnTab::CreateRaw(this, &FHotPatcherEditorModule::OnSpawnPluginTab))
172-
.SetDisplayName(LOCTEXT("FHotPatcherTabTitle", "HotPatcher"))
173-
.SetMenuType(ETabSpawnerMenuType::Hidden);
172+
.SetDisplayName(LOCTEXT("FHotPatcherTabTitle", "HotPatcher"))
173+
.SetMenuType(ETabSpawnerMenuType::Hidden);
174174
}
175175
FGlobalTabmanager::Get()->InvokeTab(HotPatcherTabName);
176176
}

HotPatcher/Source/HotPatcherRuntime/Private/BaseTypes/AssetManager/FAssetDependenciesInfo.cpp

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ bool FAssetDependenciesInfo::HasAsset(const FString& InAssetPackageName)const
4242
TArray<FAssetDetail> FAssetDependenciesInfo::GetAssetDetails()const
4343
{
4444
SCOPED_NAMED_EVENT_TEXT("FAssetDependenciesInfo::GetAssetDetails",FColor::Red);
45-
TArray<FAssetDetail> OutAssetDetails;
4645

47-
OutAssetDetails.Empty();
46+
TArray<FAssetDetail> AssetDetails;
4847
TArray<FString> Keys;
4948
AssetsDependenciesMap.GetKeys(Keys);
5049

@@ -59,11 +58,11 @@ TArray<FAssetDetail> FAssetDependenciesInfo::GetAssetDetails()const
5958
for (const auto& ModuleAssetKey : ModuleAssetKeys)
6059
{
6160
FScopeLock Lock(&SynchronizationObject);
62-
OutAssetDetails.Add(*ModuleAssetDetails.Find(ModuleAssetKey));
61+
AssetDetails.Add(*ModuleAssetDetails.Find(ModuleAssetKey));
6362
}
6463
},GForceSingleThread);
6564

66-
return OutAssetDetails;
65+
return AssetDetails;
6766
}
6867

6968
bool FAssetDependenciesInfo::GetAssetDetailByPackageName(const FString& InAssetPackageName,FAssetDetail& OutDetail) const
@@ -92,3 +91,28 @@ TArray<FString> FAssetDependenciesInfo::GetAssetLongPackageNames()const
9291
}
9392
return OutAssetLongPackageName;
9493
}
94+
95+
void FAssetDependenciesInfo::RemoveAssetDetail(const FAssetDetail& AssetDetail)
96+
{
97+
SCOPED_NAMED_EVENT_TEXT("FAssetDependenciesInfo::RemoveAssetDetail",FColor::Red);
98+
FString LongPackageName = UFlibAssetManageHelper::PackagePathToLongPackageName(AssetDetail.PackagePath.ToString());
99+
RemoveAssetDetail(LongPackageName);
100+
}
101+
102+
void FAssetDependenciesInfo::RemoveAssetDetail(const FString& LongPackageName)
103+
{
104+
FString BelongModuleName = UFlibAssetManageHelper::GetAssetBelongModuleName(LongPackageName);
105+
if (AssetsDependenciesMap.Contains(BelongModuleName))
106+
{
107+
TMap<FString,FAssetDetail>& AssetDependencyDetails = AssetsDependenciesMap.Find(BelongModuleName)->AssetDependencyDetails;
108+
bool bHas = AssetDependencyDetails.Contains(LongPackageName);
109+
if(bHas)
110+
{
111+
AssetDependencyDetails.Remove(LongPackageName);
112+
if(!AssetDependencyDetails.Num())
113+
{
114+
AssetsDependenciesMap.Remove(BelongModuleName);
115+
}
116+
}
117+
}
118+
}

0 commit comments

Comments
 (0)