Example #1
0
        public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient)
        {
            Hashtable requestData = (Hashtable)request.Params[0];
            //string host = (string)requestData["host"];
            //string portstr = (string)requestData["port"];
            string userID_str = (string)requestData["userID"];
            UUID   userID     = UUID.Zero;

            UUID.TryParse(userID_str, out userID);

            Vector3    position = Vector3.UnitY, lookAt = Vector3.UnitY;
            GridRegion regInfo = m_HomeUsersService.GetHomeRegion(userID, out position, out lookAt);

            Hashtable hash = new Hashtable();

            if (regInfo == null)
            {
                hash["result"] = "false";
            }
            else
            {
                hash["result"]        = "true";
                hash["uuid"]          = regInfo.RegionID.ToString();
                hash["x"]             = regInfo.RegionLocX.ToString();
                hash["y"]             = regInfo.RegionLocY.ToString();
                hash["size_x"]        = regInfo.RegionSizeX.ToString();
                hash["size_y"]        = regInfo.RegionSizeY.ToString();
                hash["region_name"]   = regInfo.RegionName;
                hash["hostname"]      = regInfo.ExternalHostName;
                hash["http_port"]     = regInfo.HttpPort.ToString();
                hash["server_uri"]    = regInfo.ServerURI;
                hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
                hash["position"]      = position.ToString();
                hash["lookAt"]        = lookAt.ToString();
            }
            XmlRpcResponse response = new XmlRpcResponse();

            response.Value = hash;
            return(response);
        }