Ejemplo n.º 1
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_));
        }
Ejemplo n.º 2
0
        public Account _getAccount(string nAccountName)
        {
            Account result_    = null;
            uint    accountId_ = AccountB._accountId(nAccountName);

            if (mAccounts.ContainsKey(accountId_))
            {
                result_ = mAccounts[accountId_];
            }
            return(result_);
        }