Exemplo n.º 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;
        }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public override void Load(bool startup) {
     OnPlayerConnectEvent.Register(ConnectHandler.HandleConnect, Priority.Critical);
     OnPlayerCommandEvent.Register(ChatHandler.HandleCommand, Priority.Critical);
     OnChatEvent.Register(ChatHandler.HandleOnChat, Priority.Critical);
     OnPlayerStartConnectingEvent.Register(ConnectingHandler.HandleConnecting, Priority.Critical);
     
     OnSentMapEvent.Register(MiscHandlers.HandleOnMapSent, Priority.Critical);
     OnPlayerMoveEvent.Register(MiscHandlers.HandlePlayerMove, Priority.Critical);
     OnPlayerClickEvent.Register(MiscHandlers.HandlePlayerClick, Priority.Critical);
     
     OnEcoTransactionEvent.Register(EcoHandlers.HandleEcoTransaction, Priority.Critical);
     OnModActionEvent.Register(ModActionHandler.HandleModAction, Priority.Critical);
     clearTask = Server.Background.QueueRepeat(IPThrottler.CleanupTask, null, 
                                               TimeSpan.FromMinutes(10));
 }
Exemplo n.º 5
0
        public override void Load(bool startup)
        {
            OnPlayerConnectEvent.Register(ConnectHandler.HandleConnect, Priority.Critical);
            OnPlayerCommandEvent.Register(ChatHandler.HandleCommand, Priority.Critical);
            OnChatEvent.Register(ChatHandler.HandleOnChat, Priority.Critical);
            OnPlayerStartConnectingEvent.Register(ConnectingHandler.HandleConnecting, Priority.Critical);

            OnSentMapEvent.Register(MiscHandlers.HandleSentMap, Priority.Critical);
            OnPlayerMoveEvent.Register(MiscHandlers.HandlePlayerMove, Priority.Critical);
            OnPlayerClickEvent.Register(MiscHandlers.HandlePlayerClick, Priority.Critical);
            OnChangedZoneEvent.Register(MiscHandlers.HandleChangedZone, Priority.Critical);

            OnEcoTransactionEvent.Register(EcoHandlers.HandleEcoTransaction, Priority.Critical);
            OnModActionEvent.Register(ModActionHandler.HandleModAction, Priority.Critical);
        }