private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
        {
            SceneObjectPart obj         = scene.GetSceneObjectPart(objectID);
            Vector3         oldPoint    = obj.GroupPosition;
            int             objectCount = obj.ParentGroup.PrimCount;
            ILandObject     oldParcel   = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
            ILandObject     newParcel   = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);

            int usedPrims         = newParcel.PrimCounts.Total;
            int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();

            // The prim hasn't crossed a region boundry so we don't need to worry
            // about prim counts here
            if (oldParcel.Equals(newParcel))
            {
                return(true);
            }

            // Prim counts are determined by the location of the root prim.  if we're
            // moving a child prim, just let it pass
            if (!obj.IsRoot)
            {
                return(true);
            }

            // TODO: Add Special Case here for temporary prims

            if (objectCount + usedPrims > simulatorCapacity)
            {
                m_dialogModule.SendAlertToUser(obj.OwnerID, "Unable to move object because the destination parcel  is too full");
                return(false);
            }

            return(true);
        }
Exemple #2
0
        private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
        {
            if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) ||
                newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY))
            {
                return(true);
            }

            SceneObjectPart obj = scene.GetSceneObjectPart(objectID);

            if (obj == null)
            {
                return(false);
            }

            // Prim counts are determined by the location of the root prim.  if we're
            // moving a child prim, just let it pass
            if (!obj.IsRoot)
            {
                return(true);
            }

            ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);

            if (newParcel == null)
            {
                return(true);
            }

            Vector3     oldPoint  = obj.GroupPosition;
            ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);

            // The prim hasn't crossed a region boundry so we don't need to worry
            // about prim counts here
            if (oldParcel != null && oldParcel.Equals(newParcel))
            {
                return(true);
            }

            int objectCount       = obj.ParentGroup.PrimCount;
            int usedPrims         = newParcel.PrimCounts.Total;
            int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();

            // TODO: Add Special Case here for temporary prims

            string response = DoCommonChecks(objectCount, obj.OwnerID, newParcel, scene);

            if (response != null)
            {
                m_dialogModule.SendAlertToUser(obj.OwnerID, response);
                return(false);
            }
            return(true);
        }
        //OnDuplicateObject
        private bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition)
        {
            ILandObject lo                = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y);
            int         usedPrims         = lo.PrimCounts.Total;
            int         simulatorCapacity = lo.GetSimulatorMaxPrimCount();

            if (objectCount + usedPrims > simulatorCapacity)
            {
                m_dialogModule.SendAlertToUser(owner, "Unable to duplicate object because the parcel is too full");
                return(false);
            }

            return(true);
        }
        private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo, Scene scene)
        {
            string response = null;

            int simulatorCapacity = lo.GetSimulatorMaxPrimCount();

            if ((objectCount + lo.PrimCounts.Total) > simulatorCapacity)
            {
                response = "Unable to rez object because the parcel is too full";
            }
            else
            {
                int maxPrimsPerUser = scene.RegionInfo.MaxPrimsPerUser;
                if (maxPrimsPerUser >= 0)
                {
                    // per-user prim limit is set
                    if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned)
                    {
                        // caller is not the sole Parcel owner
                        EstateSettings estateSettings = scene.RegionInfo.EstateSettings;
                        if (ownerID != estateSettings.EstateOwner)
                        {
                            // caller is NOT the Estate owner
                            List <UUID> mgrs = new List <UUID>(estateSettings.EstateManagers);
                            if (!mgrs.Contains(ownerID))
                            {
                                // caller is not an Estate Manager
                                if ((lo.PrimCounts.Users[ownerID] + objectCount) > maxPrimsPerUser)
                                {
                                    response = "Unable to rez object because you have reached your limit";
                                }
                            }
                        }
                    }
                }
            }
            return(response);
        }
        private void AppendParcelReport(StringBuilder report, ILandObject lo)
        {
            LandData ld = lo.LandData;

            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Parcel name", ld.Name);
            cdl.AddRow("Local ID", ld.LocalID);
            cdl.AddRow("Description", ld.Description);
            cdl.AddRow("Snapshot ID", ld.SnapshotID);
            cdl.AddRow("Area", ld.Area);
            cdl.AddRow("AABB Min", ld.AABBMin);
            cdl.AddRow("AABB Max", ld.AABBMax);
            string ownerName;
            if (ld.IsGroupOwned)
            {
                GroupRecord rec = m_groupManager.GetGroupRecord(ld.GroupID);
                ownerName = (rec != null) ? rec.GroupName : "Unknown Group";
            }
            else
            {
                ownerName = m_userManager.GetUserName(ld.OwnerID);
            }
            cdl.AddRow("Owner", ownerName);
            cdl.AddRow("Is group owned?", ld.IsGroupOwned);
            cdl.AddRow("GroupID", ld.GroupID);

            cdl.AddRow("Status", ld.Status);
            cdl.AddRow("Flags", (ParcelFlags)ld.Flags);           

            cdl.AddRow("Landing Type", (LandingType)ld.LandingType);
            cdl.AddRow("User Location", ld.UserLocation);
            cdl.AddRow("User look at", ld.UserLookAt);

            cdl.AddRow("Other clean time", ld.OtherCleanTime);

            cdl.AddRow("Max Prims", lo.GetParcelMaxPrimCount());
            cdl.AddRow("Simwide Max Prims (owner)", lo.GetSimulatorMaxPrimCount());
            IPrimCounts pc = lo.PrimCounts;
            cdl.AddRow("Owner Prims", pc.Owner);
            cdl.AddRow("Group Prims", pc.Group);
            cdl.AddRow("Other Prims", pc.Others);
            cdl.AddRow("Selected Prims", pc.Selected);
            cdl.AddRow("Total Prims", pc.Total);
            cdl.AddRow("SimWide Prims (owner)", pc.Simulator);

            cdl.AddRow("Music URL", ld.MusicURL);
            cdl.AddRow("Obscure Music", ld.ObscureMusic);

            cdl.AddRow("Media ID", ld.MediaID);
            cdl.AddRow("Media Autoscale", Convert.ToBoolean(ld.MediaAutoScale));
            cdl.AddRow("Media URL", ld.MediaURL);
            cdl.AddRow("Media Type", ld.MediaType);
            cdl.AddRow("Media Description", ld.MediaDescription);
            cdl.AddRow("Media Width", ld.MediaWidth);
            cdl.AddRow("Media Height", ld.MediaHeight);
            cdl.AddRow("Media Loop", ld.MediaLoop);
            cdl.AddRow("Obscure Media", ld.ObscureMedia);

            cdl.AddRow("Parcel Category", ld.Category);

            cdl.AddRow("Claim Date", ld.ClaimDate);
            cdl.AddRow("Claim Price", ld.ClaimPrice);
            cdl.AddRow("Pass Hours", ld.PassHours);
            cdl.AddRow("Pass Price", ld.PassPrice);

            cdl.AddRow("Auction ID", ld.AuctionID);
            cdl.AddRow("Authorized Buyer ID", ld.AuthBuyerID);
            cdl.AddRow("Sale Price", ld.SalePrice);

            cdl.AddToStringBuilder(report);
        }
        private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo, Scene scene)
        {
            string response = null;

            int simulatorCapacity = lo.GetSimulatorMaxPrimCount();
            if ((objectCount + lo.PrimCounts.Total) > simulatorCapacity)
            {
                response = "Unable to rez object because the parcel is too full";
            }
            else
            {
                int maxPrimsPerUser = scene.RegionInfo.MaxPrimsPerUser;
                if (maxPrimsPerUser >= 0)
                {
                    // per-user prim limit is set
                    if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned)
                    {
                        // caller is not the sole Parcel owner
                        EstateSettings estateSettings = scene.RegionInfo.EstateSettings;
                        if (ownerID != estateSettings.EstateOwner)
                        {
                            // caller is NOT the Estate owner
                            List<UUID> mgrs = new List<UUID>(estateSettings.EstateManagers);
                            if (!mgrs.Contains(ownerID))
                            {
                                // caller is not an Estate Manager
                                if ((lo.PrimCounts.Users[ownerID] + objectCount) >  maxPrimsPerUser)
                                {
                                    response = "Unable to rez object because you have reached your limit";
                                }
                            }
                        }
                    }
                }
            }
            return response;
        }