Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strAccountName"></param>
        /// <param name="strLastIP"></param>
        internal static void UpdateAccountLastIP(string strAccountName, string strLastIP)
        {
            UpdateAccountLastIPSQL updateAccountLastIPSQL            = new UpdateAccountLastIPSQL(strAccountName, strLastIP);
            WaitExecuteInfo <UpdateAccountLastIPSQL> waitExecuteInfo = new WaitExecuteInfo <UpdateAccountLastIPSQL>(updateAccountLastIPSQL, WowAccountHandler.SQL_UpdateAccountLastIP);

            ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        private static void SQL_UpdateAccountLastIP(UpdateAccountLastIPSQL sqlInfo)
        {
            XPQuery <Account> accounts = new XPQuery <Account>(OneDatabase.Session);

            var accountList = from account in accounts
                              where account.AccountName == sqlInfo.AccountsName
                              select account;

            // 可能数据已添加,但没有刷新。
            if (accountList.Count() == 0)
            {
                s_UnitOfWork.ReloadChangedObjects();

                accounts = new XPQuery <Account>(OneDatabase.Session);

                accountList = from account in accounts
                              where account.AccountName == sqlInfo.AccountsName
                              select account;
            }

            foreach (Account account in accountList)
            {
                account.LastIP = sqlInfo.LastIP;
                account.Save();

                OneDatabase.Session.CommitChanges();

                break;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="strAccountName"></param>
        /// <param name="strLastIP"></param>
        internal static void UpdateAccountLastIP( string strAccountName, string strLastIP )
        {
            UpdateAccountLastIPSQL updateAccountLastIPSQL = new UpdateAccountLastIPSQL( strAccountName, strLastIP );
            WaitExecuteInfo<UpdateAccountLastIPSQL> waitExecuteInfo = new WaitExecuteInfo<UpdateAccountLastIPSQL>( updateAccountLastIPSQL, WowAccountHandler.SQL_UpdateAccountLastIP );

            ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue( waitExecuteInfo );
        }
        /// <summary>
        /// 
        /// </summary>
        private static void SQL_UpdateAccountLastIP( UpdateAccountLastIPSQL sqlInfo )
        {
            XPQuery<Account> accounts = new XPQuery<Account>( OneDatabase.Session );

            var accountList = from account in accounts
                              where account.AccountName == sqlInfo.AccountsName
                              select account;

            // 可能数据已添加,但没有刷新。
            if ( accountList.Count() == 0 )
            {
                s_UnitOfWork.ReloadChangedObjects();

                accounts = new XPQuery<Account>( OneDatabase.Session );

                accountList = from account in accounts
                              where account.AccountName == sqlInfo.AccountsName
                              select account;
            }

            foreach ( Account account in accountList )
            {
                account.LastIP = sqlInfo.LastIP;
                account.Save();

                OneDatabase.Session.CommitChanges();

                break;
            }
        }