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