Пример #1
0
		/// <summary>
		/// Handler for the GenSpawnData command
		/// </summary>
		private static void OnGenSpawnData( CommandEventArgs e )
		{
			World.Broadcast( BoxConfig.MessageHue, false, "Generating spawn data for Pandora's Box" );

			DateTime start = DateTime.Now;

			SpawnData data = new SpawnData();

			ArrayList Items = new ArrayList( World.Items.Values );

			foreach ( Item item in Items )
			{
				if ( item.GetType() == SpawnerHelper.SpawnerType )
				{
					SpawnEntry entry = SpawnerHelper.SpawnerToData( item );

					if ( entry != null )
						data.m_Spawns.Add( entry );
				}
			}

			data.Save();

			TimeSpan duration = DateTime.Now - start;

			World.Broadcast( BoxConfig.MessageHue, false, string.Format( "Generation complete. The process took {0} seconds", duration.TotalSeconds ) );
		}
Пример #2
0
        /// <summary>
        /// Handler for the GenSpawnData command
        /// </summary>
        private static void OnGenSpawnData(CommandEventArgs e)
        {
            World.Broadcast(BoxConfig.MessageHue, false, "Generating spawn data for Pandora's Box");

            DateTime start = DateTime.Now;

            SpawnData data = new SpawnData();

            ArrayList Items = new ArrayList(World.Items.Values);

            foreach (Item item in Items)
            {
                if (item.GetType() == SpawnerHelper.SpawnerType)
                {
                    SpawnEntry entry = SpawnerHelper.SpawnerToData(item);

                    if (entry != null)
                    {
                        data.m_Spawns.Add(entry);
                    }
                }
            }

            data.Save();

            TimeSpan duration = DateTime.Now - start;

            World.Broadcast(BoxConfig.MessageHue, false, string.Format("Generation complete. The process took {0} seconds", duration.TotalSeconds));
        }