public RegionInfo[] LoadRegions()
        {
            //Grab old region files
            if(m_default)
                FindOldRegionFiles();

            Aurora.Framework.IRegionInfoConnector conn = Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IRegionInfoConnector>();
            if (conn == null)
                return null;
            RegionInfo[] infos = conn.GetRegionInfos();
            if (infos.Length == 0 && m_default)
            {
                //Load up the GUI to make a new region
                RegionManager manager = new RegionManager(true, m_openSim);
                System.Windows.Forms.Application.Run(manager);
                return LoadRegions();
            }
            else if (infos.Length == 0)
                return null;
            else
                return infos;
        }
        public RegionInfo[] LoadRegions()
        {
            //Grab old region files
            if(m_default)
                FindOldRegionFiles();

            IRegionInfoConnector conn = DataManager.RequestPlugin<IRegionInfoConnector>();
            if (conn == null)
                return null;
            RegionInfo[] infos = conn.GetRegionInfos(true);
            if (infos.Length == 0 && m_default)
            {
                //Load up the GUI to make a new region
                try
                {
                    if(m_noGUI)
                    {
                        RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
                        system.Initialise (m_configSource, m_openSim);
                        system.AddRegion (new string[0]);
                    }
                    else
                    {
                        bool done = false, errored = false;
                        Thread t = new Thread(delegate()
                            {
                                try
                                {
                                    RegionManager manager = new RegionManager(true, true, m_openSim);
                                    Application.Run(manager);
                                    done = true;
                                }
                                catch
                                {
                                    errored = true;
                                }
                            });
                        t.SetApartmentState(ApartmentState.STA);
                        t.Start();
                        while (!done)
                            if (errored)
                                throw new Exception();
                            Thread.Sleep(100);
                    }
                }
                catch
                {
                    //Probably no winforms
                    RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
                    system.Initialise (m_configSource, m_openSim);
                    system.AddRegion (new string[0]);
                }
                return LoadRegions();
            }
            return infos.Length == 0 ? null : infos;
        }
 protected void StartRegionManagerThread()
 {
     try
     {
         RegionManager manager = new RegionManager(false, false, m_openSim);
         Application.Run(manager);
     }
     catch(Exception ex)
     {
         MainConsole.Instance.Output("Failed to start the region manager: " + ex);
     }
 }
 /// <summary>
 /// Creates a new region based on the parameters specified.   This will ask the user questions on the console
 /// </summary>
 /// <param name="cmd">0,1,region name, region XML file</param>
 public void AddRegion(string[] cmd)
 {
     try
     {
         if(m_noGUI)
         {
             RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
             system.Initialise (m_configSource, m_openSim);
             system.AddRegion (new string[0]);
         }
         else
         {
             bool done = false, errored = false;
             Thread t = new Thread(delegate()
             {
                 try
                 {
                     RegionManager manager = new RegionManager(false, true, m_openSim);
                     Application.Run(manager);
                     done = true;
                 }
                 catch
                 {
                     errored = true;
                 }
             });
             t.SetApartmentState(ApartmentState.STA);
             t.Start();
             while (!done)
                 if (errored)
                     throw new Exception();
                 Thread.Sleep(100);
         }
     }
     catch
     {
         //Probably no winforms
         RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
         system.Initialise (m_configSource, m_openSim);
         system.AddRegion (new string[0]);
     }
 }
 public void AddRegion(IOpenSimBase baseOS, string[] cmd)
 {
     if (!m_default)
         return;
     RegionManager manager = new RegionManager(true, (OpenSimBase)baseOS);
     System.Windows.Forms.Application.Run(manager);
 }
Beispiel #6
0
 protected void StartRegionManagerThread()
 {
     RegionManager manager = new RegionManager(false, m_openSim);
     System.Windows.Forms.Application.Run(manager);
 }
 /// <summary>
 /// Creates a new region based on the parameters specified.   This will ask the user questions on the console
 /// </summary>
 /// <param name="module"></param>
 /// <param name="cmd">0,1,region name, region XML file</param>
 public void AddRegion(string[] cmd)
 {
     try
     {
         if(m_noGUI)
         {
             RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
             system.Initialise (m_configSource, m_openSim);
             system.AddRegion (new string[0]);
         }
         else
         {
             RegionManager manager = new RegionManager (false, true, m_openSim);
             System.Windows.Forms.Application.Run (manager);
         }
     }
     catch
     {
         //Probably no winforms
         RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
         system.Initialise (m_configSource, m_openSim);
         system.AddRegion (new string[0]);
     }
 }
        public RegionInfo[] LoadRegions()
        {
            //Grab old region files
            if(m_default)
                FindOldRegionFiles();

            IRegionInfoConnector conn = DataManager.RequestPlugin<IRegionInfoConnector>();
            if (conn == null)
                return null;
            RegionInfo[] infos = conn.GetRegionInfos(true);
            if (infos.Length == 0 && m_default)
            {
                //Load up the GUI to make a new region
                try
                {
                    if(m_noGUI)
                    {
                        RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
                        system.Initialise (m_configSource, m_openSim);
                        system.AddRegion (new string[0]);
                    }
                    else
                    {
                        RegionManager manager = new RegionManager (true, false, m_openSim);
                        System.Windows.Forms.Application.Run (manager);
                    }
                }
                catch
                {
                    //Probably no winforms
                    RegionLoaderFileSystem system = new RegionLoaderFileSystem ();
                    system.Initialise (m_configSource, m_openSim);
                    system.AddRegion (new string[0]);
                }
                return LoadRegions();
            }
            else if (infos.Length == 0)
                return null;
            else
                return infos;
        }
 /// <summary>
 /// Creates a new region based on the parameters specified.   This will ask the user questions on the console
 /// </summary>
 /// <param name="module"></param>
 /// <param name="cmd">0,1,region name, region XML file</param>
 public void AddRegion(string module, string[] cmd)
 {
     RegionManager manager = new RegionManager(false, true, m_openSim);
     System.Windows.Forms.Application.Run(manager);
 }