Exemple #1
0
        /// <summary>
        ///     Notify the parcel owner each avatar that owns prims situated on their land.  This notification includes
        ///     aggregate 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));
                }
            }
        }
Exemple #2
0
        /// <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));
                }
            }
        }