From 5074d290e4aeb583560272cadc8ba09aa8337210 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 27 May 2010 21:35:17 +0100
Subject: commit code which stops full updates being fired multiple times when
attachments cross standalone region boundaries
lots of messy debug code here too which would need to be removed
---
OpenSim/Region/Framework/Scenes/Scene.cs | 43 +++++++++++++++++++++++++++-----
1 file changed, 37 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 637ebff..dd2d2cc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1850,9 +1850,31 @@ namespace OpenSim.Region.Framework.Scenes
/// true if the object was added, false if an object with the same uuid was already in the scene
///
public bool AddRestoredSceneObject(
+ SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
+ {
+ return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates);
+ }
+
+ ///
+ /// Add an object into the scene that has come from storage
+ ///
+ ///
+ ///
+ ///
+ /// If true, changes to the object will be reflected in its persisted data
+ /// If false, the persisted data will not be changed even if the object in the scene is changed
+ ///
+ ///
+ /// If true, we won't persist this object until it changes
+ /// If false, we'll persist this object immediately
+ ///
+ ///
+ /// true if the object was added, false if an object with the same uuid was already in the scene
+ ///
+ public bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
{
- return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted);
+ return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true);
}
///
@@ -2461,7 +2483,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public bool IncomingCreateObject(ISceneObject sog)
{
- //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
+ m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
SceneObjectGroup newObject;
try
{
@@ -2533,10 +2555,12 @@ namespace OpenSim.Region.Framework.Scenes
if (sceneObject.IsAttachmentCheckFull()) // Attachment
{
+ m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId);
+
sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
- AddRestoredSceneObject(sceneObject, false, false);
+ AddRestoredSceneObject(sceneObject, false, false, false);
// Handle attachment special case
SceneObjectPart RootPrim = sceneObject.RootPart;
@@ -2544,6 +2568,8 @@ namespace OpenSim.Region.Framework.Scenes
// Fix up attachment Parent Local ID
ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
+ Console.WriteLine("AAAA");
+
//uint parentLocalID = 0;
if (sp != null)
{
@@ -2562,20 +2588,25 @@ namespace OpenSim.Region.Framework.Scenes
//grp.SetFromAssetID(grp.RootPart.LastOwnerID);
m_log.DebugFormat(
"[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
-
+
+ RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
AttachObject(
sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
- RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
- grp.SendGroupFullUpdate();
+
+ //grp.SendGroupFullUpdate();
}
else
{
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
}
+
+ Console.WriteLine("BBBB");
}
else
{
+ m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId);
+
AddRestoredSceneObject(sceneObject, true, false);
if (!Permissions.CanObjectEntry(sceneObject.UUID,
--
cgit v1.1