示例#1
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_CompletedBy = reader.ReadEntity <Mobile>();

                goto case 0;
            }

            case 0:
            {
                m_Level     = (int)reader.ReadInt();
                m_Completed = reader.ReadBool();
                m_Decoder   = reader.ReadEntity <Mobile>();
                m_Map       = reader.ReadMap();
                m_Location  = reader.ReadPoint2D();

                if (version == 0 && m_Completed)
                {
                    m_CompletedBy = m_Decoder;
                }

                break;
            }
            }
        }
示例#2
0
        private void Deserialize(IGenericReader reader, int version)
        {
            Poster       = reader.ReadEntity <Mobile>();
            Subject      = reader.ReadString();
            Time         = reader.ReadDateTime();
            LastPostTime = reader.ReadDateTime();
            reader.ReadBool(); // Has thread
            Thread     = reader.ReadEntity <BulletinMessage>();
            PostedName = reader.ReadString();
            PostedBody = reader.ReadInt();
            PostedHue  = reader.ReadInt();

            PostedEquip = new BulletinEquip[reader.ReadInt()];

            for (var i = 0; i < PostedEquip.Length; ++i)
            {
                PostedEquip[i]._itemID = reader.ReadInt();
                PostedEquip[i]._hue    = reader.ReadInt();
            }

            Lines = new string[reader.ReadInt()];

            for (var i = 0; i < Lines.Length; ++i)
            {
                Lines[i] = reader.ReadString();
            }

            // Moved validation/cleanup to the BB itself
        }
示例#3
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_NextMountAbility = reader.ReadDateTime();
                goto case 0;
            }

            case 0:
            {
                m_Rider        = reader.ReadEntity <Mobile>();
                m_InternalItem = reader.ReadEntity <Item>();

                if (m_InternalItem == null)
                {
                    Delete();
                }

                break;
            }
            }
        }
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Item  = reader.ReadEntity <InternalItem>();
            m_Item2 = reader.ReadEntity <InternalItem2>();
        }
示例#5
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            Chyloth = reader.ReadEntity <Chyloth>();
            Dragon  = reader.ReadEntity <SkeletalDragon>();

            Chyloth?.Delete();
        }
示例#6
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_External = reader.ReadBool();

            m_UpTele    = reader.ReadEntity <SHTeleComponent>();
            m_RightTele = reader.ReadEntity <SHTeleComponent>();
            m_DownTele  = reader.ReadEntity <SHTeleComponent>();
            m_LeftTele  = reader.ReadEntity <SHTeleComponent>();
        }
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                Poster       = reader.ReadEntity <Mobile>();
                Subject      = reader.ReadString();
                Time         = reader.ReadDateTime();
                LastPostTime = reader.ReadDateTime();
                var hasThread = reader.ReadBool();
                Thread     = reader.ReadEntity <BulletinMessage>();
                PostedName = reader.ReadString();
                PostedBody = reader.ReadInt();
                PostedHue  = reader.ReadInt();

                PostedEquip = new BulletinEquip[reader.ReadInt()];

                for (var i = 0; i < PostedEquip.Length; ++i)
                {
                    PostedEquip[i].itemID = reader.ReadInt();
                    PostedEquip[i].hue    = reader.ReadInt();
                }

                Lines = new string[reader.ReadInt()];

                for (var i = 0; i < Lines.Length; ++i)
                {
                    Lines[i] = reader.ReadString();
                }

                if (hasThread && Thread == null)
                {
                    Delete();
                }

                if (version == 0)
                {
                    ValidationQueue <BulletinMessage> .Add(this);
                }

                break;
            }
            }
        }
示例#8
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_KeyValue    = reader.ReadUInt();
                m_Open        = reader.ReadBool();
                m_Locked      = reader.ReadBool();
                m_OpenedID    = reader.ReadInt();
                m_ClosedID    = reader.ReadInt();
                m_OpenedSound = reader.ReadInt();
                m_ClosedSound = reader.ReadInt();
                m_Offset      = reader.ReadPoint3D();
                m_Link        = reader.ReadEntity <BaseDoor>();

                m_Timer = new InternalTimer(this);

                if (m_Open)
                {
                    m_Timer.Start();
                }

                break;
            }
            }
        }
示例#9
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_Focus = reader.ReadEntity <Mobile>();

                if (m_Focus != null)
                {
                    m_AttackTimer = new AttackTimer(this);
                    m_AttackTimer.Start();
                }
                else
                {
                    m_IdleTimer = new IdleTimer(this);
                    m_IdleTimer.Start();
                }

                break;
            }
            }
        }
示例#10
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_Harrower = reader.ReadEntity <Mobile>();

                if (m_Harrower == null)
                {
                    Delete();
                }

                break;
            }
            }

            if (Light != LightType.Circle300)
            {
                Light = LightType.Circle300;
            }
        }
        public VendorInventory(BaseHouse house, IGenericReader reader)
        {
            House = house;

            var version = reader.ReadEncodedInt();

            Owner      = reader.ReadEntity <Mobile>();
            VendorName = reader.ReadString();
            ShopName   = reader.ReadString();

            Items = reader.ReadEntityList <Item>();
            Gold  = reader.ReadInt();

            ExpireTime = reader.ReadDeltaTime();

            if (Items.Count == 0 && Gold == 0)
            {
                Timer.DelayCall(Delete);
            }
            else
            {
                var delay = ExpireTime - Core.Now;
                m_ExpireTimer = new ExpireTimer(this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero);
                m_ExpireTimer.Start();
            }
        }
示例#12
0
 private void Deserialize(IGenericReader reader, int version)
 {
     reader.ReadBool(); // Before Change Over
     _guildName   = reader.ReadString();
     _guildAbbrev = reader.ReadString();
     _guild       = reader.ReadEntity <Guild>();
 }
示例#13
0
        public Orders(BaseFactionGuard guard, IGenericReader reader)
        {
            Guard = guard;

            var version = reader.ReadEncodedInt();

            switch (version)
            {
            case 1:
            {
                Follow = reader.ReadEntity <Mobile>();
                goto case 0;
            }

            case 0:
            {
                var count = reader.ReadEncodedInt();
                m_Reactions = new List <Reaction>(count);

                for (var i = 0; i < count; ++i)
                {
                    m_Reactions.Add(new Reaction(reader));
                }

                Movement = (MovementType)reader.ReadEncodedInt();

                break;
            }
            }
        }
示例#14
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_Addon  = reader.ReadEntity <BaseAddon>();
                m_Offset = reader.ReadPoint3D();

                m_Addon?.OnComponentLoaded(this);

                ApplyLightTo(this);

                break;
            }
            }

            if (version < 1 && Weight == 0)
            {
                Weight = -1;
            }
        }
示例#15
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                Level = (SecureLevel)reader.ReadInt();
                goto case 0;
            }

            case 0:
            {
                Target = reader.ReadEntity <Item>();

                if (version < 1)
                {
                    Level = SecureLevel.Anyone;
                }

                break;
            }
            }
        }
示例#16
0
            public override void Deserialize(IGenericReader reader)
            {
                base.Deserialize(reader);

                var version = reader.ReadInt();

                switch (version)
                {
                case 1:
                {
                    m_Caster = reader.ReadEntity <Mobile>();

                    goto case 0;
                }

                case 0:
                {
                    m_End = reader.ReadDeltaTime();

                    m_Timer = new InternalTimer(this, TimeSpan.Zero, true, true);
                    m_Timer.Start();

                    break;
                }
                }
            }
        protected void InternalDeserialize(IGenericReader reader, bool read)
        {
            base.Deserialize(reader);

            if (!read)
            {
                return;
            }

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_Poisoner = reader.ReadEntity <Mobile>();
                goto case 0;
            }

            case 0:
            {
                m_Poison   = Poison.Deserialize(reader);
                m_Content  = (BeverageType)reader.ReadInt();
                m_Quantity = reader.ReadInt();
                break;
            }
            }
        }
示例#18
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                Boat     = reader.ReadEntity <BaseBoat>();
                Side     = (PlankSide)reader.ReadInt();
                Locked   = reader.ReadBool();
                KeyValue = reader.ReadUInt();

                if (Boat == null)
                {
                    Delete();
                }

                break;
            }
            }

            if (IsOpen)
            {
                m_CloseTimer = new CloseTimer(this);
                m_CloseTimer.Start();
            }
        }
示例#19
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_House = reader.ReadEntity <BaseHouse>();
                goto case 0;
            }

            case 0:
            {
                m_Description = reader.ReadString();
                m_Marked      = reader.ReadBool();
                m_Target      = reader.ReadPoint3D();
                m_TargetMap   = reader.ReadMap();

                CalculateHue();

                break;
            }
            }
        }
示例#20
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                Owner  = reader.ReadEntity <Mobile>();
                Opened = reader.ReadBool();

                if (Owner == null)
                {
                    Delete();
                }

                break;
            }
            }

            if (ItemID == 0xE41)
            {
                ItemID = 0xE7C;
            }
        }
示例#21
0
        public PlayerState(IGenericReader reader, Faction faction, List <PlayerState> owner)
        {
            Faction = faction;
            Owner   = owner;

            var version = reader.ReadEncodedInt();

            switch (version)
            {
            case 1:
            {
                IsActive      = reader.ReadBool();
                LastHonorTime = reader.ReadDateTime();
                goto case 0;
            }

            case 0:
            {
                Mobile = reader.ReadEntity <Mobile>();

                m_KillPoints    = reader.ReadEncodedInt();
                m_MerchantTitle = (MerchantTitle)reader.ReadEncodedInt();

                Leaving = reader.ReadDateTime();

                break;
            }
            }

            Attach();
        }
示例#22
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);
            var version = reader.ReadInt();

            m_Controller = reader.ReadEntity <LeverPuzzleController>();
        }
示例#23
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 3:
            {
                TrappedBy = reader.ReadEntity <Mobile>();
                goto case 2;
            }

            case 2:
            {
                TrapLevel = reader.ReadInt();
                goto case 1;
            }

            case 1:
            {
                TrapStrength = reader.ReadInt();
                goto case 0;
            }

            case 0:
            {
                TrapType = (TrapType)reader.ReadInt();
                break;
            }
            }
        }
示例#24
0
            public override void Deserialize(IGenericReader reader)
            {
                base.Deserialize(reader);

                int version = reader.ReadInt();

                m_Item = reader.ReadEntity <DecorativeDAxeWest>();
            }
示例#25
0
            public override void Deserialize(IGenericReader reader)
            {
                base.Deserialize(reader);

                int version = reader.ReadInt();

                m_Item = reader.ReadEntity <AnkhNorth>();
            }
示例#26
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadEncodedInt();

            m_Gland = reader.ReadEntity <Item>();
        }
示例#27
0
            public override void Deserialize(IGenericReader reader)
            {
                base.Deserialize(reader);

                var version = reader.ReadInt();

                m_Item = reader.ReadEntity <DecorativeSwordNorth>();
            }
示例#28
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            m_Lantern = (Lantern)reader.ReadEntity <Item>();
        }
示例#29
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Teleporter = reader.ReadEntity <TimeoutTeleporter>();
        }
示例#30
0
            public override void Deserialize(IGenericReader reader)
            {
                base.Deserialize(reader);

                int version = reader.ReadInt();

                m_Item = reader.ReadEntity <LargeForgeEast>();
            }