/// <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; }
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) }; }
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; }
static TestFakeClient CreateClient(TestAccount acc) { return new TestFakeClient(acc); }
void DeleteAccount() { Setup.AccountPool.Delete((uint)Account.AccountId); TestAccount.Character = null; TestAccount = null; }
public TestFakeClient(TestAccount account) : base(account) { }
static TestFakeClient CreateClient(TestAccount acc) { return(new TestFakeClient(acc)); }