/// <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]); } }
private void FindOldRegionFiles() { try { //Load the file loader and set it up and make sure that we pull any regions from it RegionLoaderFileSystem system = new RegionLoaderFileSystem(); system.Initialise(m_configSource, m_openSim); RegionInfo[] regionsToConvert = system.LoadRegions(); if (regionsToConvert == null) { return; } //Now load all the regions into the database IRegionInfoConnector conn = DataManager.RequestPlugin <IRegionInfoConnector>(); foreach (RegionInfo info in regionsToConvert) { conn.UpdateRegionInfo(info); } //Make sure all the regions got saved bool foundAll = true; foreach (RegionInfo info in regionsToConvert) { if (conn.GetRegionInfo(info.RegionID) == null) { foundAll = false; } } //Something went really wrong here... so lets not destroy anything if (foundAll && regionsToConvert.Length != 0) { MessageBox.Show("All region .ini and .xml files have been successfully converted to the new region loader style."); } } catch { } }
public void CreateRegion() { try { if (m_noGUI) { RegionLoaderFileSystem system = new RegionLoaderFileSystem(); system.Initialise(m_configSource, m_openSim); system.AddRegion(new string[0]); } else { RegionManager.StartSynchronously(true, RegionManagerPage.CreateRegion, m_openSim.ConfigSource, m_openSim.ApplicationRegistry.RequestModuleInterface <IRegionManagement>()); } } 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 { 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; }
private void FindOldRegionFiles() { try { //Load the file loader and set it up and make sure that we pull any regions from it RegionLoaderFileSystem system = new RegionLoaderFileSystem(); system.Initialise(m_configSource, m_openSim); RegionInfo[] regionsToConvert = system.InternalLoadRegions(true); if (regionsToConvert == null) return; bool changed = false; //Now load all the regions into the database IRegionInfoConnector conn = DataManager.RequestPlugin<IRegionInfoConnector>(); foreach (RegionInfo info in regionsToConvert) { RegionInfo alreadyExists; if ((alreadyExists = conn.GetRegionInfo (info.RegionID)) == null) { changed = true; if (!info.UDPPorts.Contains (info.InternalEndPoint.Port)) info.UDPPorts.Add (info.InternalEndPoint.Port); info.Disabled = false; conn.UpdateRegionInfo (info); } else { //Update some atributes... alreadyExists.RegionName = info.RegionName; alreadyExists.RegionLocX = info.RegionLocX; alreadyExists.RegionLocY = info.RegionLocY; alreadyExists.RegionSizeX = info.RegionSizeX; alreadyExists.RegionSizeY = info.RegionSizeY; alreadyExists.Disabled = false; if (!alreadyExists.UDPPorts.Contains (info.InternalEndPoint.Port)) alreadyExists.UDPPorts.Add (info.InternalEndPoint.Port); conn.UpdateRegionInfo (alreadyExists); } } //Make sure all the regions got saved bool foundAll = true; foreach (RegionInfo info in regionsToConvert) { if (conn.GetRegionInfo(info.RegionID) == null) foundAll = false; } //We found some new ones, they are all loaded if (foundAll && regionsToConvert.Length != 0 && changed) { try { MessageBox.Show ("All region .ini and .xml files have been successfully converted to the new region loader style."); MessageBox.Show ("To change your region settings, type 'open region manager' on the console, and a GUI will pop up for you to use."); DialogResult t = Utilities.InputBox ("Remove .ini files", "Do you want to remove your old .ini files?"); if (t == DialogResult.OK) system.DeleteAllRegionFiles (); } catch { //For people who only have consoles, no winforms MainConsole.Instance.Output ("All region .ini and .xml files have been successfully converted to the new region loader style."); MainConsole.Instance.Output ("To change your region settings, well, you don't have Mono-Winforms installed. Get that, stick with just modifying the .ini files, or get something to modify the region database that isn't a GUI."); } } } catch { } }
/// <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]); } }
/// <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="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.StartSynchronously(true, true, m_openSim.ConfigSource, m_openSim.ApplicationRegistry.RequestModuleInterface<IRegionManagement>()); } } catch { //Probably no winforms RegionLoaderFileSystem system = new RegionLoaderFileSystem (); system.Initialise (m_configSource, m_openSim); system.AddRegion (new string[0]); } }
private void FindOldRegionFiles() { try { //Load the file loader and set it up and make sure that we pull any regions from it RegionLoaderFileSystem system = new RegionLoaderFileSystem(); system.Initialise(m_configSource, m_openSim); RegionInfo[] regionsToConvert = system.InternalLoadRegions(true); if (regionsToConvert == null) { return; } bool changed = false; //Now load all the regions into the database IRegionInfoConnector conn = DataManager.RequestPlugin <IRegionInfoConnector>(); foreach (RegionInfo info in regionsToConvert) { RegionInfo alreadyExists; if ((alreadyExists = conn.GetRegionInfo(info.RegionID)) == null) { changed = true; if (!info.UDPPorts.Contains(info.InternalEndPoint.Port)) { info.UDPPorts.Add(info.InternalEndPoint.Port); } info.Disabled = false; conn.UpdateRegionInfo(info); } else { //Update some atributes... alreadyExists.RegionName = info.RegionName; alreadyExists.RegionLocX = info.RegionLocX; alreadyExists.RegionLocY = info.RegionLocY; alreadyExists.RegionSizeX = info.RegionSizeX; alreadyExists.RegionSizeY = info.RegionSizeY; alreadyExists.Disabled = false; if (!alreadyExists.UDPPorts.Contains(info.InternalEndPoint.Port)) { alreadyExists.UDPPorts.Add(info.InternalEndPoint.Port); } conn.UpdateRegionInfo(alreadyExists); } } //Make sure all the regions got saved bool foundAll = true; foreach (RegionInfo info in regionsToConvert) { if (conn.GetRegionInfo(info.RegionID) == null) { foundAll = false; } } //We found some new ones, they are all loaded if (foundAll && regionsToConvert.Length != 0 && changed) { try { MessageBox.Show("All region .ini and .xml files have been successfully converted to the new region loader style."); MessageBox.Show("To change your region settings, type 'open region manager' on the console, and a GUI will pop up for you to use."); DialogResult t = Utilities.InputBox("Remove .ini files", "Do you want to remove your old .ini files?"); if (t == DialogResult.OK) { system.DeleteAllRegionFiles(); } } catch { //For people who only have consoles, no winforms MainConsole.Instance.Output("All region .ini and .xml files have been successfully converted to the new region loader style."); MainConsole.Instance.Output("To change your region settings, well, you don't have Mono-Winforms installed. Get that, stick with just modifying the .ini files, or get something to modify the region database that isn't a GUI."); } } } catch { } }
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); }
private void FindOldRegionFiles() { try { //Load the file loader and set it up and make sure that we pull any regions from it RegionLoaderFileSystem system = new RegionLoaderFileSystem(); system.Initialise(m_configSource, m_openSim); RegionInfo[] regionsToConvert = system.LoadRegions(); if (regionsToConvert == null) return; //Now load all the regions into the database IRegionInfoConnector conn = DataManager.RequestPlugin<IRegionInfoConnector>(); foreach (RegionInfo info in regionsToConvert) { conn.UpdateRegionInfo(info); } //Make sure all the regions got saved bool foundAll = true; foreach (RegionInfo info in regionsToConvert) { if (conn.GetRegionInfo(info.RegionID) == null) foundAll = false; } //Something went really wrong here... so lets not destroy anything if (foundAll && regionsToConvert.Length != 0) { MessageBox.Show("All region .ini and .xml files have been successfully converted to the new region loader style."); } } catch { } }