public static void Organize() { List <PluginUnloadEvent> temp = new List <PluginUnloadEvent>(); List <PluginUnloadEvent> temp2 = events; PluginUnloadEvent temp3 = null; int i = 0; int ii = temp2.Count; while (i < ii) { foreach (PluginUnloadEvent p in temp2) { if (temp3 == null) { temp3 = p; } else if (temp3.priority < p.priority) { temp3 = p; } } temp.Add(temp3); temp2.Remove(temp3); temp3 = null; i++; } events = temp; }
/// <summary> /// Unload the specified p and shutdown. /// </summary> /// <param name='p'> /// P. The plugin object you want to unload /// </param> /// <param name='shutdown'> /// Shutdown. Is the server shutting down? /// </param> public static void Unload(Plugin p, bool shutdown) { p.Unload(shutdown); all.Remove(p); PluginUnloadEvent.Call(p); if (cancelunload) { Load(p, false); cancelunload = false; return; } Logger.Log(p.name + " was unloaded."); }