Пример #1
0
        /// <summary>
        /// Returns information about a sim via a REST Request
        /// </summary>
        /// <param name="request"></param>
        /// <param name="path"></param>
        /// <param name="param">A string representing the sim's UUID</param>
        /// <param name="httpRequest">HTTP request header object</param>
        /// <param name="httpResponse">HTTP response header object</param>
        /// <returns>Information about the sim in XML</returns>
        public string RestGetSimMethod(string request, string path, string param,
                                       OSHttpRequest httpRequest, OSHttpResponse httpResponse)
        {
            string respstring = String.Empty;

            RegionProfileData TheSim;

            UUID UUID;

            if (UUID.TryParse(param, out UUID))
            {
                TheSim = m_gridDBService.GetRegion(UUID);

                if (!(TheSim == null))
                {
                    respstring  = "<Root>";
                    respstring += "<authkey>" + TheSim.regionSendKey + "</authkey>";
                    respstring += "<sim>";
                    respstring += "<uuid>" + TheSim.UUID.ToString() + "</uuid>";
                    respstring += "<regionname>" + TheSim.regionName + "</regionname>";
                    respstring += "<sim_ip>" + TheSim.serverIP + "</sim_ip>";
                    respstring += "<sim_port>" + TheSim.serverPort.ToString() + "</sim_port>";
                    respstring += "<region_locx>" + TheSim.regionLocX.ToString() + "</region_locx>";
                    respstring += "<region_locy>" + TheSim.regionLocY.ToString() + "</region_locy>";
                    respstring += "<estate_id>1</estate_id>";
                    respstring += "</sim>";
                    respstring += "</Root>";
                }
            }
            else
            {
                respstring  = "<Root>";
                respstring += "<error>Param must be a UUID</error>";
                respstring += "</Root>";
            }

            return(respstring);
        }