Esempio n. 1
0
        public override void CheckRequest()
        {
            base.CheckRequest();

            if (_errorCode != ChatError.NoError)
            {
                return;
            }

            if (_session.UserInfo.JoinedChannels.Count == 0)
            {
                _errorCode     = ChatError.IRCError;
                _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName);
                return;
            }

            if (!_session.UserInfo.GetJoinedChannelByName(_cmd.ChannelName, out _channel))
            {
                _errorCode     = ChatError.IRCError;
                _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName);
                return;
            }

            if (!_channel.GetChannelUserBySession(_session, out _user))
            {
                _errorCode     = ChatError.Parse;
                _sendingBuffer = ChatIRCError.BuildNoSuchNickError();
                return;
            }
        }
Esempio n. 2
0
 public override void CheckRequest()
 {
     base.CheckRequest();
     if (!_session.UserInfo.GetJoinedChannelByName(_cmd.ChannelName, out _channel))
     {
         _errorCode = Entity.Structure.ChatError.Parse;
         return;
     }
     if (!_channel.GetChannelUserBySession(_session, out _user))
     {
         _errorCode = Entity.Structure.ChatError.Parse;
         return;
     }
 }
Esempio n. 3
0
 public override void CheckRequest()
 {
     base.CheckRequest();
     //can not find any user
     if (!_channel.GetChannelUserBySession(_session, out _user))
     {
         _errorCode     = ChatError.IRCError;
         _sendingBuffer = ChatIRCError.BuildNoSuchNickError();
         return;
     }
     if (!ChatChannelManager.GetChannel(_cmd.ChannelName, out _channel))
     {
         _errorCode     = ChatError.IRCError;
         _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName);
     }
 }
Esempio n. 4
0
        private void GetChannelAndUser()
        {
            if (_session.UserInfo.JoinedChannels.Count == 0)
            {
                _errorCode     = ChatError.IRCError;
                _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName);
                return;
            }

            if (!_session.UserInfo.GetJoinedChannelByName(_cmd.ChannelName, out _channel))
            {
                _errorCode     = ChatError.IRCError;
                _sendingBuffer = ChatIRCError.BuildNoSuchChannelError(_cmd.ChannelName);
                return;
            }

            if (!_channel.GetChannelUserBySession(_session, out _user))
            {
                _errorCode     = ChatError.Parse;
                _sendingBuffer = ChatIRCError.BuildNoSuchNickError();
                return;
            }
        }