mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
fetch correct sdk module from pluginsdk
This commit is contained in:
parent
b7fafa6b65
commit
f310497464
@ -9,9 +9,11 @@
|
|||||||
#include "core/stdafx.h"
|
#include "core/stdafx.h"
|
||||||
#include "pluginsdk.h"
|
#include "pluginsdk.h"
|
||||||
|
|
||||||
extern "C" __declspec(dllexport) bool PluginInstance_OnLoad(const char* pszSelfModule)
|
extern "C" __declspec(dllexport) bool PluginInstance_OnLoad(const char* pszSelfModule, const char* pszSDKModule)
|
||||||
{
|
{
|
||||||
g_pPluginSDK = new CPluginSDK(pszSelfModule);
|
g_pPluginSDK = new CPluginSDK(pszSelfModule);
|
||||||
|
g_pPluginSDK->SetSDKModule(CModule(pszSDKModule));
|
||||||
|
|
||||||
return g_pPluginSDK->InitSDK();
|
return g_pPluginSDK->InitSDK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ CPluginSDK::CPluginSDK(const char* pszSelfModule) : m_FactoryInstance(nullptr),
|
|||||||
{
|
{
|
||||||
m_SelfModule = CModule(pszSelfModule);
|
m_SelfModule = CModule(pszSelfModule);
|
||||||
m_GameModule = CModule("r5apex.exe");
|
m_GameModule = CModule("r5apex.exe");
|
||||||
m_SDKModule = CModule("gamesdk.dll"); // THIS NEEDS TO BE CHANGED FOR DEDI/CLIENT SDK SUPPORT. AT BEST DO THIS VIA PluginInstance_OnLoad.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
|
@ -11,6 +11,8 @@ public:
|
|||||||
~CPluginSDK();
|
~CPluginSDK();
|
||||||
|
|
||||||
bool InitSDK();
|
bool InitSDK();
|
||||||
|
|
||||||
|
inline void SetSDKModule(const CModule& sdkModule) { m_SDKModule = sdkModule; };
|
||||||
private:
|
private:
|
||||||
|
|
||||||
IFactory* m_FactoryInstance;
|
IFactory* m_FactoryInstance;
|
||||||
|
@ -60,7 +60,7 @@ bool CPluginSystem::LoadPluginInstance(PluginInstance_t& pluginInst)
|
|||||||
auto onLoadFn = pluginModule.GetExportedFunction("PluginInstance_OnLoad").RCast<PluginInstance_t::OnLoad>();
|
auto onLoadFn = pluginModule.GetExportedFunction("PluginInstance_OnLoad").RCast<PluginInstance_t::OnLoad>();
|
||||||
Assert(onLoadFn);
|
Assert(onLoadFn);
|
||||||
|
|
||||||
if (!onLoadFn(pluginInst.m_svPluginName.c_str()))
|
if (!onLoadFn(pluginInst.m_svPluginName.c_str(), g_SDKDll.GetModuleName().c_str()))
|
||||||
{
|
{
|
||||||
FreeLibrary(loadedPlugin);
|
FreeLibrary(loadedPlugin);
|
||||||
return false;
|
return false;
|
||||||
|
@ -81,7 +81,7 @@ public:
|
|||||||
PluginInstance_t(string svPluginName, string svPluginFullPath) : m_svPluginName(svPluginName), m_svPluginFullPath(svPluginFullPath), m_svDescription(std::string()), m_bIsLoaded(false) {};
|
PluginInstance_t(string svPluginName, string svPluginFullPath) : m_svPluginName(svPluginName), m_svPluginFullPath(svPluginFullPath), m_svDescription(std::string()), m_bIsLoaded(false) {};
|
||||||
|
|
||||||
// Might wanna make a status code system.
|
// Might wanna make a status code system.
|
||||||
typedef bool(*OnLoad)(const char*);
|
typedef bool(*OnLoad)(const char*, const char*);
|
||||||
typedef void(*OnUnload)();
|
typedef void(*OnUnload)();
|
||||||
|
|
||||||
CModule m_hModule;
|
CModule m_hModule;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user