summaryrefslogtreecommitdiffstats
path: root/src/Bindings/Plugin.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-04-19 10:57:41 +0200
committerMattes D <github@xoft.cz>2015-04-19 10:57:41 +0200
commita9b5a6c3a63d8500f3c512574fd802d40b562661 (patch)
treee6d0d362ed42116d6c9deaaa789287f464569514 /src/Bindings/Plugin.cpp
parentMerge pull request #1869 from mathias-gh/master (diff)
downloadcuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.gz
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.bz2
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.lz
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.xz
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.tar.zst
cuberite-a9b5a6c3a63d8500f3c512574fd802d40b562661.zip
Diffstat (limited to 'src/Bindings/Plugin.cpp')
-rw-r--r--src/Bindings/Plugin.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/Bindings/Plugin.cpp b/src/Bindings/Plugin.cpp
index 98ccfb88c..2f2771e38 100644
--- a/src/Bindings/Plugin.cpp
+++ b/src/Bindings/Plugin.cpp
@@ -7,11 +7,11 @@
-cPlugin::cPlugin(const AString & a_PluginDirectory) :
- m_Language(E_CPP),
- m_Name(a_PluginDirectory),
+cPlugin::cPlugin(const AString & a_FolderName) :
+ m_Status(cPluginManager::psDisabled),
+ m_Name(a_FolderName),
m_Version(0),
- m_Directory(a_PluginDirectory)
+ m_FolderName(a_FolderName)
{
}
@@ -28,9 +28,33 @@ cPlugin::~cPlugin()
+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_Directory;
+ return std::string("Plugins/") + m_FolderName;
+}
+
+
+
+
+void cPlugin::SetLoadError(const AString & a_LoadError)
+{
+ m_Status = cPluginManager::psError;
+ m_LoadError = a_LoadError;
}