private void HandleUserJoinedChannel(IIncommingMessage message)
        {
            var data = new List <string>().FromBytes(message.AsBytes());

            if (UserJoinedChannel != null)
            {
                UserJoinedChannel.Invoke(data[0], data[1]);
            }
        }
 protected virtual void OnUserJoinedChannel(object source, EventArgs e)
 {
     UserJoinedChannel?.Invoke(source, e);
 }
示例#3
0
        public virtual void Events_ReceivedTriggeringEvent(object sender, Entities.EventHandlers.ReceivedEventEventArgs e)
        {
            switch (e.Event.GetType().Name)
            {
            case nameof(FChatSharpLib.Entities.Events.Server.JoinChannel):
                var jchEvent = (FChatSharpLib.Entities.Events.Server.JoinChannel)e.Event;
                UserJoinedChannel?.Invoke(this, jchEvent);
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.InitialChannelData):
                var ichEvent = (FChatSharpLib.Entities.Events.Server.InitialChannelData)e.Event;
                BotJoinedChannel?.Invoke(this, ichEvent);
                if (numberOfChannelsToTreatAsNewlyCreatedChannel > 0)
                {
                    numberOfChannelsToTreatAsNewlyCreatedChannel--;
                    BotCreatedChannel?.Invoke(this, ichEvent);
                }
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.ConnectedUsers):
                var conEvent = (FChatSharpLib.Entities.Events.Server.ConnectedUsers)e.Event;
                BotConnected?.Invoke(this, new Entities.EventHandlers.ReceivedStateUpdateEventArgs()
                {
                    State = State
                });
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.StatusChanged):
                var staEvent = (FChatSharpLib.Entities.Events.Server.StatusChanged)e.Event;
                UserChangedStatus?.Invoke(this, staEvent);
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.OnlineNotification):
                var nlnEvent = (FChatSharpLib.Entities.Events.Server.OnlineNotification)e.Event;
                UserLoggedOn?.Invoke(this, nlnEvent);
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.OfflineNotification):
                var flnEvent = (FChatSharpLib.Entities.Events.Server.OfflineNotification)e.Event;
                UserLoggedOff?.Invoke(this, flnEvent);
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.LeaveChannel):
                var lchEvent = (FChatSharpLib.Entities.Events.Server.LeaveChannel)e.Event;
                UserLeftChannel?.Invoke(this, lchEvent);
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.AddedChanOP):
                var coaEvent = (FChatSharpLib.Entities.Events.Server.AddedChanOP)e.Event;
                AddedOPInChannel?.Invoke(this, coaEvent);
                break;

            case nameof(FChatSharpLib.Entities.Events.Server.RemovedChanOP):
                var corEvent = (FChatSharpLib.Entities.Events.Server.RemovedChanOP)e.Event;
                RemovedOPInChannel?.Invoke(this, corEvent);
                break;

            case nameof(Entities.Events.Server.RollResult):
                var rllEvent = (FChatSharpLib.Entities.Events.Server.RollResult)e.Event;
                RollResultReceived?.Invoke(this, rllEvent);
                break;

            case nameof(Entities.Events.Server.Message):
                var msgEvent = (FChatSharpLib.Entities.Events.Server.Message)e.Event;
                ChannelMessageReceived?.Invoke(this, msgEvent);
                break;

            case nameof(Entities.Events.Server.PrivateMessage):
                var prvEvent = (FChatSharpLib.Entities.Events.Server.PrivateMessage)e.Event;
                PrivateMessageReceived?.Invoke(this, prvEvent);
                break;

            default:
                break;
            }
        }