コード例 #1
1
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				case 0:
				{
					m_MultiID = reader.ReadInt();
					m_Offset = reader.ReadPoint3D();
					m_ShipName = reader.ReadString();

					if ( version == 0 )
						reader.ReadUInt();

					break;
				}
			}

			if ( LootType == LootType.Newbied )
				LootType = LootType.Blessed;

			if ( Weight == 0.0 )
				Weight = 1.0;
		}
コード例 #2
0
ファイル: IconInfo.cs プロジェクト: evildude807/kaltar
        public void Deserialize( GenericReader reader )
        {
            int version = reader.ReadInt();
            switch( version )
            {
                case 1:
                {
                    m_SpellType = ScriptCompiler.FindTypeByName(reader.ReadString());
                    m_Icon      = reader.ReadInt();
                    m_Location      = reader.ReadPoint3D();
                    m_School    = (School)reader.ReadInt();

                    break;
                }
                case 0:
                {
                    int bad = reader.ReadInt();
                    m_Icon    = reader.ReadInt();
                    m_Location    = reader.ReadPoint3D();

                    m_SpellType = null;
                    m_School  = School.Invalid;
                    break;
                }
            }
        }
コード例 #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
            m_AreaStart = reader.ReadPoint3D();
            m_AreaEnd = reader.ReadPoint3D();

            SetRegion();
        }
コード例 #4
0
ファイル: PeerlessInstance.cs プロジェクト: Ravenwolfe/xrunuo
        public PeerlessInstance( GenericReader reader )
        {
            m_Owner = reader.ReadItem<PeerlessPlatform>();
            m_Light = reader.ReadItem();
            m_Map = reader.ReadMap();
            m_EntranceLocation = reader.ReadPoint3D();
            m_BossSpawnLocation = reader.ReadPoint3D();
            m_RegionBounds = reader.ReadRect2D();

            Mobile boss = reader.ReadMobile();

            if ( boss != null )
                boss.Delete();

            Initialize();
        }
コード例 #5
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			int count;
			count = reader.ReadInt();
			for (int i = 0; i < count; i++)
				m_WallCoordinates.Add(reader.ReadPoint3D());

			count = reader.ReadInt();
			for (int i = 0; i < count; i++)
				m_StartLocations.Add(reader.ReadPoint3D());

			m_GameTime = reader.ReadTimeSpan();
			m_RegionControl = reader.ReadItem() as BMregion;
			m_ExitLosers = reader.ReadPoint3D();

			if (version >= 1)
			{
				m_LinkBombs = reader.ReadBool();
				m_ChanceForUpgrade = reader.ReadInt();

				if (version >= 2)
				{
					m_DanageWhileFS = reader.ReadBool();

					if (version >= 3)
						m_WriteScoreboard = reader.ReadBool();
					{
						if (version >= 4)
						{
							m_ExitWinner = reader.ReadPoint3D();
							m_ExitOnDraw = reader.ReadPoint3D();
							m_AutoStart = reader.ReadBool();
							m_KeepOpenJoin = reader.ReadBool();
						}
					}
				}
			}

			m_Running = false;
			m_OpenJoin = false;
		}
コード例 #6
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_Point = reader.ReadPoint3D();
			m_Map = reader.ReadMap();
		}
コード例 #7
0
ファイル: InstanceExitGate.cs プロジェクト: Ravenwolfe/xrunuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            /*int version = */
            reader.ReadInt();

            m_MapDest = reader.ReadMap();
            m_LocDest = reader.ReadPoint3D();
        }
コード例 #8
0
ファイル: Triggers.cs プロジェクト: Ravenwolfe/xrunuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            /*int version = */
            reader.ReadInt();

            m_Dest = reader.ReadPoint3D();
            m_QuestStep = reader.ReadInt();
        }
コード例 #9
0
ファイル: Teleporters.cs プロジェクト: romeov007/imagine-uo
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			
			int version = reader.ReadInt();
			
			m_PointDest = reader.ReadPoint3D();
			m_MapDest = reader.ReadMap();
			m_Locked = reader.ReadBool();
			m_Active = reader.ReadBool();
		}		
コード例 #10
0
ファイル: TeleportRope.cs プロジェクト: Crome696/ServUO
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
					ToLocation = reader.ReadPoint3D();
					ToMap = reader.ReadMap();
					break;
			}
		}
コード例 #11
0
ファイル: Place.cs プロジェクト: jasegiffin/JustUO
		private void Deserialize(GenericReader reader)
		{
			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
					{
						_Map = reader.ReadMap();
						_Location = reader.ReadPoint3D();
						break;
					}
			}
		}
コード例 #12
0
        public void Load( GenericReader reader )
        {
            int version = reader.ReadInt();

            if ( version >= 1 )
            {
                c_Hue = reader.ReadInt();
                c_Name = reader.ReadString();
            }

            c_TypeString = reader.ReadString();
            c_ItemID = reader.ReadInt();
            c_Location = reader.ReadPoint3D();
            c_Map = reader.ReadMap();
        }
コード例 #13
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            /*int version = */
            reader.ReadInt();

            m_Addon = reader.ReadItem() as BaseAddonContainer;
            m_Offset = reader.ReadPoint3D();

            if ( m_Addon != null )
                m_Addon.OnComponentLoaded( this );

            AddonComponent.ApplyLightTo( this );
        }
コード例 #14
0
			public void Deserialize(GenericReader reader)
			{
				Point = reader.ReadPoint3D();
				Island = reader.ReadInt();
				NumLinks = reader.ReadInt();
				
				Links = new SectorNode[8];
				Distances = new int[8];

				for (int i = 0; i < NumLinks; i++)
				{
					int x = reader.ReadInt(), y = reader.ReadInt();
					Links[i] = m_Nodes[x, y];
					Distances[i] = reader.ReadInt();
				}
			}
コード例 #15
0
ファイル: HornOfRetreat.cs プロジェクト: Ravenwolfe/xrunuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    {
                        m_DestLoc = reader.ReadPoint3D();
                        m_DestMap = reader.ReadMap();
                        m_Charges = reader.ReadInt();
                        break;
                    }
            }
        }
コード例 #16
0
ファイル: BaseBoatDeed.cs プロジェクト: Ravenwolfe/xrunuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    {
                        m_MultiID = reader.ReadInt();
                        m_Offset = reader.ReadPoint3D();

                        break;
                    }
            }
        }
コード例 #17
0
ファイル: Rune.cs プロジェクト: Crome696/ServUO
        // Legacy... binary serialization only used in v1.00, deserialization preserved to migrate data.
        public static SR_Rune Deserialize(GenericReader reader, int version)
        {
            SR_Rune rune = null;

            string name = reader.ReadString();
            bool isRunebook = reader.ReadBool();

            Map targetMap = reader.ReadMap();
            Point3D targetLoc = reader.ReadPoint3D();

            if (isRunebook)
                rune = new SR_Rune(name, isRunebook);
            else
                rune = new SR_Rune(name, targetMap, targetLoc);

            int count = reader.ReadInt();
            for (int i = 0; i < count; i++)
                rune.AddRune(SR_Rune.Deserialize(reader, version));

            return rune;
        }
コード例 #18
0
ファイル: Runebook.cs プロジェクト: guy489/runuot2a
        public RunebookEntry( GenericReader reader )
        {
            int version = reader.ReadByte();

            switch ( version )
            {
                case 1:
                {
                    m_House = reader.ReadItem() as BaseHouse;
                    goto case 0;
                }
                case 0:
                {
                    m_Location = reader.ReadPoint3D();
                    m_Map = reader.ReadMap();
                    m_Description = reader.ReadString();

                    break;
                }
            }
        }
コード例 #19
0
ファイル: BombingRun.cs プロジェクト: greeduomacro/divinity
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_BombHome = reader.ReadPoint3D();

                    m_Duration = reader.ReadTimeSpan();

                    m_TeamInfo = new BRTeamInfo[reader.ReadEncodedInt()];

                    for ( int i = 0; i < m_TeamInfo.Length; ++i )
                        m_TeamInfo[i] = new BRTeamInfo( i, reader );

                    break;
                }
            }
        }
コード例 #20
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			m_DestLoc = reader.ReadPoint3D();
			m_DestMap = reader.ReadMap();
			m_AllowCreatures = reader.ReadBool();
			m_TelePets = reader.ReadBool();
		}
コード例 #21
0
ファイル: ToolbarInfo.cs プロジェクト: jasegiffin/JustUO
		private void Deserialize(GenericReader reader)
		{
			int version = reader.ReadInt();

			_Dimensions = new Point2D();
			_Entries = new List<string>();
			_Points = new List<Point3D>();

			switch (version)
			{
				case 0:
					{
						_Font = reader.ReadInt();
						_Phantom = reader.ReadBool();
						_Stealth = reader.ReadBool();
						_Reverse = reader.ReadBool();
						_Lock = reader.ReadBool();

						_Dimensions = reader.ReadPoint2D();

						int count = reader.ReadInt();

						for (int i = 0; i < count; i++)
						{
							_Entries.Add(reader.ReadString());
						}

						_Skin = reader.ReadInt();

						count = reader.ReadInt();

						for (int i = 0; i < count; i++)
						{
							_Points.Add(reader.ReadPoint3D());
						}

						break;
					}
			}
		}
コード例 #22
0
        public static bool Deserialize( GenericReader reader )
        {
            bool success = false;

            Map map = null;
            Point3D location = new Point3D();

            MegaSpawner megaSpawner = new MegaSpawner( true );

            try
            {
                int version = reader.ReadInt();

                if ( version >= 1 )
                {
                    location = reader.ReadPoint3D();
                    map = reader.ReadMap();
                    megaSpawner.Active = reader.ReadBool();

                    megaSpawner.Imported = reader.ReadString();
                    megaSpawner.ImportVersion = reader.ReadString();
                    megaSpawner.ContainerSpawn = (Container) reader.ReadItem();
                    megaSpawner.Workspace = reader.ReadBool();

                    int count = reader.ReadInt();

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EntryList.Add( reader.ReadString() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.SpawnRangeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.WalkRangeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                    {
                        int amount = reader.ReadInt();

                        if ( amount == 0 )
                            amount = 1;

                        megaSpawner.AmountList.Add( amount );
                    }

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MinDelayList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MaxDelayList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.SpawnTypeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.ActivatedList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EventRangeList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EventKeywordList.Add( reader.ReadString() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.KeywordCaseSensitiveList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.TriggerEventNowList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EventAmbushList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.BeginTimeBasedList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.EndTimeBasedList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.GroupSpawnList.Add( reader.ReadBool() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MinStackAmountList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MaxStackAmountList.Add( reader.ReadInt() );

                    for ( int i = 0; i < count; i++ )
                        megaSpawner.MovableList.Add( reader.ReadBool() );

                    if ( version >= 2 )
                    {
                        for ( int i = 0; i < count; i++ )
                            megaSpawner.MinDespawnList.Add( reader.ReadInt() );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.MaxDespawnList.Add( reader.ReadInt() );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.DespawnList.Add( reader.ReadBool() );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.DespawnGroupList.Add( reader.ReadBool() );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.DespawnTimeExpireList.Add( reader.ReadBool() );
                    }
                    else
                    {
                        for ( int i = 0; i < count; i++ )
                            megaSpawner.MinDespawnList.Add( 1800 );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.MaxDespawnList.Add( 3600 );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.DespawnList.Add( (bool) false );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.DespawnGroupList.Add( (bool) false );

                        for ( int i = 0; i < count; i++ )
                            megaSpawner.DespawnTimeExpireList.Add( (bool) true );
                    }

                    int settingsCount = reader.ReadInt();

                    if ( version >= 3 )
                    {
                        for ( int i = 0; i < settingsCount; i++ )
                        {
                            ArrayList List = new ArrayList();

                            Setting setting = (Setting) reader.ReadInt();

                            List.Add( setting );

                            switch ( setting )
                            {
                                case Setting.OverrideIndividualEntries:
                                {
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadBool() );
                                    List.Add( reader.ReadBool() );
                                    List.Add( (SpawnType) reader.ReadInt() );
                                    List.Add( reader.ReadString() );
                                    List.Add( reader.ReadBool() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadBool() );
                                    List.Add( reader.ReadBool() );
                                    List.Add( reader.ReadBool() );

                                    break;
                                }
                                case Setting.AddItem:
                                {
                                    List.Add( reader.ReadString() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadString() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );

                                    break;
                                }
                                case Setting.AddContainer:
                                {
                                    List.Add( reader.ReadString() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadString() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );

                                    int settingCount = reader.ReadInt();

                                    for ( int j = 6; j < settingCount; j++ )
                                    {
                                        ArrayList ItemsList = new ArrayList();

                                        ItemsList.Add( reader.ReadString() );
                                        ItemsList.Add( reader.ReadInt() );
                                        ItemsList.Add( reader.ReadInt() );

                                        List.Add( ItemsList );
                                    }

                                    break;
                                }
                            }

                            megaSpawner.SettingsList.Add( List );
                        }
                    }
                    else
                    {
                        for ( int i = 0; i < settingsCount; i++ )
                            megaSpawner.SettingsList.Add( reader.ReadString() );

                        megaSpawner.ConvertOldSettings();
                    }
                }

                if ( megaSpawner.Workspace )
                {
                    megaSpawner.Delete();
                }
                else
                {
                    megaSpawner.MoveToWorld( location, map );
                    megaSpawner.Start();

                    if ( megaSpawner.Imported != "" )
                        MC.FileImportAdd( megaSpawner.Imported, megaSpawner.ImportVersion );

                    megaSpawner.CompileSettings();
                    megaSpawner.CheckEntryErrors();

                    megaSpawner.SettingsList.Sort( new MC.SettingsSorter() );

                    if ( megaSpawner.OverrideIndividualEntries )
                    {
                        for ( int i = 0; i < megaSpawner.OverrideAmount; i++ )
                        {
                            megaSpawner.OverrideRespawnEntryList.Add( "" );
                            megaSpawner.OverrideRespawnTimeList.Add( 0 );
                            megaSpawner.OverrideSpawnCounterList.Add( DateTime.Now );
                            megaSpawner.OverrideSpawnTimeList.Add( 0 );
                            megaSpawner.OverrideDespawnTimeList.Add( 0 );
                        }
                    }
                    else
                    {
                        for ( int i = 0; i < megaSpawner.EntryList.Count; i++ )
                        {
                            ArrayList respawnEntryList = new ArrayList();
                            ArrayList respawnTimeList = new ArrayList();
                            ArrayList spawnCounterList = new ArrayList();
                            ArrayList spawnTimeList = new ArrayList();
                            ArrayList respawnOnSaveList = new ArrayList();
                            ArrayList despawnTimeList = new ArrayList();

                            for ( int j = 0; j < (int) megaSpawner.AmountList[i]; j++ )
                            {
                                respawnEntryList.Add( (string) megaSpawner.EntryList[i] );
                                respawnTimeList.Add( 0 );
                                spawnCounterList.Add( DateTime.Now );
                                spawnTimeList.Add( 0 );
                                respawnOnSaveList.Add( (bool) false );
                                despawnTimeList.Add( 0 );
                            }

                            megaSpawner.RespawnEntryList.Add( respawnEntryList );
                            megaSpawner.RespawnTimeList.Add( respawnTimeList );
                            megaSpawner.SpawnCounterList.Add( spawnCounterList );
                            megaSpawner.SpawnTimeList.Add( spawnTimeList );
                            megaSpawner.RespawnOnSaveList.Add( respawnOnSaveList );
                            megaSpawner.DespawnTimeList.Add( despawnTimeList );
                            megaSpawner.SpawnedEntries.Add( new ArrayList() );
                            megaSpawner.LastMovedList.Add( new ArrayList() );
                        }
                    }

                    megaSpawner.Respawn();
                }

                success = true;
            }
            catch
            {
                if ( megaSpawner != null )
                    megaSpawner.Delete();
            }

            return success;
        }
コード例 #23
0
ファイル: PortalKey.cs プロジェクト: OurUO/ouruo-server
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
            m_creation = reader.ReadDateTime();
            m_EndTime = reader.ReadDateTime();
            m_RemainTime = reader.ReadTimeSpan();
            m_map = reader.ReadMap();
            m_Destination = reader.ReadPoint3D();
            m_Active = reader.ReadBool();
            m_Expires = reader.ReadBool();
        }
コード例 #24
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			int count;

			switch ( version )
			{
				case 14:
				{
					m_RelativeBanLocation = reader.ReadPoint3D();
					goto case 13;
				}
				case 13: // removed ban location serialization
				case 12:
				{
					m_VendorRentalContracts = reader.ReadItemList();
					m_InternalizedVendors = reader.ReadMobileList();

					int relocatedCount = reader.ReadEncodedInt();
					for ( int i = 0; i < relocatedCount; i++ )
					{
						Point3D relLocation = reader.ReadPoint3D();
						IEntity entity = World.FindEntity( reader.ReadInt() );

						if ( entity != null )
							m_RelocatedEntities.Add( new RelocatedEntity( entity, relLocation ) );
					}

					int inventoryCount = reader.ReadEncodedInt();
					for ( int i = 0; i < inventoryCount; i++ )
					{
						VendorInventory inventory = new VendorInventory( this, reader );
						m_VendorInventories.Add( inventory );
					}

					goto case 11;
				}
				case 11:
				{
					m_LastRefreshed = reader.ReadDateTime();
					m_RestrictDecay = reader.ReadBool();
					goto case 10;
				}
				case 10: // just a signal for updates
				case 9:
				{
					m_Visits = reader.ReadInt();
					goto case 8;
				}
				case 8:
				{
					m_Price = reader.ReadInt();
					goto case 7;
				}
				case 7:
				{
					m_Access = reader.ReadMobileList();
					goto case 6;
				}
				case 6:
				{
					m_BuiltOn = reader.ReadDateTime();
					m_LastTraded = reader.ReadDateTime();
					goto case 5;
				}
				case 5: // just removed fields
				case 4:
				{
					m_Addons = reader.ReadItemList();
					goto case 3;
				}
				case 3:
				{
					count = reader.ReadInt();
					m_Secures = new ArrayList( count );

					for ( int i = 0; i < count; ++i )
					{
						SecureInfo info = new SecureInfo( reader );

						if ( info.Item != null )
						{
							info.Item.IsSecure = true;
							m_Secures.Add( info );
						}
					}

					goto case 2;
				}
				case 2:
				{
					m_Public = reader.ReadBool();
					goto case 1;
				}
				case 1:
				{
					if ( version < 13 )
						reader.ReadPoint3D(); // house ban location
					goto case 0;
				}
				case 0:
				{
					if ( version < 14 )
						m_RelativeBanLocation = this.BaseBanLocation;

					if ( version < 12 )
					{
						m_VendorRentalContracts = new ArrayList();
						m_InternalizedVendors = new ArrayList();
					}

					if ( version < 4 )
						m_Addons = new ArrayList();

					if ( version < 7 )
						m_Access = new ArrayList();

					if ( version < 8 )
						m_Price = DefaultPrice;

					m_Owner = reader.ReadMobile();

					if ( version < 5 )
					{
						count = reader.ReadInt();

						for(int i=0;i<count;i++)
							reader.ReadRect2D();
					}

					UpdateRegion();

					m_CoOwners = reader.ReadMobileList();
					m_Friends = reader.ReadMobileList();
					m_Bans = reader.ReadMobileList();

					m_Sign = reader.ReadItem() as HouseSign;
					m_Trash = reader.ReadItem() as TrashBarrel;

					m_Doors = reader.ReadItemList();
					m_LockDowns = reader.ReadItemList();

					for ( int i = 0; i < m_LockDowns.Count; ++i )
						((Item)m_LockDowns[i]).IsLockedDown = true;

					for ( int i = 0; i < m_VendorRentalContracts.Count; ++i )
						((Item)m_VendorRentalContracts[i]).IsLockedDown = true;

					if ( version < 3 )
					{
						ArrayList items = reader.ReadItemList();
						m_Secures = new ArrayList( items.Count );

						for ( int i = 0; i < items.Count; ++i )
						{
							Container c = items[i] as Container;

							if ( c != null )
							{
								c.IsSecure = true;
								m_Secures.Add( new SecureInfo( c, SecureLevel.CoOwners ) );
							}
						}
					}

					m_MaxLockDowns = reader.ReadInt();
					m_MaxSecures = reader.ReadInt();

					if ( (Map == null || Map == Map.Internal) && Location == Point3D.Zero )
						Delete();

					if ( m_Owner != null )
					{
						List<BaseHouse> list = null;
						m_Table.TryGetValue( m_Owner, out list );

						if ( list == null )
							m_Table[m_Owner] = list = new List<BaseHouse>();

						list.Add( this );
					}
					break;
				}
			}

			if ( version <= 1 )
				ChangeSignType( 0xBD2 );//private house, plain brass sign

			if ( version < 10 )
			{
				/* NOTE: This can exceed the house lockdown limit. It must be this way, because
				 * we do not want players' items to decay without them knowing. Or not even
				 * having a chance to fix it themselves.
				 */

				Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixLockdowns_Sandbox ) );
			}

			if ( version < 11 )
				m_LastRefreshed = DateTime.Now + TimeSpan.FromHours( 24 * Utility.RandomDouble() );

			if ( !CheckDecay() )
			{
				if ( RelocatedEntities.Count > 0 )
					Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RestoreRelocatedEntities ) );

				if ( m_Owner == null && m_Friends.Count == 0 && m_CoOwners.Count == 0 )
					Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( Delete ) );
			}
		}
コード例 #25
0
ファイル: Soldier.cs プロジェクト: justdanofficial/khaeros
 public static void Deserialize(GenericReader reader, ReportInfo info)
 {
     info.IsPlayer = reader.ReadBool();
     info.IsSoldier = reader.ReadBool();
     info.Name = reader.ReadString();
     info.IsFemale = reader.ReadBool();
     info.Height = reader.ReadInt();
     info.Weight = reader.ReadInt();
     info.Age = reader.ReadString();
     info.Nation = (Nation)reader.ReadInt();
     info.Description = reader.ReadString();
     info.Guild = reader.ReadString();
     info.Location = reader.ReadPoint3D();
     info.Thievery = reader.ReadBool();
     info.Assault = reader.ReadBool();
     info.IsOptional = reader.ReadBool();
     info.ReporterName = reader.ReadString();
     info.Information = reader.ReadString();
     info.TimeOfReport = reader.ReadString();
 }
コード例 #26
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			m_SleeperBedBody = (SleeperBedBody)reader.ReadItem();
			m_Player = reader.ReadMobile();
			m_Active = reader.ReadBool();
			m_Location = reader.ReadPoint3D();
			m_Sleeping = reader.ReadBool();
			m_Owner = reader.ReadMobile();

			m_Debug = false;
		}
コード例 #27
0
ファイル: Item.cs プロジェクト: BackupTheBerlios/sunuo-svn
        public static BounceInfo Deserialize( GenericReader reader )
        {
            if ( reader.ReadBool() )
            {
                Map map = reader.ReadMap();
                Point3D loc = reader.ReadPoint3D();
                Point3D worldLoc = reader.ReadPoint3D();

                object parent;

                Serial serial = reader.ReadInt();

                if ( serial.IsItem )
                    parent = World.FindItem( serial );
                else if ( serial.IsMobile )
                    parent = World.FindMobile( serial );
                else
                    parent = null;

                return new BounceInfo( map, loc, worldLoc, parent );
            }
            else
            {
                return null;
            }
        }
コード例 #28
0
ファイル: Item.cs プロジェクト: BackupTheBerlios/sunuo-svn
        public virtual void Deserialize( GenericReader reader )
        {
            int version = reader.ReadInt();

            SetLastMoved();

            switch ( version )
            {
                case 7:
                case 6:
                {
                    SaveFlag flags = (SaveFlag)reader.ReadInt();

                    if ( version < 7 )
                    {
                        LastMoved = reader.ReadDeltaTime();
                    }
                    else
                    {
                        int minutes = reader.ReadEncodedInt();

                        try{ LastMoved = Core.Now - TimeSpan.FromMinutes( minutes ); }
                        catch{ LastMoved = Core.Now; }
                    }

                    if ( GetSaveFlag( flags, SaveFlag.Direction ) )
                        m_Direction = (Direction)reader.ReadByte();

                    if ( GetSaveFlag( flags, SaveFlag.Bounce ) )
                        m_Bounce = BounceInfo.Deserialize( reader );

                    if ( GetSaveFlag( flags, SaveFlag.LootType ) )
                        m_LootType = (LootType)reader.ReadByte();

                    int x = 0, y = 0, z = 0;

                    if ( GetSaveFlag( flags, SaveFlag.LocationFull ) )
                    {
                        x = reader.ReadEncodedInt();
                        y = reader.ReadEncodedInt();
                        z = reader.ReadEncodedInt();
                    }
                    else
                    {
                        if ( GetSaveFlag( flags, SaveFlag.LocationByteXY ) )
                        {
                            x = reader.ReadByte();
                            y = reader.ReadByte();
                        }
                        else if ( GetSaveFlag( flags, SaveFlag.LocationShortXY ) )
                        {
                            x = reader.ReadShort();
                            y = reader.ReadShort();
                        }

                        if ( GetSaveFlag( flags, SaveFlag.LocationSByteZ ) )
                            z = reader.ReadSByte();
                    }

                    m_Location = new Point3D( x, y, z );

                    if ( GetSaveFlag( flags, SaveFlag.ItemID ) )
                        m_ItemID = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Hue ) )
                        m_Hue = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Amount ) )
                        m_Amount = reader.ReadEncodedInt();
                    else
                        m_Amount = 1;

                    if ( GetSaveFlag( flags, SaveFlag.Layer ) )
                        m_Layer = (Layer)reader.ReadByte();

                    if ( GetSaveFlag( flags, SaveFlag.Name ) )
                        m_Name = string.Intern(reader.ReadString());

                    if ( GetSaveFlag( flags, SaveFlag.Parent ) )
                    {
                        Serial parent = reader.ReadInt();

                        if ( parent.IsMobile )
                            m_Parent = World.FindMobile( parent );
                        else if ( parent.IsItem )
                            m_Parent = World.FindItem( parent );
                        else
                            m_Parent = null;

                        if ( m_Parent == null && (parent.IsMobile || parent.IsItem) )
                            Delete();
                    }

                    if ( GetSaveFlag( flags, SaveFlag.Items ) )
                        m_Items = reader.ReadItemList();
                    //else
                    //	m_Items = new ArrayList( 1 );

                    if ( GetSaveFlag( flags, SaveFlag.IntWeight ) )
                        m_Weight = reader.ReadEncodedInt();
                    else if ( GetSaveFlag( flags, SaveFlag.WeightNot1or0 ) )
                        m_Weight = reader.ReadDouble();
                    else if ( GetSaveFlag( flags, SaveFlag.WeightIs0 ) )
                        m_Weight = 0.0;
                    else
                        m_Weight = 1.0;

                    if ( GetSaveFlag( flags, SaveFlag.Map ) )
                        m_Map = reader.ReadMap();
                    else
                        m_Map = Map.Internal;

                    if ( GetSaveFlag( flags, SaveFlag.Visible ) )
                        SetFlag( ImplFlag.Visible, reader.ReadBool() );
                    else
                        SetFlag( ImplFlag.Visible, true );

                    if ( GetSaveFlag( flags, SaveFlag.Movable ) )
                        SetFlag( ImplFlag.Movable, reader.ReadBool() );
                    else
                        SetFlag( ImplFlag.Movable, true );

                    if ( GetSaveFlag( flags, SaveFlag.Stackable ) )
                        SetFlag( ImplFlag.Stackable, reader.ReadBool() );

                    if ( GetSaveFlag( flags, SaveFlag.ImplFlags ) )
                        m_Flags = (ImplFlag)reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.InsuredFor ) )
                        /*m_InsuredFor = */reader.ReadMobile();

                    if ( GetSaveFlag( flags, SaveFlag.BlessedFor ) )
                        m_BlessedFor = reader.ReadMobile();

                    if ( GetSaveFlag( flags, SaveFlag.HeldBy ) )
                        m_HeldBy = reader.ReadMobile();

                    if ( GetSaveFlag( flags, SaveFlag.SavedFlags ) )
                        m_SavedFlags = reader.ReadEncodedInt();

                    if ( m_Map != null && m_Parent == null )
                        m_Map.OnEnter( this );

                    break;
                }
                case 5:
                {
                    SaveFlag flags = (SaveFlag)reader.ReadInt();

                    LastMoved = reader.ReadDeltaTime();

                    if ( GetSaveFlag( flags, SaveFlag.Direction ) )
                        m_Direction = (Direction)reader.ReadByte();

                    if ( GetSaveFlag( flags, SaveFlag.Bounce ) )
                        m_Bounce = BounceInfo.Deserialize( reader );

                    if ( GetSaveFlag( flags, SaveFlag.LootType ) )
                        m_LootType = (LootType)reader.ReadByte();

                    if ( GetSaveFlag( flags, SaveFlag.LocationFull ) )
                        m_Location = reader.ReadPoint3D();

                    if ( GetSaveFlag( flags, SaveFlag.ItemID ) )
                        m_ItemID = reader.ReadInt();

                    if ( GetSaveFlag( flags, SaveFlag.Hue ) )
                        m_Hue = reader.ReadInt();

                    if ( GetSaveFlag( flags, SaveFlag.Amount ) )
                        m_Amount = reader.ReadInt();
                    else
                        m_Amount = 1;

                    if ( GetSaveFlag( flags, SaveFlag.Layer ) )
                        m_Layer = (Layer)reader.ReadByte();

                    if ( GetSaveFlag( flags, SaveFlag.Name ) )
                        m_Name = string.Intern(reader.ReadString());

                    if ( GetSaveFlag( flags, SaveFlag.Parent ) )
                    {
                        Serial parent = reader.ReadInt();

                        if ( parent.IsMobile )
                            m_Parent = World.FindMobile( parent );
                        else if ( parent.IsItem )
                            m_Parent = World.FindItem( parent );
                        else
                            m_Parent = null;

                        if ( m_Parent == null && (parent.IsMobile || parent.IsItem) )
                            Delete();
                    }

                    if ( GetSaveFlag( flags, SaveFlag.Items ) )
                        m_Items = reader.ReadItemList();
                    //else
                    //	m_Items = new ArrayList( 1 );

                    if ( GetSaveFlag( flags, SaveFlag.IntWeight ) )
                        m_Weight = reader.ReadEncodedInt();
                    else if ( GetSaveFlag( flags, SaveFlag.WeightNot1or0 ) )
                        m_Weight = reader.ReadDouble();
                    else if ( GetSaveFlag( flags, SaveFlag.WeightIs0 ) )
                        m_Weight = 0.0;
                    else
                        m_Weight = 1.0;

                    if ( GetSaveFlag( flags, SaveFlag.Map ) )
                        m_Map = reader.ReadMap();
                    else
                        m_Map = Map.Internal;

                    if ( GetSaveFlag( flags, SaveFlag.Visible ) )
                        SetFlag( ImplFlag.Visible, reader.ReadBool() );
                    else
                        SetFlag( ImplFlag.Visible, true );

                    if ( GetSaveFlag( flags, SaveFlag.Movable ) )
                        SetFlag( ImplFlag.Movable, reader.ReadBool() );
                    else
                        SetFlag( ImplFlag.Movable, true );

                    if ( GetSaveFlag( flags, SaveFlag.Stackable ) )
                        SetFlag( ImplFlag.Stackable, reader.ReadBool() );

                    if ( m_Map != null && m_Parent == null )
                        m_Map.OnEnter( this );

                    break;
                }
                case 4: // Just removed variables
                case 3:
                {
                    m_Direction = (Direction)reader.ReadInt();

                    goto case 2;
                }
                case 2:
                {
                    m_Bounce = BounceInfo.Deserialize( reader );
                    LastMoved = reader.ReadDeltaTime();

                    goto case 1;
                }
                case 1:
                {
                    m_LootType = (LootType) reader.ReadByte();//m_Newbied = reader.ReadBool();

                    goto case 0;
                }
                case 0:
                {
                    m_Location = reader.ReadPoint3D();
                    m_ItemID = reader.ReadInt();
                    m_Hue = reader.ReadInt();
                    m_Amount = reader.ReadInt();
                    m_Layer = (Layer) reader.ReadByte();
                    m_Name = reader.ReadString();
                    if (m_Name != null)
                        m_Name = string.Intern(m_Name);

                    Serial parent = reader.ReadInt();

                    if ( parent.IsMobile )
                        m_Parent = World.FindMobile( parent );
                    else if ( parent.IsItem )
                        m_Parent = World.FindItem( parent );
                    else
                        m_Parent = null;

                    if ( m_Parent == null && (parent.IsMobile || parent.IsItem) )
                        Delete();

                    int count = reader.ReadInt();

                    if ( count > 0 )
                    {
                        m_Items = new ArrayList( count );

                        for ( int i = 0; i < count; ++i )
                        {
                            Item item = reader.ReadItem();

                            if ( item != null )
                                m_Items.Add( item );
                        }
                    }

                    m_Weight = reader.ReadDouble();

                    if ( version <= 3 )
                    {
                        /*m_TotalItems =*/ reader.ReadInt();
                        /*m_TotalWeight =*/ reader.ReadInt();
                        /*m_TotalGold =*/ reader.ReadInt();
                    }

                    m_Map = reader.ReadMap();
                    SetFlag( ImplFlag.Visible, reader.ReadBool() );
                    SetFlag( ImplFlag.Movable, reader.ReadBool() );

                    if ( version <= 3 )
                        /*m_Deleted =*/ reader.ReadBool();

                    Stackable = reader.ReadBool();

                    if ( m_Map != null && m_Parent == null )
                        m_Map.OnEnter( this );

                    break;
                }
            }

            if ( m_HeldBy != null )
                Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixHolding_Sandbox ) );
        }
コード例 #29
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            ToolbarHelper.Infos = this;

            int count = reader.ReadInt();

            // Version 1.3
            int font = 0;
            bool phantom = true, stealth = false, reverse = false, locked = true;

            // Version 1.0
            string account;
            List<int> dimensions;
            List<string> entries;
            int subcount, skin;
            List<Point3D> points;
            for(int i = 0; i < count; i++)
            {
                switch(version)
                {
                    case 130:
                    {
                        font = reader.ReadInt();
                        phantom = reader.ReadBool();
                        stealth = reader.ReadBool();
                        reverse = reader.ReadBool();
                        locked = reader.ReadBool();
                        goto case 100;
                    }
                    default:
                    case 100:
                    {
                        account = reader.ReadString();

                        dimensions = new List<int>();

                        subcount = reader.ReadInt();
                        for(int j = 0; j < subcount; j++)
                            dimensions.Add(reader.ReadInt());

                        entries = new List<string>();

                        subcount = reader.ReadInt();
                        for(int k = 0; k < subcount; k++)
                            entries.Add(reader.ReadString());

                        skin = reader.ReadInt();

                        points = new List<Point3D>();

                        subcount = reader.ReadInt();
                        for(int l = 0; l < subcount; l++)
                            points.Add(reader.ReadPoint3D());

                        break;
                    }
                }

                ToolbarInfo info = new ToolbarInfo(account, dimensions, entries, skin, points, font, new bool[]{ phantom, stealth, reverse, locked });
            }
        }
コード例 #30
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Active = reader.ReadBool();
            m_RecordScores = reader.ReadBool();
            m_SendGlobalMessages = reader.ReadBool();
            m_Wue = reader.ReadInt();
            m_Wid = reader.ReadInt();
            if (reader.ReadBool() == true)
                Hidden = false;
            m_CheckTime = reader.ReadBool();
            m_FactionOnly = reader.ReadBool();
            m_AreaStart = reader.ReadPoint3D();
            m_AreaEnd = reader.ReadPoint3D();

            Locations = new Point3D[10];
            for (int i = 0; i < 10; i++)
                Locations[i] = reader.ReadPoint3D();

            DuelSystem.Duellers.Add(this);
        }