void RegisterEvents() { OnPlayerConnectEvent.Register(HandlePlayerConnect, Priority.Low); OnPlayerDisconnectEvent.Register(HandlePlayerDisconnect, Priority.Low); OnPlayerActionEvent.Register(HandlePlayerAction, Priority.Low); HookEvents(); }
/// <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; }
protected override void OnStart() { base.OnStart(); OnPlayerConnectEvent.Register(HandlePlayerConnect, Priority.Low); OnPlayerDisconnectEvent.Register(HandlePlayerDisconnect, Priority.Low); OnPlayerActionEvent.Register(HandlePlayerAction, Priority.Low); }
public override void Load(bool startup) { OnPlayerConnectEvent.Register(HandleConnect, Priority.Low); OnPlayerDisconnectEvent.Register(HandleDisconnect, Priority.Low); OnPlayerChatEvent.Register(HandleChat, Priority.Low); OnPlayerActionEvent.Register(HandlePlayerAction, Priority.Low); OnModActionEvent.Register(HandleModerationAction, Priority.Low); }
protected virtual void HookEventHandlers() { OnLevelUnloadEvent.Register(HandleLevelUnload, Priority.High); OnSendingHeartbeatEvent.Register(HandleSendingHeartbeat, Priority.High); OnSQLSaveEvent.Register(SaveStats, Priority.High); OnPlayerActionEvent.Register(HandlePlayerAction, Priority.High); OnPlayerDisconnectEvent.Register(HandlePlayerDisconnect, Priority.High); }
public static void InitHandlers() { OnPlayerConnectEvent.Register(OnConnect, Priority.High); OnPlayerDisconnectEvent.Register(OnLeave, Priority.High); OnPlayerMoveEvent.Register(OnMovement, Priority.High); OnPlayerClickEvent.Register(OnClick, Priority.High); OnPlayerChatEvent.Register(OnChat, Priority.High); OnTabListEntryAddedEvent.Register(HUD.GetTabName, Priority.High); OnPlayerActionEvent.Register(OnAFK, Priority.Normal); }
public override void Load(bool startup) { OnEntitySpawnedEvent.Register(HandleEntitySpawned, Priority.High); OnTabListEntryAddedEvent.Register(HandleTabListEntryAdded, Priority.High); OnMoneyChangedEvent.Register(HandleMoneyChanged, Priority.High); OnPlayerConnectEvent.Register(HandlePlayerConnect, Priority.High); OnPlayerDisconnectEvent.Register(HandlePlayerDisconnect, Priority.High); OnPlayerMoveEvent.Register(HandlePlayerMove, Priority.High); OnPlayerActionEvent.Register(HandlePlayerAction, Priority.High); OnPlayerSpawningEvent.Register(HandlePlayerSpawning, Priority.High); OnBlockChangeEvent.Register(HandleBlockChange, Priority.High); OnLevelUnloadEvent.Register(HandleLevelUnload, Priority.High); }