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


C# Classified.ToOSD方法代码示例

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


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

示例1: AddClassified

        public bool AddClassified(Classified classified)
        {
            object remoteValue = DoRemote(classified);
            if (remoteValue != null || m_doRemoteOnly)
                return remoteValue != null && (bool)remoteValue;

            if (GetUserProfile(classified.CreatorUUID) == null)
                return false;
            //It might be updating, delete the old
            QueryFilter filter = new QueryFilter();
            filter.andFilters["ClassifiedUUID"] = classified.ClassifiedUUID;
            GD.Delete("userclassifieds", filter);
            List<object> values = new List<object>{
                classified.Name.MySqlEscape(),
                classified.Category,
                classified.SimName.MySqlEscape(),
                classified.CreatorUUID,
                classified.ClassifiedUUID,
                OSDParser.SerializeJsonString(classified.ToOSD()),
                classified.ScopeID
            };
            return GD.Insert("userclassifieds", values.ToArray());
        }
开发者ID:andsim,项目名称:Aurora-Sim,代码行数:23,代码来源:LocalProfileConnector.cs

示例2: AddClassified

 public bool AddClassified (Classified classified)
 {
     if (GetUserProfile (classified.CreatorUUID) == null)
         return false;
     //It might be updating, delete the old
     GD.Delete ("userclassifieds", new string[1] { "ClassifiedUUID" }, new object[1] { classified.ClassifiedUUID });
     List<object> values = new List<object>();
     values.Add(classified.Name);
     values.Add(classified.Category);
     values.Add(classified.SimName);
     values.Add(classified.CreatorUUID);
     values.Add(classified.ClassifiedUUID);
     values.Add(OSDParser.SerializeJsonString(classified.ToOSD()));
     return GD.Insert("userclassifieds", values.ToArray());
 }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalProfileConnector.cs

示例3: ClassifiedInfoUpdate

        public void ClassifiedInfoUpdate(UUID queryclassifiedID, uint queryCategory, string queryName, string queryDescription, UUID queryParcelID,
                                         uint queryParentEstate, UUID querySnapshotID, Vector3 queryGlobalPos, byte queryclassifiedFlags,
                                         int queryclassifiedPrice, IClientAPI remoteClient)
        {
            //Security check
            IUserProfileInfo info = ProfileFrontend.GetUserProfile(remoteClient.AgentId);

            if (info == null)
                return;

            ScenePresence p = GetRegionUserIsIn(remoteClient.AgentId).GetScenePresence(remoteClient.AgentId);

            if(p == null)
                return; //Just fail

            IMoneyModule money = p.Scene.RequestModuleInterface<IMoneyModule>();
            if (money != null)
            {
                if (money.AmountCovered(remoteClient, queryclassifiedPrice))
                    money.ApplyCharge(remoteClient.AgentId, queryclassifiedPrice, "Add Classified");
                else
                {
                    remoteClient.SendAlertMessage("You do not have enough money to complete this upload.");
                    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());
            }

            UUID creatorUUID = remoteClient.AgentId;
            UUID classifiedUUID = queryclassifiedID;
            uint category = queryCategory;
            string name = queryName;
            string description = queryDescription;
            uint parentestate = queryParentEstate;
            UUID snapshotUUID = querySnapshotID;
            string simname = remoteClient.Scene.RegionInfo.RegionName;
            Vector3 globalpos = queryGlobalPos;
            byte classifiedFlags = queryclassifiedFlags;
            int classifiedPrice = queryclassifiedPrice;

            UUID parceluuid = p.currentParcelUUID;
            string parcelname = "Unknown";
            IParcelManagementModule parcelManagement = GetRegionUserIsIn(remoteClient.AgentId).RequestModuleInterface<IParcelManagementModule>();
            if (parcelManagement != null)
            {
                ILandObject parcel = parcelManagement.GetLandObject(p.AbsolutePosition.X, p.AbsolutePosition.Y);
                if (parcel != null)
                {
                    parcelname = parcel.LandData.Name;
                    parceluuid = parcel.LandData.InfoUUID;
                }
            }

            uint creationdate = (uint)Util.UnixTimeSinceEpoch();
            
            uint expirationdate = (uint)Util.UnixTimeSinceEpoch() + (365 * 24 * 60 * 60);

            Classified classified = new Classified();
            classified.ClassifiedUUID = classifiedUUID;
            classified.CreatorUUID = creatorUUID;
            classified.CreationDate = creationdate;
            classified.ExpirationDate = expirationdate;
            classified.Category = category;
            classified.Name = name;
            classified.Description = description;
            classified.ParcelUUID = parceluuid;
            classified.ParentEstate = parentestate;
            classified.SnapshotUUID = snapshotUUID;
            classified.SimName = simname;
            classified.GlobalPos = globalpos;
            classified.ParcelName = parcelname;
            classified.ClassifiedFlags = classifiedFlags;
            classified.PriceForListing = classifiedPrice;

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

示例4: AddClassified

 public bool AddClassified (Classified classified)
 {
     try
     {
         List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf (classified.CreatorUUID.ToString (), "RemoteServerURI");
         foreach (string url in serverURIs)
         {
             OSDMap map = new OSDMap ();
             map["Method"] = "addclassified";
             map["Classified"] = classified.ToOSD ();
             WebUtils.PostToService (url + "osd", map, false, false);
         }
     }
     catch (Exception e)
     {
         m_log.DebugFormat ("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString ());
     }
     return true;
 }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:19,代码来源:RemoteProfileConnector.cs

示例5: AddClassified

        public bool AddClassified(Classified classified)
        {
            object remoteValue = DoRemote(classified);
            if (remoteValue != null || m_doRemoteOnly)
                return remoteValue != null && (bool)remoteValue;

            if (GetUserProfile(classified.CreatorUUID) == null)
                return false;
            string keywords = classified.Description;
            if (keywords.Length > 512)
                keywords = keywords.Substring(keywords.Length - 512, 512);
            //It might be updating, delete the old
            QueryFilter filter = new QueryFilter();
            filter.andFilters["ClassifiedUUID"] = classified.ClassifiedUUID;
            GD.Delete("userclassifieds", filter);
            List<object> values = new List<object>{
                classified.Name,
                classified.Category,
                classified.SimName,
                classified.CreatorUUID,
                //classified.ScopeID, // was
                classified.ClassifiedUUID,
                OSDParser.SerializeJsonString(classified.ToOSD()),
                classified.ScopeID, // testing new
                classified.PriceForListing,
                keywords
            };
            return GD.Insert("userclassifieds", values.ToArray());
        }
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:29,代码来源:LocalProfileConnector.cs


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