From 8305e6af076cd2fdf7c016926a5ea48718dcf955 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 3 Mar 2010 23:29:09 +0000
Subject: refactor: push sog.SendPartFullUpdate() down into sop where it better
belongs no functional changes
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 37 ++--------------
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 51 +++++++++++++++++-----
2 files changed, 43 insertions(+), 45 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c14b39a..19144a7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1490,51 +1490,22 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
- #region Client Updating
-
public void SendFullUpdateToClient(IClientAPI remoteClient)
{
- SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
+ RootPart.SendFullUpdate(
+ remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
{
if (part != RootPart)
- SendPartFullUpdate(remoteClient, part, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
+ part.SendFullUpdate(
+ remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
}
}
}
- ///
- /// Send a full update to the client for the given part
- ///
- ///
- ///
- internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags)
- {
-// m_log.DebugFormat(
-// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
-
- if (m_rootPart.UUID == part.UUID)
- {
- if (IsAttachment)
- {
- part.SendFullUpdateToClient(remoteClient, m_rootPart.AttachedPos, clientFlags);
- }
- else
- {
- part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
- }
- }
- else
- {
- part.SendFullUpdateToClient(remoteClient, clientFlags);
- }
- }
-
- #endregion
-
#region Copying
///
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 5c283bc..b8c8d88 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2834,29 +2834,59 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+// ///
+// ///
+// ///
+// ///
+// public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
+// {
+// m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags);
+// }
+
+
///
- ///
+ /// Send a full update to the client for the given part
///
///
- public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
+ ///
+ protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
{
- m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags);
- }
+// m_log.DebugFormat(
+// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
+
+ if (IsRoot)
+ {
+ if (IsAttachment)
+ {
+ SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags);
+ }
+ else
+ {
+ SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
+ }
+ }
+ else
+ {
+ SendFullUpdateToClient(remoteClient, clientFlags);
+ }
+ }
///
- ///
+ /// Send a full update for this part to all clients.
///
public void SendFullUpdateToAllClients()
{
ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avatars.Length; i++)
{
- // Ugly reference :(
- m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this,
- avatars[i].GenerateClientFlags(UUID));
+ SendFullUpdate(avatars[i].ControllingClient, avatars[i].GenerateClientFlags(UUID));
}
}
+ ///
+ /// Send a full update to all clients except the one nominated.
+ ///
+ ///
public void SendFullUpdateToAllClientsExcept(UUID agentID)
{
ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences();
@@ -2864,10 +2894,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// Ugly reference :(
if (avatars[i].UUID != agentID)
- {
- m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this,
- avatars[i].GenerateClientFlags(UUID));
- }
+ SendFullUpdate(avatars[i].ControllingClient, avatars[i].GenerateClientFlags(UUID));
}
}
--
cgit v1.1