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


C# Classified.ToKeyValuePairs方法代码示例

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


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

示例1: AddClassified

        public void AddClassified(Classified classified)
        {
            Dictionary<string, object> sendData = classified.ToKeyValuePairs();

            sendData["METHOD"] = "addclassified";

            string reqString = ServerUtils.BuildQueryString(sendData);

            try
            {
                string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI + "/auroradata",
                        reqString);
                if (reply != string.Empty)
                {
                    Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);

                    if (replyData != null)
                    {
                        if (replyData.ContainsKey("result") && (replyData["result"].ToString().ToLower() == "null"))
                        {
                            m_log.DebugFormat("[AuroraRemoteProfileConnector]: AddClassified {0} received null response",
                                classified.ClassifiedUUID);
                        }
                    }

                    else
                    {
                        m_log.DebugFormat("[AuroraRemoteProfileConnector]: AddClassified {0} received null response",
                            classified.ClassifiedUUID);
                    }

                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.Message);
            }
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:39,代码来源:RemoteProfileConnector.cs

示例2: 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;
            if (info.Classifieds.ContainsKey(queryclassifiedID.ToString()))
            {
                OSDMap Classifieds = Util.DictionaryToOSD(info.Classifieds);
                Classified oldClassified = new Classified(Util.OSDToDictionary((OSDMap)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;

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

            UUID parceluuid = p.currentParcelUUID;
            string parcelname = "Unknown";

            string pos_global = new Vector3(remoteClient.Scene.RegionInfo.RegionLocX * Constants.RegionSize + p.AbsolutePosition.X,
                remoteClient.Scene.RegionInfo.RegionLocY * Constants.RegionSize + p.AbsolutePosition.Y,
                p.AbsolutePosition.Z).ToString();

            ILandObject parcel = m_scene.LandChannel.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(), Util.DictionaryToOSD(classified.ToKeyValuePairs()));
            ProfileFrontend.UpdateUserProfile(info);
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:71,代码来源:AvatarProfileModule.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()))
            {
                OSDMap Classifieds = Util.DictionaryToOSD(info.Classifieds);
                Classified oldClassified = new Classified();
                oldClassified.FromOSD((OSDMap)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";

            ILandObject parcel = GetRegionUserIsIn(remoteClient.AgentId).LandChannel.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(), Util.DictionaryToOSD(classified.ToKeyValuePairs()));
            ProfileFrontend.UpdateUserProfile(info);
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:84,代码来源:AvatarProfileModule.cs


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