diff options
author | Mattes D <github@xoft.cz> | 2015-04-19 19:53:14 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-04-19 19:53:14 +0200 |
commit | ba6f5aea4c088b92365b6636d96873a82706c8c8 (patch) | |
tree | d8c6f3a3eda7c0ed1f70bc5a01b97b90d940eab4 /src/Bindings/Plugin.cpp | |
parent | ClientHandle: Fixed re-sending refused right-clicks. (diff) | |
parent | Refresh plugin list before trying to load. (diff) | |
download | cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.gz cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.bz2 cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.lz cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.xz cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.tar.zst cuberite-ba6f5aea4c088b92365b6636d96873a82706c8c8.zip |
Diffstat (limited to 'src/Bindings/Plugin.cpp')
-rw-r--r-- | src/Bindings/Plugin.cpp | 34 |
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; } |