From 8e6fc69a112ab675b0614bd31f7274282ec10164 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 27 Mar 2020 17:22:18 +0000 Subject: [PATCH] let pseudoCRC (for objcache) be per part and not just per SOG --- .../Framework/Scenes/SceneObjectGroup.cs | 8 +--- .../Framework/Scenes/SceneObjectPart.cs | 37 ++++++++++++++----- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6b60123031..af2b286c83 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -147,8 +147,6 @@ namespace OpenSim.Region.Framework.Scenes private long m_maxPersistTime = 0; private long m_minPersistTime = 0; - public int PseudoCRC; - /// /// This indicates whether the object has changed such that it needs to be repersisted to permenant storage /// (the database). @@ -167,7 +165,6 @@ namespace OpenSim.Region.Framework.Scenes if (Backup) m_scene.SceneGraph.FireChangeBackup(this); - PseudoCRC = (int)(DateTime.UtcNow.Ticks); timeLastChanged = DateTime.UtcNow.Ticks; if (!m_hasGroupChanged) timeFirstChanged = timeLastChanged; @@ -1336,7 +1333,6 @@ namespace OpenSim.Region.Framework.Scenes public SceneObjectGroup() { m_lastCollisionSoundMS = Util.GetTimeStampMS() + 1000.0; - PseudoCRC = (int)(DateTime.UtcNow.Ticks); } /// @@ -2545,7 +2541,7 @@ namespace OpenSim.Region.Framework.Scenes } dupe.InvalidatePartsLinkMaps(); - dupe.PseudoCRC = (int)(DateTime.UtcNow.Ticks); + m_dupeInProgress = false; return dupe; } @@ -2799,7 +2795,6 @@ namespace OpenSim.Region.Framework.Scenes } } - PseudoCRC = (int)(DateTime.UtcNow.Ticks); rpart.ScheduleFullUpdate(); } @@ -2839,7 +2834,6 @@ namespace OpenSim.Region.Framework.Scenes part.ResetIDs(part.LinkNum); // Don't change link nums m_parts.Add(part.UUID, part); } - PseudoCRC = (int)(DateTime.UtcNow.Ticks); } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7b5b729043..d43ebbe315 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -181,6 +181,10 @@ namespace OpenSim.Region.Framework.Scenes public Vector3 StatusSandboxPos; + [XmlIgnore] + public int PseudoCRC; // this is local to region. should only be stored on its db. + // This is just a number that needs to change to invalidate prim data caches + [XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2}; @@ -405,7 +409,8 @@ namespace OpenSim.Region.Framework.Scenes m_particleSystem = Utils.EmptyBytes; Rezzed = DateTime.UtcNow; Description = String.Empty; - + PseudoCRC = (int)DateTime.UtcNow.Ticks; // random could be as good; fallbak if not on region db + // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log @@ -444,6 +449,7 @@ namespace OpenSim.Region.Framework.Scenes APIDActive = false; Flags = 0; CreateSelected = true; + PseudoCRC = (int)DateTime.UtcNow.Ticks; // random could be as good TrimPermissions(); AggregateInnerPerms(); } @@ -2193,6 +2199,8 @@ namespace OpenSim.Region.Framework.Scenes if (dupe.PhysActor != null) dupe.PhysActor.LocalID = plocalID; + dupe.PseudoCRC = (int)(DateTime.UtcNow.Ticks); + ParentGroup.Scene.EventManager.TriggerOnSceneObjectPartCopy(dupe, this, userExposed); // m_log.DebugFormat("[SCENE OBJECT PART]: Clone of {0} {1} finished", Name, UUID); @@ -3045,6 +3053,7 @@ namespace OpenSim.Region.Framework.Scenes LinkNum = linkNum; LocalId = 0; Inventory.ResetInventoryIDs(); + ++PseudoCRC; } @@ -3195,8 +3204,9 @@ namespace OpenSim.Region.Framework.Scenes { if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) return; - - if(ParentGroup.Scene.GetNumberOfClients() == 0) + + ++PseudoCRC; + if (ParentGroup.Scene.GetNumberOfClients() == 0) return; ParentGroup.QueueForUpdateCheck(); // just in case @@ -3212,6 +3222,8 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) return; + ++PseudoCRC; + if (ParentGroup.Scene.GetNumberOfClients() == 0) return; @@ -3236,6 +3248,7 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) return; + ++PseudoCRC; ParentGroup.HasGroupChanged = true; if(ParentGroup.Scene.GetNumberOfClients() == 0) @@ -3269,6 +3282,7 @@ namespace OpenSim.Region.Framework.Scenes if (update == PrimUpdateFlags.None) return; + ++PseudoCRC; ParentGroup.HasGroupChanged = true; if (ParentGroup.Scene.GetNumberOfClients() == 0) @@ -3340,8 +3354,9 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null) return; + ++PseudoCRC; // Update the "last" values - lock(UpdateFlagLock) + lock (UpdateFlagLock) { m_lastPosition = AbsolutePosition; m_lastRotation = RotationOffset; @@ -3363,8 +3378,9 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null) return; + ++PseudoCRC; // Update the "last" values - lock(UpdateFlagLock) + lock (UpdateFlagLock) { m_lastPosition = AbsolutePosition; m_lastRotation = RotationOffset; @@ -3963,13 +3979,14 @@ namespace OpenSim.Region.Framework.Scenes public void SetGroup(UUID groupID, IClientAPI client) { // Scene.AddNewPrims() calls with client == null so can't use this. -// m_log.DebugFormat( -// "[SCENE OBJECT PART]: Setting group for {0} to {1} for {2}", -// Name, groupID, OwnerID); + // m_log.DebugFormat( + // "[SCENE OBJECT PART]: Setting group for {0} to {1} for {2}", + // Name, groupID, OwnerID); + ++PseudoCRC; GroupID = groupID; -// if (client != null) -// SendPropertiesToClient(client); + // if (client != null) + // SendPropertiesToClient(client); lock(UpdateFlagLock) UpdateFlag |= PrimUpdateFlags.FullUpdate; }