In InventoryAccessModule.RezObject, move the calling of AddNewSceneObject to the later part of

the function, so that the object's most properties have values already set when AddNewSceneObject
is called, which will trigger RegionSyncModule.SendNewObject to sync across scene copies.
dsg
Huaiyu (Kitty) Liu 2011-03-23 10:23:13 -07:00
parent 71566e31c2
commit 0ad9366abb
7 changed files with 37 additions and 52 deletions

View File

@ -581,25 +581,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
group.ResetIDs();
if (attachment)
{
group.RootPart.Flags |= PrimFlags.Phantom;
group.RootPart.IsAttachment = true;
// If we're rezzing an attachment then don't ask
// AddNewSceneObject() to update the client since
// we'll be doing that later on. Scheduling more
// than one full update during the attachment
// process causes some clients to fail to display
// the attachment properly.
// Also, don't persist attachments.
m_Scene.AddNewSceneObject(group, false, false);
}
else
{
m_Scene.AddNewSceneObject(group, true, false);
}
// m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z);
// if attachment we set it's asset id so object updates can reflect that
// if not, we set it's position in world.
@ -693,6 +674,28 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
rootPart.TrimPermissions();
//SYMMETRIC SYNC: move this part to the bottom of this function,
//so that all properties of the object would have been set once
//AddNewSceneObject is called.
if (attachment)
{
group.RootPart.Flags |= PrimFlags.Phantom;
group.RootPart.IsAttachment = true;
// If we're rezzing an attachment then don't ask
// AddNewSceneObject() to update the client since
// we'll be doing that later on. Scheduling more
// than one full update during the attachment
// process causes some clients to fail to display
// the attachment properly.
// Also, don't persist attachments.
m_Scene.AddNewSceneObject(group, false, false);
}
else
{
m_Scene.AddNewSceneObject(group, true, false);
}
if (!attachment)
{
if (group.RootPart.Shape.PCode == (byte)PCode.Prim)

View File

@ -420,25 +420,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
return;
}
/*
//m_log.DebugFormat(LogHeader + " SendNewObject called for object {0}, {1}", sog.Name, sog.UUID);
//This is a new object (newly rezzed). Send out updates for all properties.
//For now, a complete list of object properties include properties
//in its xml serialization, plus the set of Physics properties as in Physics bucket
OSDMap data = new OSDMap();
string sogxml = SceneObjectSerializer.ToXml2Format(sog);
data["sogxml"] = OSD.FromString(sogxml);
OSDArray partArray = new OSDArray();
foreach (SceneObjectPart part in sog.Parts){
OSDMap partData = PhysicsBucketPropertiesEncoder(m_physicsBucketName, part);
partArray.Add(partData);
}
data["partPhysicsProperties"] = partArray;
//string sogxml = SceneObjectSerializer.ToXml2Format(sog);
SymmetricSyncMessage rsm = new SymmetricSyncMessage(SymmetricSyncMessage.MsgType.NewObject, OSDParser.SerializeJsonString(data));
* */
//First, make sure the linked group has updated timestamp info for synchronization
sog.BucketSyncInfoUpdate();
SymmetricSyncMessage rsm = CreateNewObjectMessage(sog);

View File

@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
if (entity is SceneObjectGroup)
{
m_log.Debug(LogHeader + ": start script for obj " + entity.UUID);
//m_log.DebugFormat("{0}: start script for obj {1}", LogHeader, entity.UUID);
SceneObjectGroup sog = (SceneObjectGroup)entity;
sog.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, 0);
sog.ResumeScripts();

View File

@ -2198,11 +2198,13 @@ namespace OpenSim.Region.Framework.Scenes
AddNewSceneObject(group, true, pos, rot, vel);
//SYNC DEBUG
/*
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.

View File

@ -313,8 +313,6 @@ namespace OpenSim.Region.Framework.Scenes
public bool AddNewSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
{
AddNewSceneObject(sceneObject, true, false);
// we set it's position in world.
sceneObject.AbsolutePosition = pos;
@ -332,6 +330,11 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.Velocity = vel;
}
//SYMMETRIC SYNC
//Moving AddNewSceneObject to the end of this function, so that
//all object properties are set when AddNewSceneObject is called.
AddNewSceneObject(sceneObject, true, false);
return true;
}

View File

@ -294,12 +294,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_rootPart.GroupPosition; }
set
{
/*
SetAbsolutePosition(value);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
parts[i].UpdateBucketSyncInfo("GroupPosition");
*/
Vector3 val = value;
//REGION SYNC touched
@ -307,7 +301,7 @@ namespace OpenSim.Region.Framework.Scenes
//if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
// || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
// && !IsAttachmentCheckFull())
if (m_scene.IsBorderCrossing(LocX, LocY, val) && !IsAttachmentCheckFull()&& (!m_scene.LoadingPrims))
if (m_scene !=null && m_scene.IsBorderCrossing(LocX, LocY, val) && !IsAttachmentCheckFull()&& (!m_scene.LoadingPrims))
{
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
@ -3897,8 +3891,8 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleGroupForFullUpdate_SyncInfoUnchanged()
{
if (IsAttachment)
m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
//if (IsAttachment)
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
checkAtTargets();
RootPart.ScheduleFullUpdate_SyncInfoUnchanged();