public static void HookChatMessage( Object plugin, Dictionary<Guid, IPlugin> plugins, Dictionary<Guid, bool> pluginState, ChatManager.ChatEvent chatEvent, out bool discard )
{
discard = false;
foreach ( Guid key in plugins.Keys )
{
object hookPlugin = plugins[ key ];
if ( !pluginState.ContainsKey( key ) )
continue;
MethodInfo hookMethod = hookPlugin.GetType( ).GetMethod( "OnChatHook" );
if ( hookMethod != null )
{
const bool hookDiscard = false;
object[ ] args = { chatEvent, plugin, hookDiscard };
hookMethod.Invoke( hookPlugin, args );
discard = (bool)args[ 2 ];
}
}
}