private void ParseUpdatedList(UUID regionID, Dictionary <string, string> vars)
        {
            IOpenRegionSettingsConnector orsc = DataManager.DataManager.RequestPlugin <IOpenRegionSettingsConnector>();

            if (orsc != null)
            {
                OpenRegionSettings settings = orsc.GetSettings(regionID);
                settings.DefaultDrawDistance           = float.Parse(vars["Default Draw Distance"]);
                settings.ForceDrawDistance             = vars["Force Draw Distance"] != null;
                settings.MaxDragDistance               = float.Parse(vars["Max Drag Distance"]);
                settings.MaximumPrimScale              = float.Parse(vars["Max Prim Scale"]);
                settings.MinimumPrimScale              = float.Parse(vars["Min Prim Scale"]);
                settings.MaximumPhysPrimScale          = float.Parse(vars["Max Physical Prim Scale"]);
                settings.MaximumHollowSize             = float.Parse(vars["Max Hollow Size"]);
                settings.MinimumHoleSize               = float.Parse(vars["Min Hole Size"]);
                settings.MaximumLinkCount              = int.Parse(vars["Max Link Count"]);
                settings.MaximumLinkCountPhys          = int.Parse(vars["Max Link Count Phys"]);
                settings.MaximumInventoryItemsTransfer = int.Parse(vars["Max Inventory Items To Transfer"]);
                settings.TerrainDetailScale            = float.Parse(vars["Terrain Scale"]);
                settings.ShowTags           = int.Parse(vars["Show Tags"]);
                settings.RenderWater        = vars["Render Water"] != null;
                settings.DisplayMinimap     = vars["Allow Minimap"] != null;
                settings.AllowPhysicalPrims = vars["Allow Physical Prims"] != null;
                settings.EnableTeenMode     = vars["Enable Teen Mode"] != null;
                settings.ClampPrimSizes     = vars["Enforce Max Build Constraints"] != null;
                orsc.SetSettings(regionID, settings);
            }
        }
        private Hashtable DispatchOpenRegionSettings(Hashtable m_dhttpMethod, UUID agentID)
        {
            Hashtable responsedata = new Hashtable();

            responsedata["int_response_code"]   = 200; //501; //410; //404;
            responsedata["content_type"]        = "text/plain";
            responsedata["keepalive"]           = false;
            responsedata["str_response_string"] = "";

            IScenePresence SP = m_scene.GetScenePresence(agentID);

            if (SP == null)
            {
                return(responsedata); //They don't exist
            }
            if (!SP.Scene.Permissions.CanIssueEstateCommand(SP.UUID, false))
            {
                return(responsedata); // No permissions
            }
            OSDMap rm = (OSDMap)OSDParser.DeserializeLLSDXml((string)m_dhttpMethod["requestbody"]);

            m_settings.DefaultDrawDistance           = rm["draw_distance"].AsInteger();
            m_settings.ForceDrawDistance             = rm["force_draw_distance"].AsBoolean();
            m_settings.DisplayMinimap                = rm["allow_minimap"].AsBoolean();
            m_settings.AllowPhysicalPrims            = rm["allow_physical_prims"].AsBoolean();
            m_settings.MaxDragDistance               = (float)rm["max_drag_distance"].AsReal();
            m_settings.MinimumHoleSize               = (float)rm["min_hole_size"].AsReal();
            m_settings.MaximumHollowSize             = (float)rm["max_hollow_size"].AsReal();
            m_settings.MaximumInventoryItemsTransfer = rm["max_inventory_items_transfer"].AsInteger();
            m_settings.MaximumLinkCount              = (int)rm["max_link_count"].AsReal();
            m_settings.MaximumLinkCountPhys          = (int)rm["max_link_count_phys"].AsReal();
            m_settings.MaximumPhysPrimScale          = (float)rm["max_phys_prim_scale"].AsReal();
            m_settings.MaximumPrimScale              = (float)rm["max_prim_scale"].AsReal();
            m_settings.MinimumPrimScale              = (float)rm["min_prim_scale"].AsReal();
            m_settings.RenderWater          = rm["render_water"].AsBoolean();
            m_settings.TerrainDetailScale   = (float)rm["terrain_detail_scale"].AsReal();
            m_settings.ShowTags             = (int)rm["show_tags"].AsReal();
            m_settings.MaxGroups            = (int)rm["max_groups"].AsReal();
            m_settings.AllowParcelWindLight = rm["allow_parcel_windlight"].AsBoolean();
            m_settings.EnableTeenMode       = rm["enable_teen_mode"].AsBoolean();
            m_settings.ClampPrimSizes       = rm["enforce_max_build"].AsBoolean();

            IOpenRegionSettingsConnector connector =
                DataManager.DataManager.RequestPlugin <IOpenRegionSettingsConnector>();

            //Update the database
            if (connector != null)
            {
                connector.SetSettings(m_scene.RegionInfo.RegionID, m_settings);
            }

            //Update all clients about changes
            SendToAllClients();

            return(responsedata);
        }
Ejemplo n.º 3
0
        private byte[] DispatchOpenRegionSettings(Stream request, UUID agentID)
        {
            IScenePresence SP = m_scene.GetScenePresence(agentID);

            if (SP == null || !SP.Scene.Permissions.CanIssueEstateCommand(SP.UUID, false))
            {
                return(new byte[0]);
            }

            OSDMap rm = (OSDMap)OSDParser.DeserializeLLSDXml(request);

            m_settings.DefaultDrawDistance           = rm["draw_distance"].AsInteger();
            m_settings.ForceDrawDistance             = rm["force_draw_distance"].AsBoolean();
            m_settings.DisplayMinimap                = rm["allow_minimap"].AsBoolean();
            m_settings.AllowPhysicalPrims            = rm["allow_physical_prims"].AsBoolean();
            m_settings.MaxDragDistance               = (float)rm["max_drag_distance"].AsReal();
            m_settings.MinimumHoleSize               = (float)rm["min_hole_size"].AsReal();
            m_settings.MaximumHollowSize             = (float)rm["max_hollow_size"].AsReal();
            m_settings.MaximumInventoryItemsTransfer = rm["max_inventory_items_transfer"].AsInteger();
            m_settings.MaximumLinkCount              = (int)rm["max_link_count"].AsReal();
            m_settings.MaximumLinkCountPhys          = (int)rm["max_link_count_phys"].AsReal();
            m_settings.MaximumPhysPrimScale          = (float)rm["max_phys_prim_scale"].AsReal();
            m_settings.MaximumPrimScale              = (float)rm["max_prim_scale"].AsReal();
            m_settings.MinimumPrimScale              = (float)rm["min_prim_scale"].AsReal();
            m_settings.RenderWater          = rm["render_water"].AsBoolean();
            m_settings.TerrainDetailScale   = (float)rm["terrain_detail_scale"].AsReal();
            m_settings.ShowTags             = (int)rm["show_tags"].AsReal();
            m_settings.MaxGroups            = (int)rm["max_groups"].AsReal();
            m_settings.AllowParcelWindLight = rm["allow_parcel_windlight"].AsBoolean();
            m_settings.EnableTeenMode       = rm["enable_teen_mode"].AsBoolean();
            m_settings.ClampPrimSizes       = rm["enforce_max_build"].AsBoolean();

            IOpenRegionSettingsConnector connector =
                DataManager.DataManager.RequestPlugin <IOpenRegionSettingsConnector>();

            //Update the database
            if (connector != null)
            {
                connector.SetSettings(m_scene.RegionInfo.RegionID, m_settings);
            }

            //Update all clients about changes
            SendToAllClients();

            return(new byte[0]);
        }
Ejemplo n.º 4
0
        private new void Update()
        {
            if (RegionListBox.SelectedIndex < 0)
            {
                return;
            }
            object item = RegionListBox.Items[RegionListBox.SelectedIndex];

            if (item == null)
            {
                MessageBox.Show("Select a valid region from the list.");
                return;
            }
            if (item.ToString().StartsWith("Online - "))
            {
                item = item.ToString().Remove(0, 9);
            }
            RegionInfo region = m_connector.GetRegionInfo(item.ToString());

            if (region == null)
            {
                MessageBox.Show("You must enter a valid region name!");
                return;
            }
            string oldRegionName    = region.RegionName;
            bool   listNeedsUpdated = oldRegionName != textBox1.Text;

            region.RegionName = textBox1.Text;
            region.RegionID   = CurrentRegionID;
            region.RegionLocX = int.Parse(textBox3.Text) * Constants.RegionSize;
            region.RegionLocY = int.Parse(textBox5.Text) * Constants.RegionSize;

            IPAddress address = IPAddress.Parse("0.0.0.0");

            string[] ports = textBox7.Text.Split(',');

            region.UDPPorts.Clear();
            foreach (string port in ports)
            {
                string tPort = port.Trim();
                int    iPort = 0;
                if (int.TryParse(tPort, out iPort))
                {
                    region.UDPPorts.Add(iPort);
                }
            }
            region.InternalEndPoint = new IPEndPoint(address, region.UDPPorts[0]);

            region.RegionType     = textBox11.Text;
            region.ObjectCapacity = int.Parse(textBox6.Text);
            int maturityLevel = 0;

            if (!int.TryParse(Maturity.Text, out maturityLevel))
            {
                if (Maturity.Text == "Adult")
                {
                    maturityLevel = 2;
                }
                else if (Maturity.Text == "Mature")
                {
                    maturityLevel = 1;
                }
                else //Leave it as PG by default if they do not select a valid option
                {
                    maturityLevel = 0;
                }
            }
            region.RegionSettings.Maturity = maturityLevel;
            region.Disabled       = DisabledEdit.Checked;
            region.NumberStartup  = int.Parse(StartupNumberBox.Text);
            region.RegionSizeX    = int.Parse(RegionSizeX.Text);
            region.RegionSizeY    = int.Parse(RegionSizeY.Text);
            region.Startup        = ConvertIntToStartupType(startupType.SelectedIndex);
            region.InfiniteRegion = einfiniteRegion.Checked;

            if ((region.RegionSizeX % Constants.MinRegionSize) != 0 ||
                (region.RegionSizeY % Constants.MinRegionSize) != 0)
            {
                MessageBox.Show("You must enter a valid region size (multiple of " + Constants.MinRegionSize + "!");
                return;
            }

            m_connector.UpdateRegionInfo(region);
            if (OnNewRegion != null)
            {
                OnNewRegion(region);
            }
            if (listNeedsUpdated)
            {
                RefreshCurrentRegions();
            }
            RegionListBox.SelectedItem = region.RegionName;

            IOpenRegionSettingsConnector orsc = Aurora.DataManager.DataManager.RequestPlugin <IOpenRegionSettingsConnector>();

            if (orsc != null)
            {
                OpenRegionSettings ors = orsc.GetSettings(region.RegionID);
                ors.MaximumPhysPrimScale = float.Parse(eMaxPhysPrim.Text);
                ors.MaximumPrimScale     = float.Parse(eMaxPrimSize.Text);
                orsc.SetSettings(region.RegionID, ors);
            }
        }