C# Class OTAPI.Patcher.Engine.Patcher

Contains the meat of the patcher, organises the source assembly, and a list of all the modification instances that will run against the source assembly.
Afficher le fichier Open project: DeathCradle/Open-Terraria-API Class Usage Examples

Protected Properties

Свойство Type Description
modificationAssemblyGlob IEnumerable
readerParams ReaderParameters
resolver NugetAssemblyResolver

Méthodes publiques

Méthode Description
AllowDuplicateModificationTypes ( System allowedTypes ) : void

This will allow ILRepack to merge all our modifications into one assembly. In our case we define hooks in the same namespace across different modification assemblies, and of course ILRepack detects the conflict. By enumerating each type of the modifications, we add each full name to the allowed list.

Patcher ( string sourceAssemblyPath, IEnumerable modificationAssemblyGlob, string outputAssemblyPath ) : Mono.Cecil

Creates a new instance of the patcher with the specified source assembly path and a glob containing all the modification assemblies.

Run ( ) : void

Méthodes protégées

Méthode Description
Cleanup ( ) : void

Cleans up data after a successful patch

GlobModificationAssemblies ( ) : IEnumerable
LoadModification ( Type type ) : ModificationBase
LoadModificationAssemblies ( ) : void
LoadSourceAssembly ( ) : void
PackAssemblies ( ) : void
RemoveModificationsFromPackedAssembly ( ) : void

Removes all ModificationBase implementations from the output assembly. Additionally it will also remove references that were added due to ModificationBases being merged in.

RunModifications ( ) : void
SaveSourceAssembly ( ) : void

Private Methods

Méthode Description
CurrentDomain_AssemblyLoad ( object sender, AssemblyLoadEventArgs args ) : void
CurrentDomain_AssemblyResolve ( object sender, ResolveEventArgs args ) : Assembly
Resolver_OnResolved ( object sender, NugetAssemblyResolvedEventArgs e ) : void
Resolver_ResolveFailure ( object sender, Mono.Cecil.AssemblyNameReference reference ) : AssemblyDefinition

Method Details

AllowDuplicateModificationTypes() public méthode

This will allow ILRepack to merge all our modifications into one assembly. In our case we define hooks in the same namespace across different modification assemblies, and of course ILRepack detects the conflict. By enumerating each type of the modifications, we add each full name to the allowed list.
public AllowDuplicateModificationTypes ( System allowedTypes ) : void
allowedTypes System
Résultat void

Cleanup() protected méthode

Cleans up data after a successful patch
protected Cleanup ( ) : void
Résultat void

GlobModificationAssemblies() protected méthode

protected GlobModificationAssemblies ( ) : IEnumerable
Résultat IEnumerable

LoadModification() protected méthode

protected LoadModification ( Type type ) : ModificationBase
type System.Type
Résultat ModificationBase

LoadModificationAssemblies() protected méthode

protected LoadModificationAssemblies ( ) : void
Résultat void

LoadSourceAssembly() protected méthode

protected LoadSourceAssembly ( ) : void
Résultat void

PackAssemblies() protected méthode

protected PackAssemblies ( ) : void
Résultat void

Patcher() public méthode

Creates a new instance of the patcher with the specified source assembly path and a glob containing all the modification assemblies.
public Patcher ( string sourceAssemblyPath, IEnumerable modificationAssemblyGlob, string outputAssemblyPath ) : Mono.Cecil
sourceAssemblyPath string Path to the source assembly that modifications need to applied to
modificationAssemblyGlob IEnumerable A list of globs that yields a list of modifications
outputAssemblyPath string Path for the modified assembly to be saved
Résultat Mono.Cecil

RemoveModificationsFromPackedAssembly() protected méthode

Removes all ModificationBase implementations from the output assembly. Additionally it will also remove references that were added due to ModificationBases being merged in.
protected RemoveModificationsFromPackedAssembly ( ) : void
Résultat void

Run() public méthode

public Run ( ) : void
Résultat void

RunModifications() protected méthode

protected RunModifications ( ) : void
Résultat void

SaveSourceAssembly() protected méthode

protected SaveSourceAssembly ( ) : void
Résultat void

Property Details

modificationAssemblyGlob protected_oe property

Glob pattern for the list of modification assemblies that will run against the source assembly.
protected IEnumerable modificationAssemblyGlob
Résultat IEnumerable

readerParams protected_oe property

protected ReaderParameters readerParams
Résultat ReaderParameters

resolver protected_oe property

protected NugetAssemblyResolver,OTAPI.Patcher.Engine resolver
Résultat NugetAssemblyResolver