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


C# IClientAPI.SendLandObjectOwners方法代码示例

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


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

示例1: SendLandObjectOwners

        /// <summary>
        /// Notify the parcel owner each avatar that owns prims situated on their land.  This notification includes
        /// aggreagete details such as the number of prims.
        ///
        /// </summary>
        /// <param name="remote_client">
        /// <see cref="IClientAPI"/>
        /// </param>
        public void SendLandObjectOwners(IClientAPI remote_client)
        {
            if (m_scene.Permissions.CanViewObjectOwners(remote_client.AgentId, this))
            {
                IPrimCountModule primCountModule = m_scene.RequestModuleInterface<IPrimCountModule>();
                if (primCountModule != null)
                {
                    IPrimCounts primCounts = primCountModule.GetPrimCounts(LandData.GlobalID);
                    Dictionary<UUID, LandObjectOwners> owners = new Dictionary<UUID, LandObjectOwners>();
                    foreach (ISceneEntity grp in primCounts.Objects)
                    {
                        bool newlyAdded = false;
                        LandObjectOwners landObj;
                        if(!owners.TryGetValue(grp.OwnerID, out landObj))
                        {
                            landObj = new LandObjectOwners ();
                            owners.Add (grp.OwnerID, landObj);
                            newlyAdded = true;
                        }

                        landObj.Count += grp.PrimCount;
                        //Only do all of this once
                        if (newlyAdded)
                        {
                            if (grp.GroupID != UUID.Zero && grp.GroupID == grp.OwnerID)
                                landObj.GroupOwned = true;
                            else
                                landObj.GroupOwned = false;
                            if (landObj.GroupOwned)
                                landObj.Online = false;
                            else
                            {
                                IAgentInfoService presenceS = m_scene.RequestModuleInterface<IAgentInfoService>();
                                UserInfo info = presenceS.GetUserInfo(grp.OwnerID.ToString());
                                if(info != null)
                                    landObj.Online = info.IsOnline;
                            }
                            landObj.OwnerID = grp.OwnerID;
                        }
                        if(grp.RootChild.Rezzed > landObj.TimeLastRezzed)
                            landObj.TimeLastRezzed = grp.RootChild.Rezzed; 
                    }
                    remote_client.SendLandObjectOwners(new List<LandObjectOwners>(owners.Values));
                }
            }
        }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:54,代码来源:LandObject.cs

示例2: SendLandObjectOwners

        /// <summary>
        /// Notify the parcel owner each avatar that owns prims situated on their land.  This notification includes
        /// aggreagete details such as the number of prims.
        ///
        /// </summary>
        /// <param name="remote_client">
        /// <see cref="IClientAPI"/>
        /// </param>
        public void SendLandObjectOwners(IClientAPI remote_client)
        {
            if (m_scene.Permissions.CanViewObjectOwners(remote_client.AgentId, this))
            {
                Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
                List<UUID> groups = new List<UUID>();

                lock (primsOverMe)
                {
                    try
                    {

                        foreach (SceneObjectGroup obj in primsOverMe)
                        {
                            try
                            {
                                if (!primCount.ContainsKey(obj.OwnerID))
                                {
                                    primCount.Add(obj.OwnerID, 0);
                                }
                            }
                            catch (NullReferenceException)
                            {
                                m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel");
                            }
                            try
                            {
                                primCount[obj.OwnerID] += obj.PrimCount;
                            }
                            catch (KeyNotFoundException)
                            {
                                m_log.Error("[LAND]: Unable to match a prim with it's owner.");
                            }
                            if (obj.OwnerID == obj.GroupID && (!groups.Contains(obj.OwnerID)))
                                groups.Add(obj.OwnerID);
                        }
                    }
                    catch (InvalidOperationException)
                    {
                        m_log.Error("[LAND]: Unable to Enumerate Land object arr.");
                    }
                }

                remote_client.SendLandObjectOwners(LandData, groups, primCount);
            }
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:54,代码来源:LandObject.cs

示例3: SendLandObjectOwners

        /// <summary>
        /// Notify the parcel owner each avatar that owns prims situated on their land.  This notification includes
        /// aggreagete details such as the number of prims.
        ///
        /// </summary>
        /// <param name="remote_client">
        /// A <see cref="IClientAPI"/>
        /// </param>
        public void SendLandObjectOwners(IClientAPI remote_client)
        {
            if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
            {
                Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
                List<UUID> groups = new List<UUID>();

                lock (primsOverMe)
                {
//                    m_log.DebugFormat(
//                        "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", 
//                        remote_client.Name, primsOverMe.Count);
                    
                    try
                    {
                        foreach (SceneObjectGroup obj in primsOverMe)
                        {
                            try
                            {
                                if (!primCount.ContainsKey(obj.OwnerID))
                                {
                                    primCount.Add(obj.OwnerID, 0);
                                }
                            }
                            catch (NullReferenceException)
                            {
                                m_log.Error("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel");
                            }
                            try
                            {
                                primCount[obj.OwnerID] += obj.PrimCount;
                            }
                            catch (KeyNotFoundException)
                            {
                                m_log.Error("[LAND]: Unable to match a prim with it's owner.");
                            }
                            if (obj.OwnerID == obj.GroupID && (!groups.Contains(obj.OwnerID)))
                                groups.Add(obj.OwnerID);
                        }
                    }
                    catch (InvalidOperationException)
                    {
                        m_log.Error("[LAND]: Unable to Enumerate Land object arr.");
                    }
                }

                remote_client.SendLandObjectOwners(LandData, groups, primCount);
            }
        }
开发者ID:pluraldj,项目名称:opensim,代码行数:57,代码来源:LandObject.cs

示例4: SendLandObjectOwners

 /// <summary>
 /// Notify the parcel owner each avatar that owns prims situated on their land.  This notification includes
 /// aggreagete details such as the number of prims.
 ///
 /// </summary>
 /// <param name="remote_client">
 /// <see cref="IClientAPI"/>
 /// </param>
 public void SendLandObjectOwners(IClientAPI remote_client)
 {
     if (m_scene.Permissions.CanViewObjectOwners(remote_client.AgentId, this))
     {
         IPrimCountModule primCountModule = m_scene.RequestModuleInterface<IPrimCountModule>();
         if (primCountModule != null)
         {
             IPrimCounts primCounts = primCountModule.GetPrimCounts(LandData.GlobalID);
             Dictionary<UUID, LandObjectOwners> owners = new Dictionary<UUID, LandObjectOwners>();
             List<UUID> groups = primCounts.Groups;
             foreach(SceneObjectPart part in primCounts.Objects)
             {
                 bool newlyAdded = false;
                 if(!owners.ContainsKey(part.OwnerID))
                 {
                     owners.Add(part.OwnerID, new LandObjectOwners());
                     newlyAdded = true;
                 }
                 LandObjectOwners landObj = owners[part.OwnerID];
                 landObj.Count++;
                 //Only do all of this once
                 if(newlyAdded)
                 {
                 if (LandData.GroupID == part.OwnerID || groups.Contains(part.OwnerID))
                     landObj.GroupOwned = true;
                 else
                     landObj.GroupOwned = false;
                 if(landObj.GroupOwned)
                     landObj.Online = false;
                 else
                 {
                     IPresenceService presenceS = m_scene.RequestModuleInterface<IPresenceService>();
                     landObj.Online = presenceS.GetAgents(new string[1]{part.OwnerID.ToString()}).Length > 0;
                 }
                 landObj.OwnerID = part.OwnerID;
                 }
                 if(part.Rezzed > landObj.TimeLastRezzed)
                     landObj.TimeLastRezzed = part.Rezzed; 
             }
             remote_client.SendLandObjectOwners(new List<LandObjectOwners>(owners.Values));
         }
     }
 }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:51,代码来源:LandObject.cs


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