Esempio n. 1
0
        public bool Unload()
        {
            try
            {
                if (!Enabled)
                {
                    return(true);
                }

                PointBlankLogging.Log("Stopping " + Name + "...");

                SaveConfiguration();                                                               // Save the configuration
                SaveTranslation();                                                                 // Save the translation
                PointBlankPluginEvents.RunPluginStop(PluginClass);                                 // Run the stop event
                PluginClass.Unload();                                                              // Run the unload function
                PointBlankPluginEvents.RunPluginUnloaded(PluginClass);                             // Run the unloaded event

                Enviroment.runtimeObjects["Plugins"].RemoveCodeObject(PluginClass.GetType().Name); // Remove the plugin from gameobject

                Enabled = false;                                                                   // Set the enabled to false
                t.Abort();                                                                         // Abort the thread
                return(true);
            }
            catch (Exception ex)
            {
                PointBlankLogging.LogError("Error stopping plugin: " + Name, ex);
                return(false);
            }
        }