/// <summary> /// /// </summary> private static void SQL_ReloadAccount(ExecuteInfoNull sqlInfo) { s_UnitOfWork.ReloadChangedObjects(); XPQuery <Account> accounts = new XPQuery <Account>(s_UnitOfWork); var accountList = from account in accounts select account; // 账号是不会删除的,人物会删除,所以只需要添加即可。 foreach (Account account in accountList) { WowAccount wowAccount = new WowAccount(); wowAccount.AccountGuid = account.Oid; wowAccount.AccountName = account.AccountName.ToUpper(); wowAccount.Password = account.Password; wowAccount.Locked = account.IsLocked; wowAccount.Banned = account.IsBanned; wowAccount.AccessLevel = (AccessLevel)account.GMLevel; wowAccount.IsTBC = account.IsTBC; s_WowAccountManager.Add(wowAccount.AccountName, wowAccount); } LOGs.WriteLine(LogMessageType.MSG_INFO, "Wow帐号:读取数据库内的 Wow 帐号完成"); }
/// <summary> /// /// </summary> public Realm_RequestSessionResult( uint iSerial, WowAccount account, SecureRemotePassword srp ) : base( (long)RealmOpCode.CMSG_REQUEST_SESSION_RESULT, 0 /* ProcessNet.REALM_HEAD_SIZE + ? */ ) { WriterStream.Write( (byte)RealmOpCode.CMSG_REQUEST_SESSION_RESULT ); // ×ֶαàºÅ WriterStream.Write( (ushort)0 ); // ×Ö¶ÎÊ£Óà´óС ////////////////////////////////////////////////////////////////////////// WriterStream.Write( (uint)iSerial ); WriterStream.Write( true ); // ³É¹¦ WriterStream.Write( (uint)account.AccountGuid ); WriterStream.Write( (int)account.AccessLevel ); WriterStream.Write( (bool)account.IsTBC ); byte[] byteSessionKey = srp.SessionKey.GetBytes( 40 ); WriterStream.Write( byteSessionKey, 0, 40 ); ////////////////////////////////////////////////////////////////////////// WriterStream.Seek( 1, SeekOrigin.Begin ); WriterStream.Write( (ushort)( WriterStream.Length - ProcessNet.REALM_HEAD_SIZE ) ); }
/// <summary> /// /// </summary> private static void SQL_ReloadAccount( ExecuteInfoNull sqlInfo ) { s_UnitOfWork.ReloadChangedObjects(); XPQuery<Account> accounts = new XPQuery<Account>( s_UnitOfWork ); var accountList = from account in accounts select account; // 账号是不会删除的,人物会删除,所以只需要添加即可。 foreach ( Account account in accountList ) { WowAccount wowAccount = new WowAccount(); wowAccount.AccountGuid = account.Oid; wowAccount.AccountName = account.AccountName.ToUpper(); wowAccount.Password = account.Password; wowAccount.Locked = account.IsLocked; wowAccount.Banned = account.IsBanned; wowAccount.AccessLevel = (AccessLevel)account.GMLevel; wowAccount.IsTBC = account.IsTBC; s_WowAccountManager.Add( wowAccount.AccountName, wowAccount ); } LOGs.WriteLine( LogMessageType.MSG_INFO, "Wow帐号:读取数据库内的 Wow 帐号完成" ); }