void pipeline_OnDownloadFinished(UUID id, bool success)
        {
            ImageDownload download;
            if (currentDownloads.TryGetValue(id, out download))
            {
                lock (currentDownloads)
                    currentDownloads.Remove(id);

                if (success)
                {
                    // Set the texture to the downloaded texture data
                    AssetTexture texture = new AssetTexture(id, Pipeline.GetTextureToRender(id).AssetData);
                    download.Texture = texture;

                    Pipeline.RemoveFromPipeline(id);

                    // Store this texture in the local asset store for later
                    server.Assets.StoreAsset(texture);

                    SendTexture(download.Agent, download.Texture, download.DiscardLevel, download.CurrentPacket, download.Priority);
                }
                else
                {
                    Logger.Log("[Periscope] Failed to download texture " + id.ToString(), Helpers.LogLevel.Warning);

                    ImageNotInDatabasePacket notfound = new ImageNotInDatabasePacket();
                    notfound.ImageID.ID = id;
                    server.UDP.SendPacket(download.Agent.Avatar.ID, notfound, PacketCategory.Texture);
                }
            }
            else
            {
                Logger.Log("[Periscope] Pipeline downloaded a texture we're not tracking, " + id.ToString(), Helpers.LogLevel.Warning);
            }
        }
        public UserAccountData[] GetActiveAccounts(UUID scopeID, string query, string excludeTerm)
        {
            string[] words = query.Split(new char[] { ' ' });

            for (int i = 0; i < words.Length; i++)
            {
                if (words[i].Length < 3)
                {
                    if (i != words.Length - 1)
                        Array.Copy(words, i + 1, words, i, words.Length - i - 1);
                    Array.Resize(ref words, words.Length - 1);
                }
            }

            if (words.Length == 0)
                return new UserAccountData[0];

            if (words.Length > 2)
                return new UserAccountData[0];

            SqliteCommand cmd = new SqliteCommand();

            if (words.Length == 1)
            {
                cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%') and (FirstName not like '{3}%')",
                    m_Realm, scopeID.ToString(), words[0], excludeTerm);
            }
            else
            {
                cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%') and (FirstName not like '{4}%')",
                    m_Realm, scopeID.ToString(), words[0], words[1], excludeTerm);
            }

            return m_DatabaseHandler.DoQuery(cmd);
        }
Example #3
0
        private Hashtable HomeLocation(Hashtable mDhttpMethod, UUID agentID)
        {
            OSDMap rm = (OSDMap)OSDParser.DeserializeLLSDXml((string)mDhttpMethod["requestbody"]);
            OSDMap HomeLocation = rm["HomeLocation"] as OSDMap;
            OSDMap pos = HomeLocation["LocationPos"] as OSDMap;
            Vector3 position = new Vector3((float)pos["X"].AsReal(),
                (float)pos["Y"].AsReal(),
                (float)pos["Z"].AsReal());
            OSDMap lookat = HomeLocation["LocationLookAt"] as OSDMap;
            Vector3 lookAt = new Vector3((float)lookat["X"].AsReal(),
                (float)lookat["Y"].AsReal(),
                (float)lookat["Z"].AsReal());
            int locationID = HomeLocation["LocationId"].AsInteger();

            PresenceInfo presence = m_presenceService.GetAgents(new string[] { agentID.ToString() })[0];
            bool r = m_gridUserService.SetHome(agentID.ToString(), presence.RegionID, position, lookAt);

            rm.Add("success", OSD.FromBoolean(r));

            //Send back data
            Hashtable responsedata = new Hashtable();
            responsedata["int_response_code"] = 200; //501; //410; //404;
            responsedata["content_type"] = "text/plain";
            responsedata["keepalive"] = false;
            responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(rm);
            return responsedata;
        }
        public override string Execute(string[] args, UUID fromAgentID)
        {
            if (args.Length != 1 && args.Length != 2)
                return "Usage: downloadtexture [texture-uuid] [discardlevel]";

            TextureID = UUID.Zero;
            DownloadHandle.Reset();
            Image = null;
            Asset = null;

            if (UUID.TryParse(args[0], out TextureID))
            {
                int discardLevel = 0;

                if (args.Length > 1)
                {
                    if (!Int32.TryParse(args[1], out discardLevel))
                        return "Usage: downloadtexture [texture-uuid] [discardlevel]";
                }

                Client.Assets.RequestImage(TextureID, ImageType.Normal, 1000000.0f, discardLevel, 0);

                if (DownloadHandle.WaitOne(120 * 1000, false))
                {
                    if (Image != null && Image.Success)
                    {
                        if (Asset != null && Asset.Decode())
                        {
                            try { File.WriteAllBytes(Image.ID.ToString() + ".jp2", Asset.AssetData); }
                            catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client, ex); }

                            return String.Format("Saved {0}.jp2 ({1}x{2})", Image.ID, Asset.Image.Width, Asset.Image.Height);
                        }
                        else
                        {
                            return "Failed to decode texture " + TextureID.ToString();
                        }
                    }
                    else if (Image != null && Image.NotFound)
                    {
                        return "Simulator reported texture not found: " + TextureID.ToString();
                    }
                    else
                    {
                        return "Download failed for texture " + TextureID.ToString();
                    }
                }
                else
                {
                    return "Timed out waiting for texture download";
                }
            }
            else
            {
                return "Usage: downloadtexture [texture-uuid]";
            }
        }
        public IAgentInfo GetAgent(UUID PrincipalID)
        {
            IAgentInfo agent;
            if (!m_cache.TryGetValue(PrincipalID, out agent))
                return agent;

            Dictionary<string, object> sendData = new Dictionary<string, object>();

            sendData["PRINCIPALID"] = PrincipalID.ToString();
            sendData["METHOD"] = "getagent";

            string reqString = WebUtils.BuildQueryString(sendData);

            try
            {
                List<string> m_ServerURIs =
                    m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf(PrincipalID.ToString(),
                                                                                           "RemoteServerURI");
                foreach (Dictionary<string, object> replyData in from m_ServerURI in m_ServerURIs select SynchronousRestFormsRequester.MakeRequest("POST",
                                                                                                                                   m_ServerURI + "/auroradata",
                                                                                                                                   reqString) into reply where reply != string.Empty select WebUtils.ParseXmlResponse(reply))
                {
                    if (replyData != null)
                    {
                        if (!replyData.ContainsKey("result"))
                            return null;

                        Dictionary<string, object>.ValueCollection replyvalues = replyData.Values;
                        foreach (object f in replyvalues)
                        {
                            if (f is Dictionary<string, object>)
                            {
                                agent = new IAgentInfo();
                                agent.FromKVP((Dictionary<string, object>) f);
                                m_cache.AddOrUpdate(PrincipalID, agent, new TimeSpan(0, 30, 0));
                            }
                            else
                                MainConsole.Instance.DebugFormat(
                                    "[AuroraRemoteAgentConnector]: GetAgent {0} received invalid response type {1}",
                                    PrincipalID, f.GetType());
                        }
                        // Success
                        return agent;
                    }

                    else
                        MainConsole.Instance.DebugFormat("[AuroraRemoteAgentConnector]: GetAgent {0} received null response",
                                          PrincipalID);
                }
            }
            catch (Exception e)
            {
                MainConsole.Instance.DebugFormat("[AuroraRemoteAgentConnector]: Exception when contacting server: {0}", e);
            }

            return null;
        }
Example #6
0
 public void Build()
 {
     cache = new Cache();
     cacheItemUUID = UUID.Random();
     MemoryCacheItem cachedItem = new MemoryCacheItem(cacheItemUUID.ToString(),DateTime.Now + TimeSpan.FromDays(1));
     byte[] foo = new byte[1];
     foo[0] = 255;
     cachedItem.Store(foo);
     cache.Store(cacheItemUUID.ToString(), cachedItem);
 }
Example #7
0
 public void Build()
 {
     cache = new Cache();
     cache = new Cache(CacheMedium.Memory,CacheStrategy.Aggressive,CacheFlags.AllowUpdate);
     cacheItemUUID = UUID.Random();
     MemoryCacheItem cachedItem = new MemoryCacheItem(cacheItemUUID.ToString(),DateTime.Now + TimeSpan.FromDays(1));
     byte[] foo = new byte[1];
     foo[0] = 255;
     cachedItem.Store(foo);
     cache.Store(cacheItemUUID.ToString(), cachedItem);
 }
        public IUserProfileInfo GetUserProfile(UUID PrincipalID)
        {
            NameValueCollection requestArgs = new NameValueCollection
            {
                { "RequestMethod", "GetUser" },
                { "UserID", PrincipalID.ToString() }
            };

            OSDMap result = PostUserData(PrincipalID, requestArgs);

            if (result == null)
                return null;

            if (result.ContainsKey("Profile"))
            {
                OSDMap profilemap = (OSDMap)OSDParser.DeserializeJson(result["Profile"].AsString());

                IUserProfileInfo profile = new IUserProfileInfo();
                profile.FromOSD(profilemap);

                return profile;
            }

            return null;
        }
Example #9
0
        public void UUIDs()
        {
            // Creation
            UUID a = new UUID();
            byte[] bytes = a.GetBytes();
            for (int i = 0; i < 16; i++)
                Assert.IsTrue(bytes[i] == 0x00);

            // Comparison
            a = new UUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
                0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0xFF, 0xFF }, 0);
            UUID b = new UUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
                0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);

            Assert.IsTrue(a == b, "UUID comparison operator failed, " + a.ToString() + " should equal " + 
                b.ToString());

            // From string
            a = new UUID(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
                0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 0);
            string zeroonetwo = "00010203-0405-0607-0809-0a0b0c0d0e0f";
            b = new UUID(zeroonetwo);

            Assert.IsTrue(a == b, "UUID hyphenated string constructor failed, should have " + a.ToString() + 
                " but we got " + b.ToString());

            // ToString()            
            Assert.IsTrue(a == b);                        
            Assert.IsTrue(a == (UUID)zeroonetwo);

            // TODO: CRC test
        }
        public static string Serialize(UUID userID, string firstName, string lastName)
        {
            StringWriter sw = new StringWriter();
            XmlTextWriter xtw = new XmlTextWriter(sw);
            xtw.Formatting = Formatting.Indented;
            xtw.WriteStartDocument();
            
            xtw.WriteStartElement("user_profile");
            xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString());
            xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString());
                       
            xtw.WriteElementString("name", firstName + " " + lastName);
            xtw.WriteElementString("id", userID.ToString());
            xtw.WriteElementString("about", "");
  
            // Not sure if we're storing this yet, need to take a look
//            xtw.WriteElementString("Url", profile.Url);
            // or, indeed, interests

            xtw.WriteEndElement();
            
            xtw.Close();
            sw.Close();
            
            return sw.ToString();
        }
        public bool CreateProxy(string RequestingAgentID, string AgentID, string accessToken, UUID groupID, string url, string name, out string reason)
        {
            reason = string.Empty;

            Dictionary<string, object> sendData = new Dictionary<string,object>();
            sendData["RequestingAgentID"] = RequestingAgentID;
            sendData["AgentID"] = AgentID.ToString();
            sendData["AccessToken"] = accessToken;
            sendData["GroupID"] = groupID.ToString();
            sendData["Location"] = url;
            sendData["Name"] = name;
            Dictionary<string, object> ret = MakeRequest("POSTGROUP", sendData);

            if (ret == null)
                return false;

            if (!ret.ContainsKey("RESULT"))
                return false;

            if (ret["RESULT"].ToString().ToLower() != "true")
            {
                reason = ret["REASON"].ToString();
                return false;
            }

            return true;

        }
        public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
        {
            PresenceData prevUser = GetUser(userID);

            if (!m_allowDuplicatePresences && (prevUser != null))
                m_Database.Delete("UserID", userID.ToString());

            PresenceData data = new PresenceData();

            data.UserID = userID;
            data.RegionID = UUID.Zero;
            data.SessionID = sessionID;
            data.Data = new Dictionary<string, string>();
            data.Data["SecureSessionID"] = secureSessionID.ToString();
            
            m_Database.Store(data);

            string prevUserStr = "";
            if (prevUser != null)
                prevUserStr = string.Format(". This user was already logged-in: session {0}, region {1}", prevUser.SessionID, prevUser.RegionID);

            m_log.DebugFormat("[PRESENCE SERVICE]: LoginAgent: session {0}, user {1}, region {2}, secure session {3}{4}",
                data.SessionID, data.UserID, data.RegionID, secureSessionID, prevUserStr);
            
            return true;
        }
        public FriendInfo[] GetFriends(UUID PrincipalID)
        {
            Dictionary<string, object> sendData = new Dictionary<string, object>();

            sendData["PRINCIPALID"] = PrincipalID.ToString();
            sendData["METHOD"] = "getfriends";

            string reqString = WebUtils.BuildQueryString(sendData);

            try
            {
                foreach (string m_ServerURI in m_ServerURIs)
                {
                    string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI + "/friends",
                        reqString);
                    if (reply != string.Empty)
                    {
                        Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(reply);

                        if (replyData != null)
                        {
                            if (replyData.ContainsKey("result") && (replyData["result"].ToString().ToLower() == "null"))
                            {
                                return new FriendInfo[0];
                            }

                            List<FriendInfo> finfos = new List<FriendInfo>();
                            Dictionary<string, object>.ValueCollection finfosList = replyData.Values;
                            //m_log.DebugFormat("[FRIENDS CONNECTOR]: get neighbours returned {0} elements", rinfosList.Count);
                            foreach (object f in finfosList)
                            {
                                if (f is Dictionary<string, object>)
                                {
                                    FriendInfo finfo = new FriendInfo((Dictionary<string, object>)f);
                                    finfos.Add(finfo);
                                }
                                else
                                    m_log.DebugFormat("[FRIENDS CONNECTOR]: GetFriends {0} received invalid response type {1}",
                                        PrincipalID, f.GetType());
                            }

                            // Success
                            return finfos.ToArray();
                        }

                        else
                            m_log.DebugFormat("[FRIENDS CONNECTOR]: GetFriends {0} received null response",
                                PrincipalID);
                    }
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[FRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
            }

            return new FriendInfo[0];

        }
Example #14
0
        public static bool AddGeneric(UUID ownerID, string type, string key, OSDMap map, string m_ServerURI)
        {
            string value = OSDParser.SerializeJsonString(map);

            NameValueCollection RequestArgs = new NameValueCollection
            {
                { "RequestMethod", "AddGeneric" },
                { "OwnerID", ownerID.ToString() },
                { "Type", type },
                { "Key", key },
                { "Value", value}
            };


            OSDMap Response = CachedPostRequest(RequestArgs, m_ServerURI);
            if (Response["Success"].AsBoolean())
            {
                return true;
            }
            else
            {
                //m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error {0}, {1}, {2}, {3}", ownerID, type, key, Response["Message"]);
                return false;
            }
        }
        public IUserProfileInfo GetUserProfile (UUID PrincipalID)
        {
            try
            {
                List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf (PrincipalID.ToString (), "RemoteServerURI");
                foreach (string url in serverURIs)
                {
                    OSDMap map = new OSDMap();
                    map["Method"] = "getprofile";
                    map["PrincipalID"] = PrincipalID;
                    OSDMap response = WebUtils.PostToService (url + "osd", map, true, true);
                    if (response["_Result"].Type == OSDType.Map)
                    {
                        OSDMap responsemap = (OSDMap)response["_Result"];
                        if (responsemap.Count == 0)
                            continue;
                        IUserProfileInfo info = new IUserProfileInfo ();
                        info.FromOSD (responsemap);
                        return info;
                    }
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat ("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString ());
            }

            return null;
        }
 public void DeleteMute(UUID muteID, UUID PrincipalID)
 {
     foreach (string m_ServerURI in m_ServerURIs)
     {
         SimianUtils.RemoveGenericEntry(PrincipalID, "MuteList", muteID.ToString(), m_ServerURI);
     }
 }
Example #17
0
        public void SuperInit()
        {
            OpenSim.Tests.Common.TestLogging.LogToConsole();

            folder1 = UUID.Random();
            folder2 = UUID.Random();
            folder3 = UUID.Random();
            owner1 = UUID.Random();
            owner2 = UUID.Random();
            owner3 = UUID.Random();
            item1 = UUID.Random();
            item2 = UUID.Random();
            item3 = UUID.Random();
            asset1 = UUID.Random();
            asset2 = UUID.Random();
            asset3 = UUID.Random();

            name1 = "Root Folder for " + owner1.ToString();
            name2 = "First Level folder";
            name3 = "First Level folder 2";
            niname1 = "My Shirt";
            iname1 = "Shirt";
            iname2 = "Text Board";
            iname3 = "No Pants Barrel";

        }
 public void AddTelehub(Telehub telehub, UUID SessionID)
 {
     foreach (string m_ServerURI in m_ServerURIs)
     {
         SimianUtils.AddGeneric(telehub.RegionID, "RegionTelehub", SessionID.ToString(), telehub.ToOSD(), m_ServerURI);
     }
 }
Example #19
0
        public override string Execute(string[] args, UUID fromAgentID)
        {
            if (args.Length < 1)
            {
                return "Usage: goto_landmark [UUID]";
            }

            UUID landmark = new UUID();
            if (!UUID.TryParse(args[0], out landmark))
            {
                return "Invalid LLUID";
            }
            else
            {
                Console.WriteLine("Teleporting to " + landmark.ToString());
            }
            if (Client.Self.Teleport(landmark))
            {
                return "Teleport Succesful";
            }
            else
            {
                return "Teleport Failed";
            }
        }
 public void RemoveTelehub(UUID regionID, UUID SessionID)
 {
     foreach (string m_ServerURI in m_ServerURIs)
     {
         SimianUtils.RemoveGenericEntry(regionID, "RegionTelehub", SessionID.ToString(), m_ServerURI);
     }
 }
        public Bitmap LoadBitmap(UUID assetID)
        {
            byte[] bmp = m_scene.AssetService.GetData(assetID.ToString());
            Image img = m_scene.RequestModuleInterface<IJ2KDecoder>().DecodeToImage(bmp);

            return new Bitmap(img);
        }
        public GridInstantMessage[] GetOfflineMessages(UUID PrincipalID)
        {
            OSDMap map = new OSDMap();

            map["PrincipalID"] = PrincipalID;
            map["Method"] = "getofflinemessages";

            List<GridInstantMessage> Messages = new List<GridInstantMessage>();
            try
            {
                List<string> urls =
                    m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf(PrincipalID.ToString(),
                                                                                           "RemoteServerURI");
                foreach (string url in urls)
                {
                    OSDMap result = WebUtils.PostToService(url + "osd", map, true, false);
                    OSDArray array = (OSDArray) OSDParser.DeserializeJson(result["_RawResult"]);
                    foreach (OSD o in array)
                    {
                        GridInstantMessage message = new GridInstantMessage();
                        message.FromOSD((OSDMap) o);
                        Messages.Add(message);
                    }
                }
                return Messages.ToArray();
            }
            catch (Exception e)
            {
                MainConsole.Instance.DebugFormat("[AuroraRemoteOfflineMessagesConnector]: Exception when contacting server: {0}", e);
            }
            return Messages.ToArray();
        }
 /// <summary>
 ///   Get a specific region's parcel info
 /// </summary>
 /// <param name = "RegionID"></param>
 /// <param name = "ParcelID"></param>
 /// <returns></returns>
 public LandData GetLandData(UUID RegionID, UUID ParcelID)
 {
     LandData data = GenericUtils.GetGeneric<LandData>(RegionID, "LandData", ParcelID.ToString(), GD);
     //Stored seperately, so rebuild it
     BuildParcelAccessList(data);
     return data;
 }
Example #24
0
 protected override AssetBase GetAsset(UUID uuid)
 {
     if (string.Empty == m_assetServerURL)
         return m_assetCache.Get(uuid.ToString());
     else
         return m_assetMapper.FetchAsset(m_assetServerURL, uuid);
 }
 public bool IsMuted(UUID PrincipalID, UUID PossibleMuteID)
 {
     OSDMap map = null;
     if (SimianUtils.GetGenericEntry(PrincipalID, "MuteList", PossibleMuteID.ToString(), m_ServerURI, out map))
         return true;
     return false;
 }
Example #26
0
        public virtual List<InventoryFolderBase> GetInventorySkeleton(UUID principalID)
        {
            Dictionary<string,object> ret = MakeRequest("GETINVENTORYSKELETON",
                    new Dictionary<string,object> {
                        { "PRINCIPAL", principalID.ToString() }
                    });

            if (ret == null)
                return null;
            if (ret.Count == 0)
                return null;

            List<InventoryFolderBase> folders = new List<InventoryFolderBase>();

            try
            {
                foreach (Object o in ret.Values)
                    folders.Add(BuildFolder((Dictionary<string, object>)o));
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception unwrapping folder list: {0}", e.Message);
            }

            return folders;
        }
 public GridInstantMessage[] GetOfflineMessages (UUID agentID)
 {
     List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf (agentID.ToString (), "FriendsServerURI");
     if (serverURIs.Count > 0) //Remote user... or should be
         return m_remoteService.GetOfflineMessages (agentID);
     return m_localService.GetOfflineMessages (agentID);
 }
Example #28
0
        void Groups_OnGroupLeft(UUID groupID, bool success)
        {
            Console.WriteLine(Client.ToString() + (success ? " has left group " : " failed to left group ") + groupID.ToString());

            leftGroup = success;
            GroupsEvent.Set();
        }
        public string Authenticate(UUID principalID, string password, int lifetime)
        {
            Dictionary<string, object> sendData = new Dictionary<string, object>();
            sendData["LIFETIME"] = lifetime.ToString();
            sendData["PRINCIPAL"] = principalID.ToString();
            sendData["PASSWORD"] = password;

            sendData["METHOD"] = "authenticate";

            foreach (string m_ServerURI in m_ServerURIs)
            {
                string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                    m_ServerURI + "/auth/plain",
                    WebUtils.BuildQueryString(sendData));

                Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(
                        reply);

                if (replyData["Result"].ToString() != "Success")
                    return String.Empty;

                return replyData["Token"].ToString();
            }
            return "";
        }
        public IAgentInfo GetAgent(UUID PrincipalID)
        {
            NameValueCollection requestArgs = new NameValueCollection
                                                  {
                                                      {"RequestMethod", "GetUser"},
                                                      {"UserID", PrincipalID.ToString()}
                                                  };

            OSDMap result = PostData(PrincipalID, requestArgs);

            if (result == null)
                return null;

            if (result.ContainsKey("AgentInfo"))
            {
                OSDMap agentmap = (OSDMap) OSDParser.DeserializeJson(result["AgentInfo"].AsString());

                IAgentInfo agent = new IAgentInfo();
                agent.FromOSD(agentmap);

                return agent;
            }

            return null;
        }