Exemplo n.º 1
0
        byte[] EnterAgent(string region, string name, IOSHttpRequest httpRequest, Dictionary <string, object> request, IOSHttpResponse httpResponse)
        {
            // Let's check if the region exists
            GridRegion gregion = null;

            if (string.IsNullOrEmpty(region) || region == "DEFAULT")
            {
                List <GridRegion> regions = m_GridService.GetDefaultRegions(UUID.Zero);
                if (regions.Count > 0)
                {
                    gregion = regions[0];
                }
                else
                {
                    return(BadRequest(httpResponse));
                }
            }
            else
            {
                gregion = m_GridService.GetRegionByName(UUID.Zero, region);
                if (gregion == null)
                {
                    return(BadRequest(httpResponse));
                }
            }

            // We found the region
            m_log.DebugFormat("[PotamOS]: Found requested region {0} at {1}", region, gregion.ServerURI);
            httpResponse.StatusCode  = (int)OSHttpStatusCode.SuccessOk;
            httpResponse.ContentType = "text/plain";
            string simUrl = string.Format("{0}={1}", region, HttpUtility.UrlEncode(gregion.ServerURI));

            return(PotamOSUtils.StringToBytes(simUrl));
        }
Exemplo n.º 2
0
 public List <GridRegion> GetDefaultRegions(UUID scopeID)
 {
     return(m_localService.GetDefaultRegions(scopeID));
 }