diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs index 854986508a..db453df85c 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs @@ -432,6 +432,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule partNum++; } + m_log.Debug(LogHeader + " to SendLinkObject to link " + children.Count + " parts to " + root.Name); + m_log.Debug("LinkedObject: "+sogxml); + SymmetricSyncMessage rsm = new SymmetricSyncMessage(SymmetricSyncMessage.MsgType.LinkObject, OSDParser.SerializeJsonString(data)); SendObjectUpdateToRelevantSyncConnectors(linkedGroup, rsm); } @@ -764,6 +767,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule data["LastUpdateTimeStamp"] = OSD.FromLong(updatedPart.BucketSyncInfoList[bucketName].LastUpdateTimeStamp); data["LastUpdateActorID"] = OSD.FromString(updatedPart.BucketSyncInfoList[bucketName].LastUpdateActorID); + m_log.Debug(LogHeader + " Send out Physics Bucket updates for " + updatedPart.Name + ". GroupPosition: " + updatedPart.GroupPosition.ToString() + ", Position = " + pa.Position); + SymmetricSyncMessage syncMsg = new SymmetricSyncMessage(SymmetricSyncMessage.MsgType.UpdatedBucketProperties, OSDParser.SerializeJsonString(data)); //m_log.DebugFormat("{0}: PhysBucketSender for {1}, pos={2}", LogHeader, updatedPart.UUID.ToString(), pa.Position.ToString()); SendObjectUpdateToRelevantSyncConnectors(updatedPart, syncMsg); @@ -838,6 +843,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule { //string sogxml = SceneObjectSerializer.ToXml2Format(sog); //SymmetricSyncMessage syncMsg = new SymmetricSyncMessage(SymmetricSyncMessage.MsgType.UpdatedObject, sogxml); + + m_log.Debug(LogHeader + " send " + syncMsg.Type.ToString() + " about "+sog.Name+"," + sog.UUID+ " to " + connector.OtherSideActorID); + connector.EnqueueOutgoingUpdate(sog.UUID, syncMsg.ToBytes()); } } @@ -1518,6 +1526,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule string sogxml = Encoding.ASCII.GetString(msg.Data, 0, msg.Length); SceneObjectGroup sog = SceneObjectSerializer.FromXml2Format(sogxml); + //SYNC DEBUG + string partnames = ""; + foreach (SceneObjectPart part in sog.Parts) + { + partnames += "(" + part.Name + ", " + part.UUID + ")"; + } + m_log.Debug(LogHeader+" received "+msg.Type.ToString()+" from "+senderActorID+" about obj "+sog.Name+", "+sog.UUID+"; parts -- "+partnames); + if (sog.IsDeleted) { SymmetricSyncMessage.HandleTrivial(LogHeader, msg, String.Format("Ignoring update on deleted object, UUID: {0}.", sog.UUID)); @@ -1696,6 +1712,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule private void HandleLinkObject(SymmetricSyncMessage msg, string senderActorID) { + // Get the data from message and error check OSDMap data = DeserializeMessage(msg); if (data == null) @@ -1717,6 +1734,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule childrenIDs.Add(data[partTempID].AsUUID()); } + m_log.Debug(LogHeader + " received LinkObject from " + senderActorID); + //m_log.Debug("LinkedObject: " + sogxml); + m_scene.LinkObjectBySync(linkedGroup, rootID, childrenIDs); //if this is a relay node, forwards the event diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e73c381545..6d086d6844 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2198,7 +2198,11 @@ namespace OpenSim.Region.Framework.Scenes AddNewSceneObject(group, true, pos, rot, vel); //SYNC DEBUG - m_log.DebugFormat("[SCENE] RezObject {0} with InvItem name {1} at pos {2}", group.UUID.ToString(), item.Name, group.RootPart.GroupPosition.ToString()); + string partnames = ""; + foreach (SceneObjectPart part in group.Parts){ + partnames += "(" + part.Name + ", " + part.UUID + ")"; + } + m_log.DebugFormat("[SCENE] RezObject {0} with InvItem name {1} at pos {2} with parts {3}", group.UUID.ToString(), item.Name, group.RootPart.GroupPosition.ToString(), partnames); // We can only call this after adding the scene object, since the scene object references the scene // to find out if scripts should be activated at all. diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 59c7a0bc1c..eda4365930 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -791,11 +791,14 @@ namespace OpenSim.Region.Framework.Scenes continue; } - m_log.Debug("to link part " + part.DebugObjectPartProperties()); + //m_log.Debug("to link part " + part.DebugObjectPartProperties()); + m_log.Debug("to link part " + part.Name + "," + part.UUID + "; its SOG has " + part.ParentGroup.Parts + " parts"); children.Add(part); } + //m_log.Debug("to link " + children.Count + " parts with " + root.Name); + //Leverage the LinkObject implementation to get the book keeping of Group and Parts relations right m_sceneGraph.LinkObjectsBySync(root, children); diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 13b0af51b8..e523e10f98 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -2018,7 +2018,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - m_log.Debug("AddSceneObjectByStateSynch to be called"); + m_log.Debug(updatedSog.Name+" "+updatedSog.UUID+" not found in Entities list. Need to add"); AddSceneObjectByStateSynch(updatedSog); updateResult = Scene.ObjectUpdateResult.New; } @@ -2062,6 +2062,8 @@ namespace OpenSim.Region.Framework.Scenes } m_numPrim += children.Length; + m_log.Debug("Attached obj " + sceneObject.Name + "," + sceneObject.UUID + " to Scene"); + sceneObject.AttachToScene(m_parentScene); //Take some special care of the case of this object being an attachment diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5120e90783..9f9f193360 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2909,6 +2909,7 @@ namespace OpenSim.Region.Framework.Scenes //we need to do a terse update even if the move wasn't allowed // so that the position is reset in the client (the object snaps back) //ScheduleGroupForTerseUpdate(); + m_log.Debug(this.Name + " GroupPosition changed to " + AbsolutePosition.ToString()); List updatedProperties = new List() { SceneObjectPartProperties.GroupPosition }; if (IsAttachment) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4bcef483d2..3749ddc5b1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5504,15 +5504,33 @@ namespace OpenSim.Region.Framework.Scenes //buckets may not be filled at all in "updatedPart". private void PhysicsBucketUpdateProcessor(Object updatedPartO, string bucketName) { + SceneObjectPart localPart = this; + + if (updatedPartO is SceneObjectPart) + { + SceneObjectPart updatedPart = (SceneObjectPart)updatedPartO; + + localPart.GroupPosition = updatedPart.GroupPosition; + localPart.OffsetPosition = updatedPart.OffsetPosition; + localPart.Scale = updatedPart.Scale; + localPart.Velocity = updatedPart.Velocity; + localPart.AngularVelocity = updatedPart.AngularVelocity; + localPart.RotationOffset = updatedPart.RotationOffset; + return; + } + if (!(updatedPartO is OSDMap)) return; OSDMap data = (OSDMap)updatedPartO; //If needed, we could define new set functions for these properties, and cast this SOP to SOPBase to //invoke the set functions in SOPBase //SceneObjectPartBase localPart = (SceneObjectPartBase)this; - SceneObjectPart localPart = this; + //SceneObjectPart localPart = this; PhysicsActor pa = localPart.PhysActor; + m_log.Debug("Received Physics Bucket updates for " + localPart.Name + ". GroupPosition: " + data["GroupPosition"].AsVector3().ToString() + + ", Position = " + data["Position"].AsVector3().ToString()); + //m_log.DebugFormat("{0}: PhysicsBucketUpdateProcessor. pos={1}", "[SCENE OBJECT PART]", data["Position"].AsVector3().ToString()); lock (m_bucketUpdateLocks[bucketName]) @@ -5618,6 +5636,9 @@ namespace OpenSim.Region.Framework.Scenes string bucketName = m_primPropertyBucketMap[property]; //m_bucketSyncTainted[bucketName] = true; m_bucketSyncInfoList[bucketName].TaintBucket(); + + m_log.Debug(this.Name + ": " + property.ToString() + " just changed. Tainted " + bucketName); + } } } @@ -5758,6 +5779,8 @@ namespace OpenSim.Region.Framework.Scenes //Second, if need to update local properties, call each bucket's update process if (m_bucketUpdateProcessors.ContainsKey(bucketName)) { + m_log.Debug("Update properties in " + bucketName + " buckets"); + m_bucketUpdateProcessors[bucketName](updatedPart, bucketName); partUpdateResult = Scene.ObjectUpdateResult.Updated; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7253a7fed9..e693c25370 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3567,12 +3567,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api item = m_host.TaskInventory[invItemID]; } + /* if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 && !m_automaticLinkPermission) { ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); return; } + */ IClientAPI client = null; ScenePresence sp = World.GetScenePresence(item.PermsGranter); @@ -3585,6 +3587,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; // Fail silently if attached SceneObjectGroup parentPrim = null, childPrim = null; + //SYEMMETRIC SYNC + List children = new List(); + if (targetPart != null) { if (parent != 0) { @@ -3596,6 +3601,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api parentPrim = targetPart.ParentGroup; childPrim = m_host.ParentGroup; } + children.Add(childPrim.RootPart); + // byte uf = childPrim.RootPart.UpdateFlag; childPrim.RootPart.UpdateFlag = 0; parentPrim.LinkToGroup(childPrim); @@ -3614,7 +3621,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { //Tell other actors to link the SceneObjectParts together as a new group. //parentGroup.SyncInfoUpdate(); - World.RegionSyncModule.SendLinkObject(parentPrim, parentPrim.RootPart, new List(childPrim.Parts)); + World.RegionSyncModule.SendLinkObject(parentPrim, parentPrim.RootPart, children); } m_host.ScheduleFullUpdate(new List(){SceneObjectPartProperties.None}); //SendLinkObject above will synchronize the link operation, no need to taint updates here //end of SYMMETRIC SYNC diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 035442c88f..17513ecc34 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -741,7 +741,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } catch (Exception e) { - m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message); + m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message); m_InEvent = false; m_CurrentEvent = String.Empty;