Exemple #1
0
		/// <summary>
		/// Creates a new Account and adds it to the pool.
		/// </summary>
		/// <returns></returns>
		public TestAccount CreateAccount()
		{
			Assert.IsNotNull(DefaultRole);

			var index = m_accounts.GetFreeIndex();			
			var acc = new TestAccount(DefaultRole, index);
			
			ArrayUtil.Set(ref m_accounts, index, acc);

			return acc;
		}
Exemple #2
0
		public TestCharacter(TestAccount acc, CharacterRecord record, Archetype archetype, bool isNew)
		{
			Create(acc, PrepareRecord(acc, record, archetype, isNew), CreateClient(acc));
			record.ExploredZones = new byte[UpdateFieldMgr.ExplorationZoneFieldSize * 4];
			acc.Characters.Add(record);
			acc.Character = this;

			BaseHealth = 1000;
			Health = 1000;
			Assert.AreEqual(1000, BaseHealth);
			Asser.GreaterOrEqual(MaxHealth, BaseHealth);
			Assert.AreEqual(1000, Health);
			Assert.IsFalse(string.IsNullOrEmpty(Name));

			SpecProfiles = new[] { WCell.RealmServer.Talents.SpecProfile.NewSpecProfile(this, 0) };
		}
Exemple #3
0
		public static CharacterRecord PrepareRecord(TestAccount acc, CharacterRecord record, Archetype archetype, bool isNew)
		{
			var race = archetype.Race;

			record.Name = "TestChar" + record.EntityLowId;
			record.AccountId = acc.AccountId;
			record.Created = DateTime.Now;
			record.New = isNew;
			record.TotalPlayTime = 0;
			record.LevelPlayTime = 0;
			record.TutorialFlags = new byte[32];
			record.SetupNewRecord(archetype);

			record.CreateAndFlush();

			return record;
		}
Exemple #4
0
		static TestFakeClient CreateClient(TestAccount acc)
		{
			return new TestFakeClient(acc);
		}
Exemple #5
0
 void DeleteAccount()
 {
     Setup.AccountPool.Delete((uint)Account.AccountId);
     TestAccount.Character = null;
     TestAccount = null;
 }
Exemple #6
0
		public TestFakeClient(TestAccount account)
			: base(account)
		{
		}
Exemple #7
0
 static TestFakeClient CreateClient(TestAccount acc)
 {
     return(new TestFakeClient(acc));
 }