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
Huaiyu (Kitty) Liu 2011-05-04 14:36:18 -07:00
parent cd70c3ff56
commit 854cb58d6d
4 changed files with 74 additions and 33 deletions

View File

@ -1977,9 +1977,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
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,
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)
{
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
/*
@ -2023,6 +2037,17 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
SceneObjectPart part = new SceneObjectPart();
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;
@ -2068,8 +2093,12 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
}
}
}
}
//end of debug functions
//Start connections to each remote listener.
//For now, there is only one remote listener.
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
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;
}
//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
HashSet<SceneObjectPartSyncProperties> propertiesWithSyncInfoUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoByLocal(sop, new List<SceneObjectPartSyncProperties>(updatedProperties));
updatedProperties.UnionWith(propertiesWithSyncInfoUpdated);
SendPrimPropertyUpdates(sop, updatedProperties);
}
}
@ -6658,7 +6688,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
///////////////////////
case SceneObjectPartSyncProperties.AggregateScriptEvents:
part.AggregateScriptEvents = (scriptEvents)pSyncInfo.LastUpdateValue;
part.aggregateScriptEventSubscriptions();
//DebugLog.DebugFormat("set {0} value to be {1}", property.ToString(), part.AggregateScriptEvents);
break;
@ -6669,13 +6699,21 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
part.AngularVelocity = (Vector3)pSyncInfo.LastUpdateValue;
break;
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;
case SceneObjectPartSyncProperties.AttachedPos:
part.AttachedPos = (Vector3)pSyncInfo.LastUpdateValue;
break;
case SceneObjectPartSyncProperties.AttachmentPoint:
part.AttachmentPoint = (uint)pSyncInfo.LastUpdateValue;
//part.AttachmentPoint = (uint)pSyncInfo.LastUpdateValue;
part.SetAttachmentPoint((uint)pSyncInfo.LastUpdateValue);
break;
case SceneObjectPartSyncProperties.BaseMask:
part.BaseMask = (uint)pSyncInfo.LastUpdateValue;

View File

@ -2167,7 +2167,9 @@ namespace OpenSim.Region.Framework.Scenes
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);
if (sceneObject.IsAttachment)
{
@ -2175,13 +2177,10 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.RootPart.SetParentLocalId(avatar.LocalId);
}
//DSG SYNC,
sceneObject.HasGroupChanged = true;
//NewObject is sent via a specific sync message, not through updates;
//hence not passing any property list here in calling
//ScheduleGroupForFullUpdate().
//hence not passing any property list here
sceneObject.ScheduleGroupForFullUpdate(null);
//end of DSG SYNC,
Entities.Add(sceneObject);

View File

@ -5641,7 +5641,7 @@ namespace OpenSim.Region.Framework.Scenes
}
// Do any subscriptions based on the AggregateScriptEvents
protected void aggregateScriptEventSubscriptions()
public void aggregateScriptEventSubscriptions()
{
if (
((AggregateScriptEvents & scriptEvents.collision) != 0) ||

View File

@ -346,6 +346,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation);
m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem);
/*
//DSG SYNC
m_SOPXmlProcessors.Add("LocalFlags", ProcessLocalFlags);
//m_SOPXmlProcessors.Add("LastUpdateTimeStamp", ProcessUpdateTimeStamp);
@ -358,6 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("BucketSyncInfoList", ProcessBucketSyncInfo);
//end of DSG SYNC
* */
#endregion
@ -1302,12 +1304,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
//DSG SYNC
//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.
/*
WriteUUID(writer, "AttachedAvatar", sop.AttachedAvatar, options);
WriteVector(writer, "AttachedPos", sop.AttachedPos);
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
WriteFlags(writer, "AggregateScriptEvents", sop.AggregateScriptEvents.ToString(), options);
WriteBucketSyncInfo(writer, sop.BucketSyncInfoList);
* */
//end of DSG SYNC
writer.WriteEndElement();