Hotfixers
Coding Style wiki
using OxGFrame.Hotfixer;
Core Mechanism Description
Hotfixers is mainly integrated with HybridCLR, responsible for the following at runtime:
- Supplementing AOT Metadata: Solving problems such as generic instantiation.
- Loading Hotfix DLLs: Injecting updated logic into the execution thread.
Patch Operation (Update and Check)
Core methods for performing hot-update checks and loading.
CheckHotfix
Starts downloading and loading all hot-update related files.
-
Automatic Configuration Mode
CheckHotfix(string packageName, Action errorAction = null)CheckHotfix(PackageInfoWithBuild packageInfo, Action errorAction = null)- Reminder This mode automatically reads the
hotfixdllconfig.confconfiguration file inStreamingAssets.
-
Manual Specification Mode
CheckHotfix(string packageName, string[] aotAssemblies, string[] hotfixAssemblies)- Supports manual passing of a list of AOT assemblies and hotfix assemblies that need supplementation.
Status & Cache
- IsDone()
- Returns whether the hot update has completed loading.
- Wait for Hotfixers.IsDone() before entering the main game logic and resource updates.
- IsDisabled()
- Checks if the hot-update feature is currently disabled in the environment (usually used for developer mode).
- Important If HybridCLR is disabled, the Macro OXGFRAME_HYBRIDCLR_DISABLED must be used to effectively eliminate the hot-update flow.
- Reset()
- Resets hot-update flags and cache data. If it's the commercial version (supporting HotReload), Reset can be used to re-initialize.
Assembly Info
Provides queries for assemblies loaded at runtime.
AOT Assemblies (Metadata Assemblies)
- GetAOTAssemblyNames(): Gets AOT assembly names (including
.dllextension). - GetAotAssemblyNamesWithoutExtensions(): Gets AOT assembly names (without extension).
Hotfix Assemblies (Hotfix Assemblies)
- GetHotfixAssemblyNames(): Gets hot-update assembly names (including
.dllextension). - GetHotfixAssemblyNamesWithoutExtensions(): Gets hot-update assembly names (without extension).
- GetHotfixAssembly(string assemblyName): Gets the loaded
Assemblyobject by name.