* Remove responsibilty for signalling scene object change from SceneObjectPart.SendFullUpdate()

* This means that we will no longer pointlessly repersist all the prims in the scene when OpenSim first starts up
* This also means that force-update on the console will not trigger repersistence.
* Also, in other places persistence is no longer done where it wasn't actually necessary
* I think I changed the code for all instances correctly, but it's not possible that I missed some and some things which did persist properly have stopped
* Please patch or mantis if this is the case
0.6.0-stable
Justin Clarke Casey 2008-06-27 16:36:19 +00:00
parent cea6e03ae0
commit 9bf67201c3
6 changed files with 97 additions and 13 deletions

View File

@ -1522,6 +1522,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
copy.StartScripts(); copy.StartScripts();
copy.HasGroupChanged = true;
copy.ScheduleGroupForFullUpdate(); copy.ScheduleGroupForFullUpdate();
return copy; return copy;
} }

View File

@ -477,6 +477,7 @@ namespace OpenSim.Region.Environment.Scenes
newPart.LinkNum = m_parts.Count; newPart.LinkNum = m_parts.Count;
m_parts.Add(newPart.UUID, newPart); m_parts.Add(newPart.UUID, newPart);
SetPartAsRoot(newPart); SetPartAsRoot(newPart);
// one of these is a proxy. // one of these is a proxy.
if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem)
AttachToBackup(); AttachToBackup();
@ -686,7 +687,12 @@ namespace OpenSim.Region.Environment.Scenes
m_rootPart = part; m_rootPart = part;
} }
/// <summary>
/// Attach this scene object to the given avatar.
/// </summary>
/// <param name="agentID"></param>
/// <param name="attachmentpoint"></param>
/// <param name="AttachOffset"></param>
public void AttachToAgent(LLUUID agentID, uint attachmentpoint, LLVector3 AttachOffset) public void AttachToAgent(LLUUID agentID, uint attachmentpoint, LLVector3 AttachOffset)
{ {
ScenePresence avatar = m_scene.GetScenePresence(agentID); ScenePresence avatar = m_scene.GetScenePresence(agentID);
@ -752,6 +758,7 @@ namespace OpenSim.Region.Environment.Scenes
m_rootPart.SetAttachmentPoint((byte)0); m_rootPart.SetAttachmentPoint((byte)0);
m_rootPart.m_IsAttachment = false; m_rootPart.m_IsAttachment = false;
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
HasGroupChanged = true;
AttachToBackup(); AttachToBackup();
m_rootPart.ScheduleFullUpdate(); m_rootPart.ScheduleFullUpdate();
m_rootPart.ClearUndoState(); m_rootPart.ClearUndoState();
@ -1026,6 +1033,7 @@ namespace OpenSim.Region.Environment.Scenes
lock (m_targets) lock (m_targets)
m_targets.Clear(); m_targets.Clear();
} }
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
} }
@ -1037,6 +1045,7 @@ namespace OpenSim.Region.Environment.Scenes
(int) (color.z * 0xff)); (int) (color.z * 0xff));
Text = text; Text = text;
HasGroupChanged = true;
m_rootPart.ScheduleFullUpdate(); m_rootPart.ScheduleFullUpdate();
} }
@ -1229,6 +1238,7 @@ namespace OpenSim.Region.Environment.Scenes
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
} }
// Now we've made a copy that replaces this one, we need to // Now we've made a copy that replaces this one, we need to
// switch the owner to the person who did the copying // switch the owner to the person who did the copying
// Second Life copies an object and duplicates the first one in it's place // Second Life copies an object and duplicates the first one in it's place
@ -1257,8 +1267,9 @@ namespace OpenSim.Region.Environment.Scenes
if (userExposed) if (userExposed)
{ {
dupe.UpdateParentIDs(); dupe.UpdateParentIDs();
dupe.HasGroupChanged = true;
dupe.AttachToBackup(); dupe.AttachToBackup();
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
} }
@ -1386,7 +1397,6 @@ namespace OpenSim.Region.Environment.Scenes
part.OwnerID = cAgentID; part.OwnerID = cAgentID;
part.GroupID = cGroupID; part.GroupID = cGroupID;
if (part.OwnerID != cAgentID) if (part.OwnerID != cAgentID)
{ {
// Apply Next Owner Permissions if we're not bypassing permissions // Apply Next Owner Permissions if we're not bypassing permissions
@ -1535,7 +1545,6 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void ScheduleGroupForFullUpdate() public void ScheduleGroupForFullUpdate()
{ {
HasGroupChanged = true;
checkAtTargets(); checkAtTargets();
lock (m_parts) lock (m_parts)
{ {
@ -1774,6 +1783,7 @@ namespace OpenSim.Region.Environment.Scenes
// The traffic caused is always going to be pretty minor, so it's not high priority // The traffic caused is always going to be pretty minor, so it's not high priority
//objectGroup.DeleteGroup(); //objectGroup.DeleteGroup();
HasGroupChanged = true;
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
} }
@ -1834,6 +1844,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.AddNewSceneObject(objectGroup, true); m_scene.AddNewSceneObject(objectGroup, true);
HasGroupChanged = true;
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
} }
else else
@ -2112,6 +2123,8 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
} }
//if (part.UUID != m_rootPart.UUID) //if (part.UUID != m_rootPart.UUID)
HasGroupChanged = true;
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
//if (part.UUID == m_rootPart.UUID) //if (part.UUID == m_rootPart.UUID)
@ -2552,6 +2565,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
part.SetGroup(GroupID, client); part.SetGroup(GroupID, client);
} }
HasGroupChanged = true;
} }
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();

View File

@ -454,11 +454,12 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
if (scriptcount <= 0) if (scriptcount <= 0)
{ {
RemFlag(LLObject.ObjectFlags.Scripted); RemFlag(LLObject.ObjectFlags.Scripted);
ScheduleFullUpdate();
} }
ScheduleFullUpdate(); ScheduleFullUpdate();
return type; return type;

View File

@ -1660,7 +1660,6 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (m_parentGroup != null) if (m_parentGroup != null)
{ {
m_parentGroup.HasGroupChanged = true;
m_parentGroup.QueueForUpdateCheck(); m_parentGroup.QueueForUpdateCheck();
} }
@ -1766,7 +1765,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Shape #region Shape
/// <summary> /// <summary>
/// /// Update the shape of this part.
/// </summary> /// </summary>
/// <param name="shapeBlock"></param> /// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
@ -1793,6 +1792,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
PhysActor.Shape = m_shape; PhysActor.Shape = m_shape;
} }
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate(); ScheduleFullUpdate();
} }
@ -2012,6 +2013,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate(); ScheduleFullUpdate();
} }
@ -2066,13 +2068,15 @@ namespace OpenSim.Region.Environment.Scenes
#region Texture #region Texture
/// <summary> /// <summary>
/// /// Update the texture entry for this part.
/// </summary> /// </summary>
/// <param name="textureEntry"></param> /// <param name="textureEntry"></param>
public void UpdateTextureEntry(byte[] textureEntry) public void UpdateTextureEntry(byte[] textureEntry)
{ {
m_shape.TextureEntry = textureEntry; m_shape.TextureEntry = textureEntry;
TriggerScriptChangedEvent(Changed.TEXTURE); TriggerScriptChangedEvent(Changed.TEXTURE);
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate(); ScheduleFullUpdate();
} }
@ -2301,7 +2305,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Resizing/Scale #region Resizing/Scale
/// <summary> /// <summary>
/// /// Resize this part.
/// </summary> /// </summary>
/// <param name="scale"></param> /// <param name="scale"></param>
public void Resize(LLVector3 scale) public void Resize(LLVector3 scale)
@ -2309,6 +2313,7 @@ namespace OpenSim.Region.Environment.Scenes
StoreUndoState(); StoreUndoState();
m_shape.Scale = scale; m_shape.Scale = scale;
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate(); ScheduleFullUpdate();
} }
@ -2576,12 +2581,24 @@ namespace OpenSim.Region.Environment.Scenes
{ {
} }
/// <summary>
/// Set the text displayed for this part.
/// </summary>
/// <param name="text"></param>
public void SetText(string text) public void SetText(string text)
{ {
Text = text; Text = text;
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate(); ScheduleFullUpdate();
} }
/// <summary>
/// Set the text displayed for this part.
/// </summary>
/// <param name="text"></param>
/// <param name="color"></param>
/// <param name="alpha"></param>
public void SetText(string text, Vector3 color, double alpha) public void SetText(string text, Vector3 color, double alpha)
{ {
Color = Color.FromArgb(0xff - (int) (alpha*0xff), Color = Color.FromArgb(0xff - (int) (alpha*0xff),

View File

@ -1058,6 +1058,19 @@ namespace OpenSim.Region.ScriptEngine.Common
} }
} }
/// <summary>
/// Set flexi parameters of a part.
///
/// FIXME: Much of this code should probably be within the part itself.
/// </summary>
/// <param name="part"></param>
/// <param name="flexi"></param>
/// <param name="softness"></param>
/// <param name="gravity"></param>
/// <param name="friction"></param>
/// <param name="wind"></param>
/// <param name="tension"></param>
/// <param name="Force"></param>
private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
float wind, float tension, LSL_Types.Vector3 Force) float wind, float tension, LSL_Types.Vector3 Force)
{ {
@ -1102,9 +1115,21 @@ namespace OpenSim.Region.ScriptEngine.Common
} }
} }
part.ParentGroup.HasGroupChanged = true;
part.ScheduleFullUpdate(); part.ScheduleFullUpdate();
} }
/// <summary>
/// Set a light point on a part
///
/// FIXME: Much of this code should probably be in SceneObjectGroup
/// </summary>
/// <param name="part"></param>
/// <param name="light"></param>
/// <param name="color"></param>
/// <param name="intensity"></param>
/// <param name="radius"></param>
/// <param name="falloff"></param>
private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff)
{ {
if (part == null) if (part == null)
@ -1125,6 +1150,7 @@ namespace OpenSim.Region.ScriptEngine.Common
part.Shape.LightEntry = false; part.Shape.LightEntry = false;
} }
part.ParentGroup.HasGroupChanged = true;
part.ScheduleFullUpdate(); part.ScheduleFullUpdate();
} }

View File

@ -911,6 +911,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
/// <summary>
/// Set flexi parameters of a part.
///
/// FIXME: Much of this code should probably be within the part itself.
/// </summary>
/// <param name="part"></param>
/// <param name="flexi"></param>
/// <param name="softness"></param>
/// <param name="gravity"></param>
/// <param name="friction"></param>
/// <param name="wind"></param>
/// <param name="tension"></param>
/// <param name="Force"></param>
private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
float wind, float tension, LSL_Types.Vector3 Force) float wind, float tension, LSL_Types.Vector3 Force)
{ {
@ -955,9 +968,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
part.ParentGroup.HasGroupChanged = true;
part.ScheduleFullUpdate(); part.ScheduleFullUpdate();
} }
/// <summary>
/// Set a light point on a part
///
/// FIXME: Much of this code should probably be in SceneObjectGroup
/// </summary>
/// <param name="part"></param>
/// <param name="light"></param>
/// <param name="color"></param>
/// <param name="intensity"></param>
/// <param name="radius"></param>
/// <param name="falloff"></param>
private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff)
{ {
if (part == null) if (part == null)
@ -978,11 +1003,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.Shape.LightEntry = false; part.Shape.LightEntry = false;
} }
part.ParentGroup.HasGroupChanged = true;
part.ScheduleFullUpdate(); part.ScheduleFullUpdate();
} }
public LSL_Types.Vector3 llGetColor(int face) public LSL_Types.Vector3 llGetColor(int face)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);