public void RemoveHook(IPluginHook PluginHook) { lock (this.Hooks) { if (this.Hooks.Contains(PluginHook)) { this.Hooks.Add(PluginHook); } } }
/// <summary> /// The Plugin Hook is being used to redirect any traffic from the target plugin to the hook so that the plugin can monitor the traffic, filter, redirect ... etc /// </summary> /// <param name="PluginHook">The Plugin Hook to use</param> public void InstallHook(IPluginHook PluginHook) { if (!AllowPluginHooks()) { throw new Exception("The plugin does not allow plugin hooks to be installed"); } lock (this.Hooks) { if (!this.Hooks.Contains(PluginHook)) { this.Hooks.Add(PluginHook); } PluginHook.Client = this.Client; PluginHook.Plugin = this; } }