Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override bool CheckLogin()
        {
            string pwd = Password;

            try
            {
                pwd = new DESAlgorithmNew().DecodePwd(pwd, GameEnvironment.Setting.ClientDesDeKey);
            }
            catch (Exception ex)
            {
                TraceLog.WriteError("Decode pwd error:{0}", ex);
            }
            pwd      = CryptoHelper.DES_Encrypt(pwd, GameEnvironment.Setting.ProductDesEnKey);
            Password = pwd;
            //快速登录
            UserID = SnsManager.LoginByDevice(PassportID, Password, DeviceID).ToString();

            if (!string.IsNullOrEmpty(UserID) && UserID != "0")
            {
                UserType = SnsManager.GetUserType(PassportID);
                if (string.IsNullOrEmpty(SessionID))
                {
                    SessionID = GetSessionId();
                }
                return(true);
            }
            //TraceLog.WriteError("LoginByDevice pid:{0},pwd:{1},device:{2},uid:{3}", PassportID, Password, DeviceID, UserID);
            return(false);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override bool CheckLogin()
        {
            //快速登录
            UserID = SnsManager.LoginByDevice(PassportID, Password, DeviceID).ToString();

            if (!string.IsNullOrEmpty(UserID) && UserID != "0")
            {
                UserType = SnsManager.GetUserType(PassportID);
                if (string.IsNullOrEmpty(SessionID))
                {
                    SessionID = GetSessionId();
                }
                return(true);
            }
            //TraceLog.WriteError("LoginByDevice pid:{0},pwd:{1},device:{2},uid:{3}", PassportID, Password, DeviceID, UserID);
            return(false);
        }