Esempio n. 1
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_Ladder = reader.ReadItem() as LadderController;
					break;
				}
			}
		}
Esempio n. 2
0
		public Arena( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 7:
				{
					m_IsGuarded = reader.ReadBool();

					goto case 6;
				}
				case 6:
				{
					m_Ladder = reader.ReadItem() as LadderController;

					goto case 5;
				}
				case 5:
				{
					m_Tournament = reader.ReadItem() as TournamentController;
					m_Announcer = reader.ReadMobile();

					goto case 4;
				}
				case 4:
				{
					m_Name = reader.ReadString();

					goto case 3;
				}
				case 3:
				{
					m_Zone = reader.ReadRect2D();

					goto case 2;
				}
				case 2:
				{
					m_GateIn = reader.ReadPoint3D();
					m_GateOut = reader.ReadPoint3D();
					m_Teleporter = reader.ReadItem();

					goto case 1;
				}
				case 1:
				{
					m_Players = reader.ReadStrongMobileList();

					goto case 0;
				}
				case 0:
				{
					m_Facet = reader.ReadMap();
					m_Bounds = reader.ReadRect2D();
					m_Outside = reader.ReadPoint3D();
					m_Wall = reader.ReadPoint3D();

					if ( version == 0 )
					{
						reader.ReadBool();
						m_Players = new List<Mobile>();
					}

					m_Active = reader.ReadBool();
					m_Points = new ArenaStartPoints( reader );

					if ( m_Active )
					{
						m_Arenas.Add( this );
						m_Arenas.Sort();
					}

					break;
				}
			}

			if ( m_Zone.Start != Point2D.Zero && m_Zone.End != Point2D.Zero && m_Facet != null )
				m_Region = new SafeZone( m_Zone, m_Outside, m_Facet, m_IsGuarded );

			if ( IsOccupied )
				Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerCallback( Evict ) );

			if ( m_Tournament != null )
				Timer.DelayCall( TimeSpan.Zero, new TimerCallback( AttachToTournament_Sandbox ) );
		}
Esempio n. 3
0
        public Arena(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch (version)
            {
            case 7:
            {
                m_IsGuarded = reader.ReadBool();

                goto case 6;
            }

            case 6:
            {
                m_Ladder = reader.ReadItem() as LadderController;

                goto case 5;
            }

            case 5:
            {
                m_Tournament = reader.ReadItem() as TournamentController;
                m_Announcer  = reader.ReadMobile();

                goto case 4;
            }

            case 4:
            {
                m_Name = reader.ReadString();

                goto case 3;
            }

            case 3:
            {
                m_Zone = reader.ReadRect2D();

                goto case 2;
            }

            case 2:
            {
                m_GateIn     = reader.ReadPoint3D();
                m_GateOut    = reader.ReadPoint3D();
                m_Teleporter = reader.ReadItem();

                goto case 1;
            }

            case 1:
            {
                m_Players = reader.ReadStrongMobileList();

                goto case 0;
            }

            case 0:
            {
                m_Facet   = reader.ReadMap();
                m_Bounds  = reader.ReadRect2D();
                m_Outside = reader.ReadPoint3D();
                m_Wall    = reader.ReadPoint3D();

                if (version == 0)
                {
                    reader.ReadBool();
                    m_Players = new List <Mobile>();
                }

                m_Active = reader.ReadBool();
                m_Points = new ArenaStartPoints(reader);

                if (m_Active)
                {
                    m_Arenas.Add(this);
                    m_Arenas.Sort();
                }

                break;
            }
            }

            if (m_Zone.Start != Point2D.Zero && m_Zone.End != Point2D.Zero && m_Facet != null)
            {
                m_Region = new SafeZone(m_Zone, m_Outside, m_Facet, m_IsGuarded);
            }

            if (IsOccupied)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerCallback(Evict));
            }

            if (m_Tournament != null)
            {
                Timer.DelayCall(TimeSpan.Zero, new TimerCallback(AttachToTournament_Sandbox));
            }
        }