Esempio n. 1
0
        public void TestMobileStatusExtendedSelf(ProtocolChanges changes)
        {
            var m = new Mobile(0x1)
            {
                Name = "Random Mobile 1"
            };

            m.DefaultMobileInit();
            m.Str  = 50;
            m.Hits = 100;
            m.Int  = 75;
            m.Mana = 100;
            m.Dex  = 25;
            m.Stam = 100;

            using var ns       = PacketTestUtilities.CreateTestNetState();
            ns.ProtocolChanges = changes;

            var expected = new MobileStatusExtended(m, ns).Compile();

            ns.SendMobileStatus(m, m);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
Esempio n. 2
0
        public void TestMobileStatusExtendedSelf(
            ProtocolChanges changes,
            string version,
            ClientFlags clientFlags,
            Expansion expansion,
            int mobileStatusVersion
            )
        {
            var expansionInfo = ExpansionInfo.GetInfo(Core.Expansion);
            var oldExpansion  = Core.Expansion;
            var oldVersion    = expansionInfo.MobileStatusVersion;

            Core.Expansion = expansion;
            ExpansionInfo.GetInfo(Core.Expansion).MobileStatusVersion = mobileStatusVersion;

            var m = new Mobile((Serial)0x1)
            {
                Name = "Random Mobile 1"
            };

            m.DefaultMobileInit();
            m.Str  = 50;
            m.Hits = 100;
            m.Int  = 75;
            m.Mana = 100;
            m.Dex  = 25;
            m.Stam = 100;

            var ns = PacketTestUtilities.CreateTestNetState();

            ns.ProtocolChanges = changes;
            ns.Version         = new ClientVersion(version);
            ns.Flags           = clientFlags;

            var expected = new MobileStatusExtended(m, ns).Compile();

            ns.SendMobileStatus(m, m);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
            Core.Expansion = oldExpansion;
            expansionInfo.MobileStatusVersion = oldVersion;
        }