In RegionSyncModule.PrimUpdatesPhysicsBucketSender, if no PhysicsActor for the SOP, still sending out

"GroupPosition" and a few other properties in physics bucket. Sync'ing of phantom objects now seems working fine.
dsg
Huaiyu (Kitty) Liu 2011-03-11 11:50:46 -08:00
parent 13798f9f7d
commit 1ab4df9954
4 changed files with 38 additions and 31 deletions

View File

@ -202,6 +202,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
lock (m_primUpdateLocks[bucketName])
{
m_log.Debug("Queueing to bucket " + bucketName + " with part " + part.Name + ", " + part.UUID);
m_primUpdates[bucketName][part.UUID] = part;
}
}
@ -245,6 +246,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
if (m_primUpdates[bucketName].Count > 0)
{
m_log.Debug(m_primUpdates[bucketName].Count + " updated parts in bucket " + bucketName);
lock (m_primUpdateLocks[bucketName])
{
updated = true;
@ -299,6 +301,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
}
}
* */
m_log.Debug(LogHeader + " calling update sender for bucket " + bucketName);
m_primUpdatesPerBucketSender[bucketName](bucketName, primUpdates[bucketName]);
}
}
@ -734,14 +737,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
updatedPart.UpdateTaintedBucketSyncInfo(bucketName, DateTime.Now.Ticks);
Physics.Manager.PhysicsActor pa = updatedPart.PhysActor;
if (pa == null)
return;
OSDMap data = new OSDMap();
// data["UUID"] = OSD.FromUUID(updatedPart.UUID);
data["UUID"] = OSD.FromUUID(pa.UUID);
data["UUID"] = OSD.FromUUID(updatedPart.UUID);
//data["UUID"] = OSD.FromUUID(pa.UUID);
data["Bucket"] = OSD.FromString(bucketName);
data["GroupPosition"] = OSD.FromVector3(updatedPart.GroupPosition);
@ -749,25 +748,31 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
data["Scale"] = OSD.FromVector3(updatedPart.Scale);
data["AngularVelocity"] = OSD.FromVector3(updatedPart.AngularVelocity);
data["RotationOffset"] = OSD.FromQuaternion(updatedPart.RotationOffset);
data["Size"] = OSD.FromVector3(pa.Size);
data["Position"] = OSD.FromVector3(pa.Position);
data["Force"] = OSD.FromVector3(pa.Force);
data["Velocity"] = OSD.FromVector3(pa.Velocity);
data["RotationalVelocity"] = OSD.FromVector3(pa.RotationalVelocity);
data["PA_Acceleration"] = OSD.FromVector3(pa.Acceleration);
data["Torque"] = OSD.FromVector3(pa.Torque);
data["Orientation"] = OSD.FromQuaternion(pa.Orientation);
data["IsPhysical"] = OSD.FromBoolean(pa.IsPhysical);
data["Flying"] = OSD.FromBoolean(pa.Flying);
data["Kinematic"] = OSD.FromBoolean(pa.Kinematic);
data["Buoyancy"] = OSD.FromReal(pa.Buoyancy);
data["CollidingGround"] = OSD.FromBoolean(pa.CollidingGround);
data["IsColliding"] = OSD.FromBoolean(pa.IsColliding);
Physics.Manager.PhysicsActor pa = updatedPart.PhysActor;
if (pa != null)
{
data["Size"] = OSD.FromVector3(pa.Size);
data["Position"] = OSD.FromVector3(pa.Position);
data["Force"] = OSD.FromVector3(pa.Force);
data["Velocity"] = OSD.FromVector3(pa.Velocity);
data["RotationalVelocity"] = OSD.FromVector3(pa.RotationalVelocity);
data["PA_Acceleration"] = OSD.FromVector3(pa.Acceleration);
data["Torque"] = OSD.FromVector3(pa.Torque);
data["Orientation"] = OSD.FromQuaternion(pa.Orientation);
data["IsPhysical"] = OSD.FromBoolean(pa.IsPhysical);
data["Flying"] = OSD.FromBoolean(pa.Flying);
data["Kinematic"] = OSD.FromBoolean(pa.Kinematic);
data["Buoyancy"] = OSD.FromReal(pa.Buoyancy);
data["CollidingGround"] = OSD.FromBoolean(pa.CollidingGround);
data["IsColliding"] = OSD.FromBoolean(pa.IsColliding);
}
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);
m_log.Debug(LogHeader + " Send out Physics Bucket updates for " + updatedPart.Name + ". GroupPosition: " + updatedPart.GroupPosition.ToString());
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());

View File

@ -468,7 +468,7 @@ namespace OpenSim.Region.Framework.Scenes
lock (m_updateList)
{
m_updateList[obj.UUID] = obj;
//m_log.Debug("added " + obj.UUID + " to m_updateList");
m_log.Debug("added " + obj.Name+","+ obj.UUID + " to m_updateList");
}
}
@ -489,12 +489,12 @@ namespace OpenSim.Region.Framework.Scenes
{
updates = new List<SceneObjectGroup>(m_updateList.Values);
/*
if (updates.Count > 0)
{
m_log.Debug("SceneGraph: " + updates.Count + " objects to send updates for");
m_log.Debug("SceneGraph.UpdateObjectGroups: " + updates.Count + " objects to send updates for");
}
* */
m_updateList.Clear();
@ -508,6 +508,7 @@ namespace OpenSim.Region.Framework.Scenes
// Don't abort the whole update if one entity happens to give us an exception.
try
{
m_log.Debug("SceneGraph: calling update for obj " + sog.Name + "," + sog.UUID);
sog.Update();
}
catch (Exception e)

View File

@ -1950,7 +1950,7 @@ namespace OpenSim.Region.Framework.Scenes
//public void ScheduleGroupForTerseUpdate()
public void ScheduleGroupForTerseUpdate(List<SceneObjectPartProperties> updatedProperties)
{
// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)

View File

@ -2980,9 +2980,9 @@ namespace OpenSim.Region.Framework.Scenes
TimeStampTerse = (uint) Util.UnixTimeSinceEpoch();
m_updateFlag = 1;
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
// UUID, Name, TimeStampTerse);
m_log.DebugFormat(
"[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
UUID, Name, TimeStampTerse);
}
}
@ -3204,6 +3204,7 @@ namespace OpenSim.Region.Framework.Scenes
//SYMMETRIC SYNC
if (m_parentGroup.Scene.RegionSyncModule != null)
{
m_log.Debug("SOP.SendScheduledUpdates: Calling RegionSyncModule.QueueSceneObjectPartForUpdate");
m_parentGroup.Scene.RegionSyncModule.QueueSceneObjectPartForUpdate((SceneObjectPart)this);
}
//end of SYMMETRIC SYNC
@ -5854,8 +5855,8 @@ namespace OpenSim.Region.Framework.Scenes
{
if (updatedProperties != null && updatedProperties.Count > 0)
{
//m_log.DebugFormat("{0}: Tainting bucket for properties {1}",
// "[SCENE OBJECT PART]", updatedProperties.ToString());
m_log.DebugFormat("{0}: Tainting bucket for properties {1}",
"[SCENE OBJECT PART]", updatedProperties.ToString());
foreach (SceneObjectPartProperties property in updatedProperties)
{
TaintBucketSyncInfo(property);