/// <summary>
        /// Request sim data based on arbitrary key/value
        /// </summary>
        private RegionProfileData RequestSimData(Uri gridserverUrl, string gridserverSendkey, string keyField, string keyValue)
        {
            Hashtable requestData = new Hashtable();

            requestData[keyField]  = keyValue;
            requestData["authkey"] = gridserverSendkey;
            ArrayList SendParams = new ArrayList();

            SendParams.Add(requestData);

            string         methodName = "simulator_data_request";
            XmlRpcRequest  GridReq    = new XmlRpcRequest(methodName, SendParams);
            XmlRpcResponse GridResp   = GridReq.Send(Util.XmlRpcRequestURI(gridserverUrl.ToString(), methodName), 5000);

            Hashtable responseData = (Hashtable)GridResp.Value;

            RegionProfileData simData = null;

            if (!responseData.ContainsKey("error"))
            {
                uint            locX             = Convert.ToUInt32((string)responseData["region_locx"]);
                uint            locY             = Convert.ToUInt32((string)responseData["region_locy"]);
                string          externalHostName = (string)responseData["sim_ip"];
                uint            simPort          = Convert.ToUInt32((string)responseData["sim_port"]);
                uint            httpPort         = Convert.ToUInt32((string)responseData["http_port"]);
                uint            remotingPort     = Convert.ToUInt32((string)responseData["remoting_port"]);
                UUID            regionID         = new UUID((string)responseData["region_UUID"]);
                string          regionName       = (string)responseData["region_name"];
                byte            access           = Convert.ToByte((string)responseData["access"]);
                ProductRulesUse product          = (ProductRulesUse)Convert.ToInt32(responseData["product"]);

                string outsideIp = null;
                if (responseData.ContainsKey("outside_ip"))
                {
                    outsideIp = (string)responseData["outside_ip"];
                }

                simData = RegionProfileData.Create(regionID, regionName, locX, locY, externalHostName, simPort, httpPort, remotingPort, access, product, outsideIp);
            }

            return(simData);
        }
示例#2
0
        public static RegionProfileData Create(UUID regionID, string regionName, uint locX, uint locY, string externalHostName, 
            uint regionPort, uint httpPort, uint remotingPort, byte access, ProductRulesUse product, string outsideIP)
        {
            RegionProfileData regionProfile;
            regionProfile = new RegionProfileData();
            regionProfile.regionLocX = locX;
            regionProfile.regionLocY = locY;
            regionProfile.regionHandle =
                Utils.UIntsToLong((regionProfile.regionLocX * Constants.RegionSize),
                                  (regionProfile.regionLocY*Constants.RegionSize));
            regionProfile.serverHostName = externalHostName;
            regionProfile.serverPort = regionPort;
            regionProfile.httpPort = httpPort;
            regionProfile.remotingPort = remotingPort;

            regionProfile.UUID = regionID;
            regionProfile.regionName = regionName;
            regionProfile.maturity = access;
            regionProfile.product = product;
            regionProfile._outsideIp = outsideIP;

            return regionProfile;
        }
示例#3
0
        public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
        {
            switch (configuration_key)
            {
            case "sim_UUID":
                RegionID       = (UUID)configuration_result;
                originRegionID = (UUID)configuration_result;
                break;

            case "sim_name":
                RegionName = (string)configuration_result;
                break;

            case "sim_location_x":
                m_regionLocX = (uint)configuration_result;
                break;

            case "sim_location_y":
                m_regionLocY = (uint)configuration_result;
                break;

            case "datastore":
                DataStore = (string)configuration_result;
                break;

            case "internal_ip_address":
                IPAddress address = (IPAddress)configuration_result;
                m_internalEndPoint = new IPEndPoint(address, 0);
                break;

            case "internal_ip_port":
                m_internalEndPoint.Port = (int)configuration_result;
                break;

            case "allow_alternate_ports":
                m_allow_alternate_ports = (bool)configuration_result;
                break;

            case "external_host_name":
                if ((string)configuration_result != "SYSTEMIP")
                {
                    m_externalHostName = (string)configuration_result;
                }
                else
                {
                    m_externalHostName = Util.GetLocalHost().ToString();
                }
                break;

            case "master_avatar_uuid":
                MasterAvatarAssignedUUID = (UUID)configuration_result;
                break;

            case "master_avatar_first":
                MasterAvatarFirstName = (string)configuration_result;
                break;

            case "master_avatar_last":
                MasterAvatarLastName = (string)configuration_result;
                break;

            case "master_avatar_pass":
                MasterAvatarSandboxPassword = (string)configuration_result;
                break;

            case "lastmap_uuid":
                lastMapUUID = (UUID)configuration_result;
                break;

            case "lastmap_refresh":
                lastMapRefresh = (string)configuration_result;
                break;

            case "nonphysical_prim_max":
                PrimLimitDefault = (int)configuration_result;
                break;

            case "physical_prim_max":
                m_physPrimMax = (int)configuration_result;
                break;

            case "clamp_prim_size":
                m_clampPrimSize = (bool)configuration_result;
                break;

            case "object_capacity":
                m_objectCapacity = (int)configuration_result;
                break;

            case "region_product":
                switch ((int)configuration_result)
                {
                case 1:
                    m_product = ProductRulesUse.FullUse;
                    break;

                case 2:
                    m_product = ProductRulesUse.OceanUse;
                    break;

                case 3:
                    m_product = ProductRulesUse.ScenicUse;
                    break;

                case 4:
                    m_product = ProductRulesUse.PlusUse;
                    break;

                case 0:
                default:
                    m_product = ProductRulesUse.UnknownUse;
                    break;
                }
                ApplyProductRules();
                break;

            case "region_access":
                switch ((int)configuration_result)
                {
                case 1:
                    m_productAccess = ProductAccessUse.PlusOnly;
                    break;

                case 0:
                default:
                    m_productAccess = ProductAccessUse.Anyone;
                    break;
                }
                break;

            case "outside_ip":
                OutsideIP = (string)configuration_result;
                if (String.IsNullOrEmpty(OutsideIP))
                {
                    OutsideIP = null;
                }
                break;
            }

            return(true);
        }
示例#4
0
        public void ApplyProductRules()
        {
            ProductRulesUse use = m_product;

            if (use == ProductRulesUse.UnknownUse)
            {
                use = ProductRulesUse.FullUse;
            }

            switch (use)
            {
            case ProductRulesUse.FullUse:
            default:
                m_primLimit         = m_primLimitDefault;      // 0 = default, read from region file
                m_rezzers           = ProductRulesWho.Default; // owners define restrictions
                m_partnerRez        = false;
                m_setHome           = ProductRulesWho.Default;
                m_ownersAllowed     = ProductRulesWho.Default;
                m_groupTagsAllowed  = true;
                m_salesAllowed      = true;
                m_enforcePrimLimits = true;
                m_maxAutoReturn     = 0;    // no limits on auto-return
                break;

            case ProductRulesUse.ScenicUse:
                m_primLimit         = SCENIC_REGION_PRIM_LIMIT;
                m_rezzers           = ProductRulesWho.OnlyEO;
                m_partnerRez        = true;
                m_setHome           = ProductRulesWho.OnlyEO;
                m_ownersAllowed     = ProductRulesWho.OnlyEO;
                m_groupTagsAllowed  = false;
                m_salesAllowed      = false;
                m_enforcePrimLimits = true;
                m_maxAutoReturn     = 60;    // minutes
                break;

            case ProductRulesUse.OceanUse:                     // same as Full regions for now
                m_primLimit         = m_primLimitDefault;      // 0 = default, read from region file
                m_rezzers           = ProductRulesWho.Default; // owners define restrictions
                m_partnerRez        = false;
                m_setHome           = ProductRulesWho.Default;
                m_ownersAllowed     = ProductRulesWho.OnlyEO;
                m_groupTagsAllowed  = true;
                m_salesAllowed      = false;
                m_enforcePrimLimits = true;
                m_maxAutoReturn     = 0;    // no limits on auto-return
                break;

            case ProductRulesUse.PlusUse:
                m_primLimit         = m_primLimitDefault;      // 0 = default, read from region file
                m_rezzers           = ProductRulesWho.Default; // owners define restrictions
                m_partnerRez        = true;
                m_setHome           = ProductRulesWho.Default;
                m_ownersAllowed     = ProductRulesWho.NoDeeding;
                m_groupTagsAllowed  = true;
                m_salesAllowed      = false;
                m_enforcePrimLimits = true;
                m_maxAutoReturn     = 4 * 60;  // 4-hour auto-return
                break;
            }
            ;
        }
示例#5
0
        public static RegionProfileData Create(UUID regionID, string regionName, uint locX, uint locY, string externalHostName,
                                               uint regionPort, uint httpPort, uint remotingPort, byte access, ProductRulesUse product, string outsideIP)
        {
            RegionProfileData regionProfile;

            regionProfile              = new RegionProfileData();
            regionProfile.regionLocX   = locX;
            regionProfile.regionLocY   = locY;
            regionProfile.regionHandle =
                Utils.UIntsToLong((regionProfile.regionLocX * Constants.RegionSize),
                                  (regionProfile.regionLocY * Constants.RegionSize));
            regionProfile.serverHostName = externalHostName;
            regionProfile.serverPort     = regionPort;
            regionProfile.httpPort       = httpPort;
            regionProfile.remotingPort   = remotingPort;

            regionProfile.UUID       = regionID;
            regionProfile.regionName = regionName;
            regionProfile.maturity   = access;
            regionProfile.product    = product;
            regionProfile._outsideIp = outsideIP;

            return(regionProfile);
        }