summaryrefslogtreecommitdiffstats
path: root/src/Bindings/Plugin.cpp
blob: 2f2771e3859bb13d20737e9fcd0f5768cc21cc8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

#include "Globals.h"  // NOTE: MSVC stupidness requires this to be the same across all modules

#include "Plugin.h"





cPlugin::cPlugin(const AString & a_FolderName) :
	m_Status(cPluginManager::psDisabled),
	m_Name(a_FolderName),
	m_Version(0),
	m_FolderName(a_FolderName)
{
}





cPlugin::~cPlugin()
{
	LOGD("Destroying plugin \"%s\".", m_Name.c_str());
}





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();
}





AString cPlugin::GetLocalFolder(void) const
{
	return std::string("Plugins/") + m_FolderName;
}




void cPlugin::SetLoadError(const AString & a_LoadError)
{
	m_Status = cPluginManager::psError;
	m_LoadError = a_LoadError;
}




hhhhhh