예제 #1
0
        public AccountC _loginAccount(string nName, string nPassward, uint nDeviceType)
        {
            AccountC       result_         = new AccountC();
            AccountService accountService_ = __singleton <AccountService> ._instance();

            __tuple <ErrorCode_, Account> accountInfo_ = accountService_._loginAccount(nName, nPassward, nDeviceType);

            result_.m_tErrorCode = accountInfo_._get_0();
            if (ErrorCode_.mSucess_ == accountInfo_._get_0())
            {
                accountInfo_._get_1()._getAccountC(result_, nDeviceType);
            }
            return(result_);
        }
예제 #2
0
        public __tuple <ErrorCode_, Account> _loginAccount(string nAccountName, string nPassward, uint nDeviceType)
        {
            ErrorCode_ errorCode_ = this._checkDevice(nDeviceType);

            if (ErrorCode_.mSucess_ == errorCode_)
            {
                __tuple <SqlStatus_, AccountB> accountDB_ = this._LoginAccountB(nAccountName);
                errorCode_ = this._getErrorCode(accountDB_._get_0());
                if (ErrorCode_.mSucess_ == errorCode_)
                {
                    AccountB accountB_ = accountDB_._get_1();
                    errorCode_ = accountB_._checkPassward(nPassward);
                }
            }
            Account account_ = null;

            if (ErrorCode_.mSucess_ == errorCode_)
            {
                uint accountId_ = AccountB._accountId(nAccountName);
                account_ = this._getAccount(accountId_);
                if (null == account_)
                {
                    account_ = new Account();
                    account_._setAccountId(accountId_);
                    account_._addDeviceType(nDeviceType);
                    mAccounts[accountId_] = account_;
                }
                account_._setTicks(DateTime.Now.Ticks);
            }
            return(new __tuple <ErrorCode_, Account>(errorCode_, account_));
        }