Example #1
0
        public override void DataOperation()
        {
            base.DataOperation();

            if (_session.UserInfo.JoinedChannels.Count == 0)
            {
                _errorCode = ChatError.DataOperation;
                return;
            }

            if (!_session.UserInfo.GetJoinedChannel(_cmd.ChannelName, out _channel))
            {
                _errorCode = ChatError.DataOperation;
                return;
            }

            if (!_channel.GetChannelUser(_session, out _user))
            {
                return;
            }

            _channel.RemoveBindOnUserAndChannel(_user);

            _channel.MultiCastLeave(_user, _cmd.Reason);
        }
Example #2
0
        public override void CheckRequest()
        {
            base.CheckRequest();

            if (_session.UserInfo.NickName != _setckeyCmd.NickName)
            {
                _errorCode = Entity.Structure.ChatError.Parse;
                return;
            }

            if (!_session.UserInfo.IsJoinedChannel(_setckeyCmd.ChannelName))
            {
                _errorCode = Entity.Structure.ChatError.Parse;
                return;
            }

            if (!ChatChannelManager.GetChannel(_setckeyCmd.ChannelName, out _channel))
            {
                _errorCode = Entity.Structure.ChatError.Parse;
                return;
            }

            if (!_channel.GetChannelUser(_session, out _user))
            {
                _errorCode = Entity.Structure.ChatError.Parse;
                return;
            }
        }
Example #3
0
 public override void CheckRequest()
 {
     base.CheckRequest();
     if (!_session.UserInfo.GetJoinedChannel(_cmd.ChannelName, out _channel))
     {
         _errorCode = Entity.Structure.ChatError.Parse;
         return;
     }
     if (!_channel.GetChannelUser(_session, out _user))
     {
         _errorCode = Entity.Structure.ChatError.Parse;
         return;
     }
 }
Example #4
0
        public override void ConstructResponse()
        {
            ChatChannelUser user;

            //can not find any user
            if (!_channel.GetChannelUser(_session, out user))
            {
                _errorCode = Entity.Structure.ChatError.DataOperation;
                return;
            }

            _channel.SendChannelUsersToJoiner(user);

            base.ConstructResponse();
        }
Example #5
0
        public override void CheckRequest()
        {
            base.CheckRequest();
            if (!_session.UserInfo.GetJoinedChannel(_cmd.ChannelName, out _channel))
            {
                _errorCode = ChatError.Parse;
                return;
            }

            //check whether user1 will get user2's key value by single search
            if (!_channel.GetChannelUser(_session, out _user))
            {
                _errorCode = ChatError.DataOperation;
                return;
            }
        }
Example #6
0
        private void ProcessOtherModeRequest()
        {
            //we check if the user is operator in channel
            ChatChannelUser user;

            if (!_channel.GetChannelUser(_session, out user))
            {
                _errorCode = ChatError.DataOperation;
                return;
            }

            if (!user.IsChannelOperator)
            {
                _errorCode = ChatError.DataOperation;
                return;
            }
            _channel.Property.SetProperties(user, _modeCmd);
        }