Exemple #1
0
        /// <summary> Hooks IRC events so they are handled. </summary>
        public void Hook()
        {
            if (hookedEvents)
            {
                return;
            }
            hookedEvents = true;

            OnPlayerActionEvent.Register(HandlePlayerAction, Priority.Low);
            OnShuttingDownEvent.Register(HandleShutdown, Priority.Low);
            OnGroupLoadEvent.Register(HandleGroupLoad, Priority.Low);

            OnChatEvent.Register(HandleChat, Priority.Low);
            OnChatSysEvent.Register(HandleChatSys, Priority.Low);
            OnChatFromEvent.Register(HandleChatFrom, Priority.Low);

            // Regster events for incoming
            bot.connection.Listener.OnNick              += Listener_OnNick;
            bot.connection.Listener.OnRegistered        += Listener_OnRegistered;
            bot.connection.Listener.OnAction            += Listener_OnAction;
            bot.connection.Listener.OnPublic            += Listener_OnPublic;
            bot.connection.Listener.OnPrivate           += Listener_OnPrivate;
            bot.connection.Listener.OnError             += Listener_OnError;
            bot.connection.Listener.OnQuit              += Listener_OnQuit;
            bot.connection.Listener.OnJoin              += Listener_OnJoin;
            bot.connection.Listener.OnPart              += Listener_OnPart;
            bot.connection.Listener.OnDisconnected      += Listener_OnDisconnected;
            bot.connection.Listener.OnChannelModeChange += Listener_OnChannelModeChange;
            bot.connection.Listener.OnNames             += Listener_OnNames;
            bot.connection.Listener.OnKick              += Listener_OnKick;
            bot.connection.Listener.OnKill              += Listener_OnKill;
            bot.connection.Listener.OnPrivateNotice     += Listener_OnPrivateNotice;
        }
Exemple #2
0
 protected virtual void OnStart()
 {
     OnChatEvent.Register(OnChat, Priority.Low);
     OnChatSysEvent.Register(OnChatSys, Priority.Low);
     OnChatFromEvent.Register(OnChatFrom, Priority.Low);
     OnShuttingDownEvent.Register(OnShutdown, Priority.Low);
 }
Exemple #3
0
 protected void HookEvents()
 {
     OnChatEvent.Register(HandleChat, Priority.Low);
     OnChatSysEvent.Register(HandleChatSys, Priority.Low);
     OnChatFromEvent.Register(HandleChatFrom, Priority.Low);
     OnShuttingDownEvent.Register(HandleShutdown, Priority.Low);
 }