From 9359293b11dfd0db82ba3ce8110b0014afbde88f Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Thu, 10 Nov 2011 15:20:21 -0800
Subject: Cleaned UpdatePermissions calls on SOP and SOG to eliminate redundant
properties packet sends and so one part is not telling a different part what
to do. That should be up to the SOG to manage permissions on its parts and
notify clients when one of them changes.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 7 +++++-
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 27 ++++++++--------------
2 files changed, 15 insertions(+), 19 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3fa6bb0..4355394 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1873,7 +1873,7 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Send metadata about the root prim (name, description, sale price, etc.) to a client.
+ /// Send metadata about the root prim (name, description, sale price, permissions, etc.) to a client.
///
///
public void SendPropertiesToClient(IClientAPI client)
@@ -2481,6 +2481,11 @@ namespace OpenSim.Region.Framework.Scenes
parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF);
HasGroupChanged = true;
+
+ // Send the group's properties to all clients once all parts are updated
+ IClientAPI client;
+ if (Scene.TryGetClient(AgentID, out client))
+ SendPropertiesToClient(client);
}
#endregion
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4071159..ad60604 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1338,22 +1338,6 @@ namespace OpenSim.Region.Framework.Scenes
client.SendObjectPropertiesReply(this);
}
- ///
- /// For the scene object group to which this part belongs, send that scene object's root part properties to a client.
- ///
- ///
- private void SendRootPartPropertiesToClient(UUID AgentID)
- {
- m_parentGroup.Scene.ForEachClient(delegate(IClientAPI client)
- {
- // Ugly reference :(
- if (client.AgentId == AgentID)
- {
- m_parentGroup.SendPropertiesToClient(client);
- }
- });
- }
-
// TODO: unused:
// private void handleTimerAccounting(uint localID, double interval)
// {
@@ -4214,6 +4198,15 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ ///
+ /// Update permissions on the SOP. Should only be called from SOG.UpdatePermissions because the SOG
+ /// will handle the client notifications once all of its parts are updated.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF)
{
bool set = addRemTF == 1;
@@ -4262,8 +4255,6 @@ namespace OpenSim.Region.Framework.Scenes
}
SendFullUpdateToAllClients();
-
- SendRootPartPropertiesToClient(AgentID);
}
}
--
cgit v1.1