Exemple #1
0
        public void TestPartyMemberList()
        {
            var leader = new Mobile(0x1024u);

            leader.DefaultMobileInit();

            var member = new Mobile(0x2048u);

            member.DefaultMobileInit();

            var p = new Party(leader);

            p.Add(member);

            var expected = new PartyMemberList(p).Compile();

            using var ns = PacketTestUtilities.CreateTestNetState();
            ns.SendPartyMemberList(p);

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

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
        public void TestCorpseContainerPacket(ProtocolChanges changes)
        {
            var m = new Mobile((Serial)0x1);

            m.DefaultMobileInit();

            var weapon = new VikingSword();

            m.EquipItem(weapon);

            var c = new Corpse(m, m.Items);

            var ns = PacketTestUtilities.CreateTestNetState();

            ns.ProtocolChanges = changes;

            var expected = (ns.ContainerGridLines ? (Packet) new CorpseContent6017(m, c) : new CorpseContent(m, c)).Compile();

            ns.SendCorpseContent(m, c);

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

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }