Revised SetSOPPropertyValue in RegionSyncModule.cs:
added calling aggregateScriptEventSubscriptions() after SOP.AggregateScriptEvents is set. for properties AttachedAvatar and AttachmentPoint, do extra work besides copying the property values. Propogation of colission event and attachment (attached after avatar login) both working now.dsg
parent
cd70c3ff56
commit
854cb58d6d
|
@ -1977,9 +1977,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
{
|
{
|
||||||
pos = part.PhysActor.Position;
|
pos = part.PhysActor.Position;
|
||||||
}
|
}
|
||||||
m_log.WarnFormat(" -- part {0}, UUID {1}, LocalID {2}, GroupPos {3}, offset-position {4}, Position {5}, AggregateScriptEvents ={6}, Flags = {7}, LocalFlags {8}",
|
m_log.WarnFormat("-- part {0}, UUID {1}, LocalID {2}, GroupPos {3}, offset-position {4}, Position {5}, AggregateScriptEvents ={6}, Flags = {7}, LocalFlags {8}, Scale {9}",
|
||||||
part.Name, part.UUID, part.LocalId, part.GroupPosition, part.OffsetPosition,
|
part.Name, part.UUID, part.LocalId, part.GroupPosition, part.OffsetPosition,
|
||||||
pos, part.AggregateScriptEvents, part.Flags, part.LocalFlags);
|
pos, part.AggregateScriptEvents, part.Flags, part.LocalFlags, part.Scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2002,6 +2002,20 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
foreach (EntityBase entity in entities)
|
foreach (EntityBase entity in entities)
|
||||||
{
|
{
|
||||||
if (entity is SceneObjectGroup)
|
if (entity is SceneObjectGroup)
|
||||||
|
{
|
||||||
|
|
||||||
|
SceneObjectGroup sog = (SceneObjectGroup)entity;
|
||||||
|
|
||||||
|
string sogXml = sog.ToXml2();
|
||||||
|
|
||||||
|
SceneObjectGroup sogCopy = SceneXmlLoader.DeserializeGroupFromXml2(sogXml);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//debug functions
|
||||||
|
private void BucketSyncDebug()
|
||||||
{
|
{
|
||||||
//Legacy serialization/deserialization for bucket based sync
|
//Legacy serialization/deserialization for bucket based sync
|
||||||
/*
|
/*
|
||||||
|
@ -2023,6 +2037,17 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
SceneObjectPart part = new SceneObjectPart();
|
SceneObjectPart part = new SceneObjectPart();
|
||||||
SceneObjectSerializer.ProcessBucketSyncInfo(part, reader);
|
SceneObjectSerializer.ProcessBucketSyncInfo(part, reader);
|
||||||
* */
|
* */
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PrimSyncSerializationDebug()
|
||||||
|
{
|
||||||
|
if (m_scene != null)
|
||||||
|
{
|
||||||
|
EntityBase[] entities = m_scene.GetEntities();
|
||||||
|
foreach (EntityBase entity in entities)
|
||||||
|
{
|
||||||
|
if (entity is SceneObjectGroup)
|
||||||
|
{
|
||||||
|
|
||||||
SceneObjectGroup sog = (SceneObjectGroup)entity;
|
SceneObjectGroup sog = (SceneObjectGroup)entity;
|
||||||
|
|
||||||
|
@ -2068,8 +2093,12 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//end of debug functions
|
||||||
|
|
||||||
|
|
||||||
//Start connections to each remote listener.
|
//Start connections to each remote listener.
|
||||||
//For now, there is only one remote listener.
|
//For now, there is only one remote listener.
|
||||||
private bool StartSyncConnections()
|
private bool StartSyncConnections()
|
||||||
|
@ -3664,7 +3693,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
//Skip if the prim is on longer in the local Scene Graph
|
//Skip if the prim is on longer in the local Scene Graph
|
||||||
if (prim == null)
|
if (prim == null)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("{0}: in SyncOutPrimUpdates, prim {1} no longer in local SceneGraph", LogHeader, primUUID);
|
//m_log.WarnFormat("{0}: in SyncOutPrimUpdates, prim {1} no longer in local SceneGraph", LogHeader, primUUID);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//Skip if the object group is being deleted
|
//Skip if the object group is being deleted
|
||||||
|
@ -3694,6 +3723,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
|
|
||||||
//Sync the SOP data and cached property values in PrimSyncInfoManager again
|
//Sync the SOP data and cached property values in PrimSyncInfoManager again
|
||||||
HashSet<SceneObjectPartSyncProperties> propertiesWithSyncInfoUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoByLocal(sop, new List<SceneObjectPartSyncProperties>(updatedProperties));
|
HashSet<SceneObjectPartSyncProperties> propertiesWithSyncInfoUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoByLocal(sop, new List<SceneObjectPartSyncProperties>(updatedProperties));
|
||||||
|
updatedProperties.UnionWith(propertiesWithSyncInfoUpdated);
|
||||||
SendPrimPropertyUpdates(sop, updatedProperties);
|
SendPrimPropertyUpdates(sop, updatedProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6658,7 +6688,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
///////////////////////
|
///////////////////////
|
||||||
case SceneObjectPartSyncProperties.AggregateScriptEvents:
|
case SceneObjectPartSyncProperties.AggregateScriptEvents:
|
||||||
part.AggregateScriptEvents = (scriptEvents)pSyncInfo.LastUpdateValue;
|
part.AggregateScriptEvents = (scriptEvents)pSyncInfo.LastUpdateValue;
|
||||||
|
part.aggregateScriptEventSubscriptions();
|
||||||
//DebugLog.DebugFormat("set {0} value to be {1}", property.ToString(), part.AggregateScriptEvents);
|
//DebugLog.DebugFormat("set {0} value to be {1}", property.ToString(), part.AggregateScriptEvents);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -6669,13 +6699,21 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
part.AngularVelocity = (Vector3)pSyncInfo.LastUpdateValue;
|
part.AngularVelocity = (Vector3)pSyncInfo.LastUpdateValue;
|
||||||
break;
|
break;
|
||||||
case SceneObjectPartSyncProperties.AttachedAvatar:
|
case SceneObjectPartSyncProperties.AttachedAvatar:
|
||||||
part.AttachedAvatar = (UUID)pSyncInfo.LastUpdateValue;
|
//part.AttachedAvatar = (UUID)pSyncInfo.LastUpdateValue;
|
||||||
|
UUID attachedAvatar = (UUID)pSyncInfo.LastUpdateValue;
|
||||||
|
if (!part.AttachedAvatar.Equals(attachedAvatar))
|
||||||
|
{
|
||||||
|
part.AttachedAvatar = attachedAvatar;
|
||||||
|
ScenePresence avatar = part.ParentGroup.Scene.GetScenePresence(attachedAvatar);
|
||||||
|
part.ParentGroup.RootPart.SetParentLocalId(avatar.LocalId);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SceneObjectPartSyncProperties.AttachedPos:
|
case SceneObjectPartSyncProperties.AttachedPos:
|
||||||
part.AttachedPos = (Vector3)pSyncInfo.LastUpdateValue;
|
part.AttachedPos = (Vector3)pSyncInfo.LastUpdateValue;
|
||||||
break;
|
break;
|
||||||
case SceneObjectPartSyncProperties.AttachmentPoint:
|
case SceneObjectPartSyncProperties.AttachmentPoint:
|
||||||
part.AttachmentPoint = (uint)pSyncInfo.LastUpdateValue;
|
//part.AttachmentPoint = (uint)pSyncInfo.LastUpdateValue;
|
||||||
|
part.SetAttachmentPoint((uint)pSyncInfo.LastUpdateValue);
|
||||||
break;
|
break;
|
||||||
case SceneObjectPartSyncProperties.BaseMask:
|
case SceneObjectPartSyncProperties.BaseMask:
|
||||||
part.BaseMask = (uint)pSyncInfo.LastUpdateValue;
|
part.BaseMask = (uint)pSyncInfo.LastUpdateValue;
|
||||||
|
|
|
@ -2167,7 +2167,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
sceneObject.AttachToScene(m_parentScene);
|
sceneObject.AttachToScene(m_parentScene);
|
||||||
|
|
||||||
//Take some special care of the case of this object being an attachment
|
//Take some special care of the case of this object being an attachment,
|
||||||
|
//since localID of attachedAvatar is different in different sync node's
|
||||||
|
//Scene copies.
|
||||||
sceneObject.RootPart.SetAttachmentPoint(sceneObject.RootPart.AttachmentPoint);
|
sceneObject.RootPart.SetAttachmentPoint(sceneObject.RootPart.AttachmentPoint);
|
||||||
if (sceneObject.IsAttachment)
|
if (sceneObject.IsAttachment)
|
||||||
{
|
{
|
||||||
|
@ -2175,13 +2177,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
sceneObject.RootPart.SetParentLocalId(avatar.LocalId);
|
sceneObject.RootPart.SetParentLocalId(avatar.LocalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//DSG SYNC,
|
|
||||||
sceneObject.HasGroupChanged = true;
|
sceneObject.HasGroupChanged = true;
|
||||||
//NewObject is sent via a specific sync message, not through updates;
|
//NewObject is sent via a specific sync message, not through updates;
|
||||||
//hence not passing any property list here in calling
|
//hence not passing any property list here
|
||||||
//ScheduleGroupForFullUpdate().
|
|
||||||
sceneObject.ScheduleGroupForFullUpdate(null);
|
sceneObject.ScheduleGroupForFullUpdate(null);
|
||||||
//end of DSG SYNC,
|
|
||||||
|
|
||||||
Entities.Add(sceneObject);
|
Entities.Add(sceneObject);
|
||||||
|
|
||||||
|
|
|
@ -5641,7 +5641,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do any subscriptions based on the AggregateScriptEvents
|
// Do any subscriptions based on the AggregateScriptEvents
|
||||||
protected void aggregateScriptEventSubscriptions()
|
public void aggregateScriptEventSubscriptions()
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
((AggregateScriptEvents & scriptEvents.collision) != 0) ||
|
((AggregateScriptEvents & scriptEvents.collision) != 0) ||
|
||||||
|
|
|
@ -346,6 +346,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation);
|
m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation);
|
||||||
m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem);
|
m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem);
|
||||||
|
|
||||||
|
/*
|
||||||
//DSG SYNC
|
//DSG SYNC
|
||||||
m_SOPXmlProcessors.Add("LocalFlags", ProcessLocalFlags);
|
m_SOPXmlProcessors.Add("LocalFlags", ProcessLocalFlags);
|
||||||
//m_SOPXmlProcessors.Add("LastUpdateTimeStamp", ProcessUpdateTimeStamp);
|
//m_SOPXmlProcessors.Add("LastUpdateTimeStamp", ProcessUpdateTimeStamp);
|
||||||
|
@ -358,6 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
|
|
||||||
m_SOPXmlProcessors.Add("BucketSyncInfoList", ProcessBucketSyncInfo);
|
m_SOPXmlProcessors.Add("BucketSyncInfoList", ProcessBucketSyncInfo);
|
||||||
//end of DSG SYNC
|
//end of DSG SYNC
|
||||||
|
* */
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -1302,12 +1304,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
//DSG SYNC
|
//DSG SYNC
|
||||||
//These properties are only meaningful for synchronization purpose. For saving oar files, they are not necessary.
|
//These properties are only meaningful for synchronization purpose. For saving oar files, they are not necessary.
|
||||||
//We may remove these if later we use a different method to encode object properties for synchronization.
|
//We may remove these if later we use a different method to encode object properties for synchronization.
|
||||||
|
/*
|
||||||
WriteUUID(writer, "AttachedAvatar", sop.AttachedAvatar, options);
|
WriteUUID(writer, "AttachedAvatar", sop.AttachedAvatar, options);
|
||||||
WriteVector(writer, "AttachedPos", sop.AttachedPos);
|
WriteVector(writer, "AttachedPos", sop.AttachedPos);
|
||||||
writer.WriteElementString("AttachmentPoint", sop.AttachmentPoint.ToString());
|
writer.WriteElementString("AttachmentPoint", sop.AttachmentPoint.ToString());
|
||||||
//writer.WriteElementString("IsAttachment", sop.IsAttachment.ToString().ToLower()); //IsAttachment is written last, so that on deserialization, it will be deserialized later than other Attachment properties
|
//writer.WriteElementString("IsAttachment", sop.IsAttachment.ToString().ToLower()); //IsAttachment is written last, so that on deserialization, it will be deserialized later than other Attachment properties
|
||||||
WriteFlags(writer, "AggregateScriptEvents", sop.AggregateScriptEvents.ToString(), options);
|
WriteFlags(writer, "AggregateScriptEvents", sop.AggregateScriptEvents.ToString(), options);
|
||||||
WriteBucketSyncInfo(writer, sop.BucketSyncInfoList);
|
WriteBucketSyncInfo(writer, sop.BucketSyncInfoList);
|
||||||
|
* */
|
||||||
//end of DSG SYNC
|
//end of DSG SYNC
|
||||||
|
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
|
|
Loading…
Reference in New Issue