2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
2012-09-23 18:09:57 -04:00
|
|
|
#include "Plugin.h"
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-19 04:57:41 -04:00
|
|
|
cPlugin::cPlugin(const AString & a_FolderName) :
|
|
|
|
m_Status(cPluginManager::psDisabled),
|
|
|
|
m_Name(a_FolderName),
|
2013-08-08 10:01:26 -04:00
|
|
|
m_Version(0),
|
2015-04-19 04:57:41 -04:00
|
|
|
m_FolderName(a_FolderName)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-11 23:46:01 -05:00
|
|
|
cPlugin::~cPlugin()
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2013-02-05 14:57:22 -05:00
|
|
|
LOGD("Destroying plugin \"%s\".", m_Name.c_str());
|
2012-06-14 09:06:06 -04:00
|
|
|
}
|
|
|
|
|
2012-08-03 07:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-19 04:57:41 -04:00
|
|
|
void cPlugin::Unload(void)
|
|
|
|
{
|
|
|
|
auto pm = cPluginManager::Get();
|
|
|
|
pm->RemovePluginCommands(this);
|
|
|
|
pm->RemovePluginConsoleCommands(this);
|
|
|
|
pm->RemoveHooks(this);
|
|
|
|
OnDisable();
|
|
|
|
m_Status = cPluginManager::psUnloaded;
|
|
|
|
m_LoadError.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-18 16:15:12 -04:00
|
|
|
AString cPlugin::GetLocalFolder(void) const
|
2012-10-13 19:34:47 -04:00
|
|
|
{
|
2015-04-19 04:57:41 -04:00
|
|
|
return std::string("Plugins/") + m_FolderName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-26 17:24:36 -04:00
|
|
|
|
2015-04-19 04:57:41 -04:00
|
|
|
void cPlugin::SetLoadError(const AString & a_LoadError)
|
|
|
|
{
|
|
|
|
m_Status = cPluginManager::psError;
|
|
|
|
m_LoadError = a_LoadError;
|
2013-09-18 16:15:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|