Ejemplo n.º 1
0
        public ProfilePickInfo GetPick(UUID queryPickID)
        {
            if (m_doRemoteOnly)
            {
                object remoteValue = DoRemote(queryPickID);
                return(remoteValue != null ? (ProfilePickInfo)remoteValue : null);
            }

            QueryFilter filter = new QueryFilter();

            filter.andFilters ["PickUUID"] = queryPickID;

            List <string> query = genData.Query(new [] { "*" }, m_userPicksTable, filter, null, null, null);

            if (query.Count < 5)
            {
                return(null);
            }

            ProfilePickInfo pick = new ProfilePickInfo();

            pick.FromOSD((OSDMap)OSDParser.DeserializeJson(query [4]));

            return(pick);
        }
Ejemplo n.º 2
0
        public List <ProfilePickInfo> GetPicks(UUID ownerID)
        {
            object remoteValue = DoRemote(ownerID);

            if (remoteValue != null || m_doRemoteOnly)
            {
                return((List <ProfilePickInfo>)remoteValue);
            }

            QueryFilter filter = new QueryFilter();

            filter.andFilters["OwnerUUID"] = ownerID;

            List <string> query = GD.Query(new[] { "*" }, "userpicks", filter, null, null, null);

            List <ProfilePickInfo> picks = new List <ProfilePickInfo>();

            for (int i = 0; i < query.Count; i += 5)
            {
                ProfilePickInfo pick = new ProfilePickInfo();
                pick.FromOSD((OSDMap)OSDParser.DeserializeJson(query[i + 4]));
                picks.Add(pick);
            }
            return(picks);
        }
Ejemplo n.º 3
0
 public ProfilePickInfo GetPick(UUID queryPickID)
 {
     try
     {
         List <string> serverURIs =
             m_registry.RequestModuleInterface <IConfigurationService>().FindValueOf("RemoteServerURI");
         foreach (string url in serverURIs)
         {
             OSDMap map = new OSDMap();
             map["Method"]   = "getpick";
             map["PickUUID"] = queryPickID;
             OSDMap response = WebUtils.PostToService(url + "osd", map, true, true);
             if (response["_Result"].Type == OSDType.Map)
             {
                 OSDMap          responsemap = (OSDMap)response["_Result"];
                 ProfilePickInfo info        = new ProfilePickInfo();
                 info.FromOSD(responsemap);
                 return(info);
             }
         }
     }
     catch (Exception e)
     {
         MainConsole.Instance.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e);
     }
     return(null);
 }
        public ProfilePickInfo GetPick(UUID queryPickID)
        {
            object remoteValue = DoRemote(queryPickID);

            if (remoteValue != null || m_doRemoteOnly)
            {
                return((ProfilePickInfo)remoteValue);
            }

            QueryFilter filter = new QueryFilter();

            filter.andFilters["PickUUID"] = queryPickID;

            List <string> query = GD.Query(new string[1] {
                "*"
            }, "userpicks", filter, null, null, null);

            if (query.Count < 5)
            {
                return(null);
            }
            ProfilePickInfo pick = new ProfilePickInfo();

            pick.FromOSD((OSDMap)OSDParser.DeserializeJson(query[4]));
            return(pick);
        }
        public byte[] AddPick(OSDMap request)
        {
            ProfilePickInfo info = new ProfilePickInfo();

            info.FromOSD((OSDMap)request["Pick"]);

            ProfileConnector.AddPick(info);

            string xmlString = OSDParser.SerializeJsonString(new OSDMap());
            //MainConsole.Instance.DebugFormat("[AuroraDataServerPostHandler]: resp string: {0}", xmlString);
            UTF8Encoding encoding = new UTF8Encoding();

            return(encoding.GetBytes(xmlString));
        }
Ejemplo n.º 6
0
        public List <ProfilePickInfo> GetPicks(UUID ownerID)
        {
            List <ProfilePickInfo> picks = new List <ProfilePickInfo> ();
            List <string>          query = GD.Query(new string[1] {
                "OwnerUUID"
            }, new object[1] {
                ownerID
            }, "userpicks", "*");

            for (int i = 0; i < query.Count; i += 5)
            {
                ProfilePickInfo pick = new ProfilePickInfo();
                pick.FromOSD((OSDMap)OSDParser.DeserializeJson(query[i + 4]));
                picks.Add(pick);
            }
            return(picks);
        }
Ejemplo n.º 7
0
        public ProfilePickInfo GetPick(UUID queryPickID)
        {
            List <string> query = GD.Query(new string[1] {
                "PickUUID"
            }, new object[1] {
                queryPickID
            }, "userpicks", "*");

            if (query.Count < 5)
            {
                return(null);
            }
            ProfilePickInfo pick = new ProfilePickInfo();

            pick.FromOSD((OSDMap)OSDParser.DeserializeJson(query[4]));
            return(pick);
        }
Ejemplo n.º 8
0
        public ProfilePickInfo GetPick(UUID queryPickID)
        {
            Dictionary <string, object> where = new Dictionary <string, object>(1);
            where["PickUUID"] = queryPickID;

            List <string> query = GD.Query(new string[1] {
                "*"
            }, "userpicks", new QueryFilter
            {
                andFilters = where
            }, null, null, null);

            if (query.Count < 5)
            {
                return(null);
            }
            ProfilePickInfo pick = new ProfilePickInfo();

            pick.FromOSD((OSDMap)OSDParser.DeserializeJson(query[4]));
            return(pick);
        }
Ejemplo n.º 9
0
        public List <ProfilePickInfo> GetPicks(UUID ownerID)
        {
            Dictionary <string, object> where = new Dictionary <string, object>(1);
            where["OwnerUUID"] = ownerID;

            List <string> query = GD.Query(new string[1] {
                "*"
            }, "userpicks", new QueryFilter
            {
                andFilters = where
            }, null, null, null);

            List <ProfilePickInfo> picks = new List <ProfilePickInfo>();

            for (int i = 0; i < query.Count; i += 5)
            {
                ProfilePickInfo pick = new ProfilePickInfo();
                pick.FromOSD((OSDMap)OSDParser.DeserializeJson(query[i + 4]));
                picks.Add(pick);
            }
            return(picks);
        }
Ejemplo n.º 10
0
 public List <ProfilePickInfo> GetPicks(UUID ownerID)
 {
     try
     {
         List <string> serverURIs =
             m_registry.RequestModuleInterface <IConfigurationService>().FindValueOf(ownerID.ToString(),
                                                                                     "RemoteServerURI");
         foreach (string url in serverURIs)
         {
             OSDMap map = new OSDMap();
             map["Method"]      = "getpicks";
             map["PrincipalID"] = ownerID;
             OSDMap response = WebUtils.PostToService(url + "osd", map, true, true);
             if (response["_Result"].Type == OSDType.Map)
             {
                 OSDMap responsemap = (OSDMap)response["_Result"];
                 if (responsemap.ContainsKey("Result"))
                 {
                     List <ProfilePickInfo> list = new List <ProfilePickInfo>();
                     OSDArray picks = (OSDArray)responsemap["Result"];
                     foreach (OSD o in picks)
                     {
                         ProfilePickInfo info = new ProfilePickInfo();
                         info.FromOSD((OSDMap)o);
                         list.Add(info);
                     }
                     return(list);
                 }
                 return(new List <ProfilePickInfo>());
             }
         }
     }
     catch (Exception e)
     {
         MainConsole.Instance.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e);
     }
     return(null);
 }
Ejemplo n.º 11
0
        public List<ProfilePickInfo> GetPicks(UUID ownerID)
        {
            object remoteValue = DoRemote(ownerID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<ProfilePickInfo>) remoteValue;

            QueryFilter filter = new QueryFilter();
            filter.andFilters["OwnerUUID"] = ownerID;

            List<string> query = GD.Query(new[] {"*"}, "userpicks", filter, null, null, null);

            List<ProfilePickInfo> picks = new List<ProfilePickInfo>();
            for (int i = 0; i < query.Count; i += 5)
            {
                ProfilePickInfo pick = new ProfilePickInfo();
                pick.FromOSD((OSDMap) OSDParser.DeserializeJson(query[i + 4]));
                picks.Add(pick);
            }
            return picks;
        }
Ejemplo n.º 12
0
        public ProfilePickInfo GetPick(UUID queryPickID)
        {
            object remoteValue = DoRemote(queryPickID);
            if (remoteValue != null || m_doRemoteOnly)
                return (ProfilePickInfo) remoteValue;

            QueryFilter filter = new QueryFilter();
            filter.andFilters["PickUUID"] = queryPickID;

            List<string> query = GD.Query(new[] {"*"}, "userpicks", filter, null, null, null);

            if (query.Count < 5)
                return null;
            ProfilePickInfo pick = new ProfilePickInfo();
            pick.FromOSD((OSDMap) OSDParser.DeserializeJson(query[4]));
            return pick;
        }