public RegionInfo GetRegionInfo(string regionName)
        {
            object remoteValue = InternalDoRemote(regionName);

            if (remoteValue != null || m_doRemoteOnly)
            {
                return((RegionInfo)remoteValue);
            }

            return(_regionInfoConnector.GetRegionInfo(regionName));
        }
Exemplo n.º 2
0
        private void SearchForRegionByName_Click(object sender, EventArgs e)
        {
            RegionInfo region = m_connector.GetRegionInfo(RegionToFind.Text);

            if (region == null)
            {
                MessageBox.Show("Region was not found!");
                return;
            }
            m_changingRegion = true;
            CurrentRegionID  = region.RegionID;
            textBox11.Text   = region.RegionType;
            textBox6.Text    = region.ObjectCapacity.ToString();
            uint maturityLevel = Util.ConvertAccessLevelToMaturity(region.AccessLevel);

            if (maturityLevel == 0)
            {
                textBox4.Text = "PG";
            }
            else if (maturityLevel == 1)
            {
                textBox4.Text = "Mature";
            }
            else
            {
                textBox4.Text = "Adult";
            }
            DisabledEdit.Checked = region.Disabled;
            if (region.FindExternalAutomatically)
            {
                textBox9.Text = "DEFAULT";
            }
            else
            {
                textBox9.Text = region.ExternalHostName;
            }
            textBox7.Text             = region.HttpPort.ToString();
            textBox3.Text             = (region.RegionLocX / Constants.RegionSize).ToString();
            textBox5.Text             = (region.RegionLocY / Constants.RegionSize).ToString();
            textBox1.Text             = region.RegionName;
            RegionSizeX.Text          = region.RegionSizeX.ToString();
            RegionSizeY.Text          = region.RegionSizeY.ToString();
            startupType.SelectedIndex = ConvertStartupType(region.Startup);
            m_changingRegion          = false;
        }
Exemplo n.º 3
0
        private void SearchForRegionByName_Click(object sender, EventArgs e)
        {
            RegionInfo region = m_connector.GetRegionInfo(RegionToFind.Text);

            if (region == null)
            {
                MessageBox.Show("Region was not found!");
                return;
            }
            ChangeRegionInfo(region);
        }
Exemplo n.º 4
0
        public void UpdateRegionInfo(string oldName, RegionInfo regionInfo)
        {
            IRegionInfoConnector connector = Aurora.DataManager.DataManager.RequestPlugin <IRegionInfoConnector>();

            if (connector != null)
            {
                //Make sure we have this region in the database
                if (connector.GetRegionInfo(oldName) == null)
                {
                    return;
                }
                RegionInfo copy = new RegionInfo();
                //Make an exact copy
                copy.UnpackRegionInfoData(regionInfo.PackRegionInfoData(true));

                //Fix the name of the region so we can delete the old one
                copy.RegionName = oldName;
                DeleteRegion(copy);
                //Now add the new one
                connector.UpdateRegionInfo(regionInfo);
            }
        }
Exemplo n.º 5
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
            {
            }
        }
        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
            {
            }
        }