当前位置: 首页>>代码示例>>C#>>正文


C# Classified.FromOSD方法代码示例

本文整理汇总了C#中Aurora.Framework.Classified.FromOSD方法的典型用法代码示例。如果您正苦于以下问题:C# Classified.FromOSD方法的具体用法?C# Classified.FromOSD怎么用?C# Classified.FromOSD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aurora.Framework.Classified的用法示例。


在下文中一共展示了Classified.FromOSD方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClassifiedDelete

        public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient)
        {
            //Security check
            IUserProfileInfo info = ProfileFrontend.GetUserProfile(remoteClient.AgentId);

            if (info == null)
                return;
            if (info.Classifieds.ContainsKey(queryClassifiedID.ToString()))
            {
                Classified oldClassified = new Classified();
                oldClassified.FromOSD((OSDMap)info.Classifieds[queryClassifiedID.ToString()]);
                if (oldClassified.CreatorUUID != remoteClient.AgentId)
                    return;

                info.Classifieds.Remove(queryClassifiedID.ToString());
                ProfileFrontend.UpdateUserProfile(info);
            }
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:18,代码来源:AvatarProfileModule.cs

示例2: GodClassifiedDelete

        public void GodClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient)
        {
            if (GetRegionUserIsIn(remoteClient.AgentId).Permissions.IsGod(remoteClient.AgentId))
            {
                IUserProfileInfo info = ProfileFrontend.GetUserProfile(remoteClient.AgentId);

                if (info == null)
                    return;
                if (info.Classifieds.ContainsKey(queryClassifiedID.ToString()))
                {
                    Classified oldClassified = new Classified();
                    oldClassified.FromOSD((OSDMap)info.Classifieds[queryClassifiedID.ToString()]);

                    info.Classifieds.Remove(queryClassifiedID.ToString());
                    ProfileFrontend.UpdateUserProfile(info);
                }
            }
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:18,代码来源:AvatarProfileModule.cs

示例3: GetClassifieds

 public List<Classified> GetClassifieds (UUID ownerID)
 {
     List<Classified> classifieds = new List<Classified> ();
     List<string> query = GD.Query (new string[1] { "OwnerUUID" }, new object[1] { ownerID }, "userclassifieds", "*");
     for (int i = 0; i < query.Count; i+=6)
     {
         Classified classified = new Classified ();
         classified.FromOSD ((OSDMap)OSDParser.DeserializeJson (query[i+5]));
         classifieds.Add (classified);
     }
     return classifieds;
 }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:12,代码来源:LocalProfileConnector.cs

示例4: GetClassified

        public Classified GetClassified(UUID queryClassifiedID)
        {
            QueryFilter filter = new QueryFilter();
            filter.andFilters["ClassifiedUUID"] = queryClassifiedID;

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

            if (query.Count < 6)
            {
                return null;
            }
            Classified classified = new Classified();
            classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[5]));
            return classified;
        }
开发者ID:djphil,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalProfileConnector.cs

示例5: RemoveClassifieds

 /// <summary>
 /// Remove classifieds from the search database
 /// LOCAL Only, called by the profile service
 /// </summary>
 /// <param name="dictionary">objects of the dictionary are OSDMaps made from Classified</param>
 public void RemoveClassifieds(Dictionary<string, object> dictionary)
 {
     //Remove all the UUIDs in the given dictionary from search
     foreach (object o in dictionary.Values)
     {
         //Pull out the OSDMaps
         OSDMap map = (OSDMap)o;
         Classified c = new Classified();
         c.FromOSD(map);
         List<string> Keys = new List<string>();
         Keys.Add("ClassifiedUUID");
         List<object> Values = new List<object>();
         Values.Add(c.ClassifiedUUID);
         GD.Delete("profileclassifieds", Keys.ToArray(), Values.ToArray());
     }
 }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:21,代码来源:LocalDirectoryServiceConnector.cs

示例6: GetClassifiedsInRegion

 /// <summary>
 /// Gets all classifieds in the given region
 /// </summary>
 /// <param name="regionName"></param>
 /// <returns></returns>
 public Classified[] GetClassifiedsInRegion(string regionName)
 {
     List<Classified> Classifieds = new List<Classified>();
     List<string> retVal = GD.Query ("SimName", regionName, "userclassifieds", "*");
     
     if (retVal.Count == 0)
         return Classifieds.ToArray();
     
     Classified classified = new Classified();
     for (int i = 0; i < retVal.Count; i += 6)
     {
         //Pull the classified out of OSD
         classified.FromOSD((OSDMap)OSDParser.DeserializeJson(retVal[i + 5]));
         Classifieds.Add(classified);
         classified = new Classified();
     }
     return Classifieds.ToArray();
 }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:23,代码来源:LocalDirectoryServiceConnector.cs

示例7: GetClassifieds

        public List<Classified> GetClassifieds(UUID ownerID)
        {
            object remoteValue = DoRemote(ownerID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<Classified>)remoteValue;

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

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

            List<Classified> classifieds = new List<Classified>();
            for (int i = 0; i < query.Count; i += 7)
            {
                Classified classified = new Classified();
                classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[i + 5]));
                classifieds.Add(classified);
            }
            return classifieds;
        }
开发者ID:andsim,项目名称:Aurora-Sim,代码行数:20,代码来源:LocalProfileConnector.cs

示例8: GetClassifiedByID

        public Classified GetClassifiedByID(UUID id)
        {
            object remoteValue = DoRemote(id);
            if (remoteValue != null || m_doRemoteOnly)
                return (Classified)remoteValue;

            QueryFilter filter = new QueryFilter();
            Dictionary<string, object> where = new Dictionary<string, object>(1);
            where.Add("ClassifiedUUID", id);
            filter.andFilters = where;
            List<string> retVal = GD.Query(new[] { "*" }, "userclassifieds", filter, null, null, null);
            if ((retVal == null) || (retVal.Count == 0)) return null;
            Classified classified = new Classified();
            classified.FromOSD((OSDMap)OSDParser.DeserializeJson(retVal[6]));
            return classified;
        }
开发者ID:rjspence,项目名称:YourSim,代码行数:16,代码来源:LocalDirectoryServiceConnector.cs

示例9: GetClassifiedsInRegion

        /// <summary>
        ///   Gets all classifieds in the given region
        /// </summary>
        /// <param name = "regionName"></param>
        /// <returns></returns>
        public Classified[] GetClassifiedsInRegion(string regionName)
        {
            QueryFilter filter = new QueryFilter();
            filter.andFilters["SimName"] = regionName;
            List<string> retVal = GD.Query(new string[] { "*" }, "userclassifieds", filter, null, null, null);

            if (retVal.Count == 0)
            {
                return new Classified[0] { };
            }

            List<Classified> Classifieds = new List<Classified>();
            Classified classified;
            for (int i = 0; i < retVal.Count; i += 6)
            {
                classified = new Classified();
                //Pull the classified out of OSD
                classified.FromOSD((OSDMap) OSDParser.DeserializeJson(retVal[i + 5]));
                Classifieds.Add(classified);
            }
            return Classifieds.ToArray();
        }
开发者ID:djphil,项目名称:Aurora-Sim,代码行数:27,代码来源:LocalDirectoryServiceConnector.cs

示例10: GetClassified

        public Classified GetClassified(UUID queryClassifiedID)
        {
            object remoteValue = DoRemote(queryClassifiedID);
            if (remoteValue != null || m_doRemoteOnly)
                return (Classified)remoteValue;

            QueryFilter filter = new QueryFilter();
            filter.andFilters["ClassifiedUUID"] = queryClassifiedID;

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

            if (query.Count < 6)
            {
                return null;
            }
            Classified classified = new Classified();
            classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[5]));
            return classified;
        }
开发者ID:andsim,项目名称:Aurora-Sim,代码行数:19,代码来源:LocalProfileConnector.cs

示例11: FindClassifieds

        /// <summary>
        ///   Searches for classifieds
        /// </summary>
        /// <param name = "queryText"></param>
        /// <param name = "category"></param>
        /// <param name = "queryFlags"></param>
        /// <param name = "StartQuery"></param>
        /// <returns></returns>
        public DirClassifiedReplyData[] FindClassifieds(string queryText, string category, uint queryFlags, int StartQuery)
        {

            QueryFilter filter = new QueryFilter();

            filter.andLikeFilters["Name"] = "%" + queryText + "%";
            if (int.Parse(category) != (int)DirectoryManager.ClassifiedCategories.Any) //Check the category
            {
                filter.andFilters["Category"] = category;
            }

            List<string> retVal = GD.Query(new string[1] { "*" }, "userclassifieds", filter, null, (uint)StartQuery, 50);
            if (retVal.Count == 0)
            {
                return new DirClassifiedReplyData[0] { };
            }

            List<DirClassifiedReplyData> Data = new List<DirClassifiedReplyData>();
            DirClassifiedReplyData replyData;
            for (int i = 0; i < retVal.Count; i += 6)
            {
                //Pull the classified out of OSD
                Classified classified = new Classified();
                classified.FromOSD((OSDMap) OSDParser.DeserializeJson(retVal[i + 5]));

                replyData = new DirClassifiedReplyData
                {
                    classifiedFlags = classified.ClassifiedFlags,
                    classifiedID = classified.ClassifiedUUID,
                    creationDate = classified.CreationDate,
                    expirationDate = classified.ExpirationDate,
                    price = classified.PriceForListing,
                    name = classified.Name
                };
                //Check maturity levels
                if ((replyData.classifiedFlags & (uint)DirectoryManager.ClassifiedFlags.Mature) == (uint)DirectoryManager.ClassifiedFlags.Mature)
                {
                    if ((queryFlags & (uint)DirectoryManager.ClassifiedQueryFlags.Mature) == (uint)DirectoryManager.ClassifiedQueryFlags.Mature)
                    {
                        Data.Add(replyData);
                    }
                }
                else
                { //Its PG, add all
                    Data.Add(replyData);
                }
            }
            return Data.ToArray();
        }
开发者ID:djphil,项目名称:Aurora-Sim,代码行数:57,代码来源:LocalDirectoryServiceConnector.cs

示例12: GetClassified

        public Classified GetClassified(UUID queryClassifiedID)
        {
            Dictionary<string, object> where = new Dictionary<string, object>(1);
            where["ClassifiedUUID"] = queryClassifiedID;

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

            if (query.Count < 6)
            {
                return null;
            }
            Classified classified = new Classified();
            classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[5]));
            return classified;
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:18,代码来源:LocalProfileConnector.cs

示例13: GetClassifieds

        public List<Classified> GetClassifieds(UUID ownerID)
        {
            Dictionary<string, object> where = new Dictionary<string, object>(1);
            where["OwnerUUID"] = ownerID;

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

            List<Classified> classifieds = new List<Classified>();
            for (int i = 0; i < query.Count; i += 6)
            {
                Classified classified = new Classified();
                classified.FromOSD((OSDMap) OSDParser.DeserializeJson(query[i + 5]));
                classifieds.Add(classified);
            }
            return classifieds;
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:19,代码来源:LocalProfileConnector.cs

示例14: FindClassifieds

        public List<DirClassifiedReplyData> FindClassifieds(string queryText, string category, uint queryFlags, int StartQuery, UUID scopeID)
        {
            object remoteValue = DoRemote(queryText, category, queryFlags, StartQuery, scopeID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<DirClassifiedReplyData>)remoteValue;

            QueryFilter filter = new QueryFilter();

            filter.andLikeFilters["Name"] = "%" + queryText + "%";
            if (int.Parse(category) != (int)DirectoryManager.ClassifiedCategories.Any) //Check the category
                filter.andFilters["Category"] = category;
            if (scopeID != UUID.Zero)
                filter.andFilters["ScopeID"] = scopeID;

            List<string> retVal = GD.Query(new[] { "*" }, "userclassifieds", filter, null, (uint)StartQuery, 50);
            if (retVal.Count == 0)
                return new List<DirClassifiedReplyData>();

            List<DirClassifiedReplyData> Data = new List<DirClassifiedReplyData>();
            for (int i = 0; i < retVal.Count; i += 9)
            {
                //Pull the classified out of OSD
                Classified classified = new Classified();
                classified.FromOSD((OSDMap) OSDParser.DeserializeJson(retVal[i + 5]));

                DirClassifiedReplyData replyData = new DirClassifiedReplyData
                                                       {
                                                           classifiedFlags = classified.ClassifiedFlags,
                                                           classifiedID = classified.ClassifiedUUID,
                                                           creationDate = classified.CreationDate,
                                                           expirationDate = classified.ExpirationDate,
                                                           price = classified.PriceForListing,
                                                           name = classified.Name
                                                       };
                //Check maturity levels
                if ((replyData.classifiedFlags & (uint)DirectoryManager.ClassifiedFlags.Mature) != (uint)DirectoryManager.ClassifiedFlags.Mature)
                {
                    if ((queryFlags & (uint)DirectoryManager.ClassifiedQueryFlags.Mature) == (uint)DirectoryManager.ClassifiedQueryFlags.Mature)
                        Data.Add(replyData);
                }
                else
                    //Its Mature, add all
                    Data.Add(replyData);
            }
            return Data;
        }
开发者ID:rjspence,项目名称:YourSim,代码行数:46,代码来源:LocalDirectoryServiceConnector.cs

示例15: GetClassified

 public Classified GetClassified (UUID queryClassifiedID)
 {
     try
     {
         List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf ("RemoteServerURI");
         foreach (string url in serverURIs)
         {
             OSDMap map = new OSDMap ();
             map["Method"] = "getclassified";
             map["ClassifiedUUID"] = queryClassifiedID;
             OSDMap response = WebUtils.PostToService (url + "osd", map, true, true);
             if (response["_Result"].Type == OSDType.Map)
             {
                 OSDMap responsemap = (OSDMap)response["_Result"];
                 Classified info = new Classified ();
                 info.FromOSD (responsemap);
                 return info;
             }
         }
     }
     catch (Exception e)
     {
         m_log.DebugFormat ("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString ());
     }
     return null;
 }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:26,代码来源:RemoteProfileConnector.cs


注:本文中的Aurora.Framework.Classified.FromOSD方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。