Пример #1
0
        /// <summary>
        /// 注册用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static Message CheckedUserToRegister(ref Base_Users user)
        {
            //用户帐号
            Message msg = GameWebRules.CheckedAccounts(user.Username);

            if (!msg.Success)
            {
                return(msg);
            }

            //登录密码
            msg = GameWebRules.CheckedPassword(user.Password);
            if (!msg.Success)
            {
                return(msg);
            }

            //属性编码

            user.Username      = Utility.HtmlEncode(Utils.TextFilter.FilterScript(user.Username));
            user.PreLogintime  = DateTime.Now;
            user.PreLoginIP    = GameRequest.GetUserIP( );
            user.LastLogintime = DateTime.Now;
            user.LastLoginIP   = user.LastLoginIP;
            user.AgentID       = user.AgentID;
            user.Username      = user.Username.Replace("&", "").Replace("#", "");

            return(new Message(true));
        }
Пример #2
0
        public static Message CheckedUserLogon(Base_Users user)
        {
            Message message = GameWebRules.CheckedAccounts(user.Username);

            if (!message.Success)
            {
                return(message);
            }
            message = GameWebRules.CheckedPassword(user.Password);
            if (!message.Success)
            {
                return(message);
            }
            user.Username = TextUtility.SqlEncode(user.Username);
            user.Username = Utility.HtmlEncode(TextFilter.FilterScript(user.Username));
            return(new Message(true));
        }
Пример #3
0
        public static Message CheckedUserToRegister(ref Base_Users user)
        {
            Message message = GameWebRules.CheckedAccounts(user.Username);

            if (!message.Success)
            {
                return(message);
            }
            message = GameWebRules.CheckedPassword(user.Password);
            if (!message.Success)
            {
                return(message);
            }
            user.Username      = Utility.HtmlEncode(TextFilter.FilterScript(user.Username));
            user.PreLogintime  = System.DateTime.Now;
            user.PreLoginIP    = GameRequest.GetUserIP();
            user.LastLogintime = System.DateTime.Now;
            user.LastLoginIP   = user.LastLoginIP;
            user.Username      = user.Username.Replace("&", "").Replace("#", "");
            return(new Message(true));
        }