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 RegionManager manager = new RegionManager(true, false, m_openSim); System.Windows.Forms.Application.Run(manager); return(LoadRegions()); } else if (infos.Length == 0) { return(null); } else { return(infos); } }
private void RefreshCurrentRegions() { RegionListBox.Items.Clear(); RegionInfo[] regionInfos = m_connector.GetRegionInfos(false); foreach (RegionInfo r in regionInfos) { RegionListBox.Items.Add(r.RegionName); } }
public List <RegionInfo> GetRegionInfos(bool nonDisabledOnly) { object remoteValue = InternalDoRemote(nonDisabledOnly); if (remoteValue != null || m_doRemoteOnly) { return((List <RegionInfo>)remoteValue); } return(new List <RegionInfo>(_regionInfoConnector.GetRegionInfos(nonDisabledOnly))); }
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); return(infos.Length == 0 ? null : infos); }
private void RefreshCurrentRegions() { RegionInfo[] regionInfos = m_connector.GetRegionInfos(false); List <RegionInfo> infos = new List <RegionInfo> (regionInfos); infos.Sort(delegate(RegionInfo a, RegionInfo b) { if (!a.Disabled || !b.Disabled) { return(a.Disabled.CompareTo(b.Disabled));//At the top } return(a.RegionName.CompareTo(b.RegionName)); }); RegionListBox.Items.Clear(); foreach (RegionInfo r in infos) { RegionListBox.Items.Add(!r.Disabled ? "Online - " + r.RegionName : r.RegionName); } }
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); }