using System; using Decal.Adapter.Wrappers; namespace Decal.Adapter; [CLSCompliant(true)] public abstract class FilterBase : Extension { private NetServiceHost myHost; [CLSCompliant(false)] protected NetServiceHost Host => myHost; [CLSCompliant(false)] protected event EventHandler ServerDispatch; [CLSCompliant(false)] protected event EventHandler ClientDispatch; protected FilterBase() : base(DecalExtensionType.NetworkFilter) { } /// /// Used for internal wiring up of base-class variables. /// Called by FilterProxy /// /// Host (pluginsite) object internal void SetHost(NetServiceHost newHost) { myHost = newHost; } internal void fireNetwork(Message newMsg, bool Server) { if (Server && this.ServerDispatch != null) { this.ServerDispatch(this, new NetworkMessageEventArgs(newMsg)); } else if (!Server && this.ClientDispatch != null) { this.ClientDispatch(this, new NetworkMessageEventArgs(newMsg)); } } }