Legacy: PluginPreload routine - AurieFramework/YYToolkit GitHub Wiki
Homepage.
You are reading the documentation of YYToolkit Legacy (v2.x.x) - for documentation on current-gen YYTK, see theIf Early Launch is enabled, the PluginPreload routine is called exactly once, before YYToolkit hands control over to the runner's main()
function.
It is responsible for creation of low-level hooks on functions that only get called early in the runner, and it is thus impossible to hook them later within PluginEntry()
.
It is not advised you use this function unless you absolutely need your plugin to respond to Early Launch being enabled.
Example
DllExport YYTKStatus PluginPreload(
YYTKPlugin* PluginObject // A pointer to the dedicated plugin object
)
{
// Run pre-init hooks on low-level runner code
return YYTK_OK; // Successful PluginPreload.
}
This is an example of a PluginPreload function.
Syntax
YYTKStatus PluginPreload(
YYTKPlugin* PluginObject
);
Parameters
PluginObject
The internal object representing a plugin entry.
You may keep a pointer to it, as the object is accessible throughout the lifetime of the plugin.
Return Value
The function must return YYTK_OK
if initialization succeeds. In other cases, it returns a matching YYTKStatus
to help with troubleshooting.
Remarks
The PluginPreload
routine must always be exported, or else the function won't be called - any other functions defined in the plugin module (DLL) don't have to be exported, unless specified otherwise.
This function will NOT be called on any versions earlier than v0.1.1!
This function is only called if Early Launch is enabled.
Calling game functions via the CallBuiltin
routine may result in undefined behavior, as the function table might not yet be initialized.
To prevent this, consider moving the misbehaving code to PluginEntry()
.