* Only call the expensive client flag generation method for ObjectUpdate packets when we have to

slimupdates
John Hurliman 2010-05-05 11:39:08 -07:00
parent 98a9ae40c5
commit ce106a0c0b
5 changed files with 11 additions and 30 deletions

View File

@ -4505,7 +4505,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region PrimFlags #region PrimFlags
PrimFlags flags = data.Flags; PrimFlags flags = (PrimFlags)m_scene.Permissions.GenerateClientFlags(recipientID, data.UUID);
// Don't send the CreateSelected flag to everyone // Don't send the CreateSelected flag to everyone
flags &= ~PrimFlags.CreateSelected; flags &= ~PrimFlags.CreateSelected;
@ -4520,7 +4520,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
update.UpdateFlags = (uint)data.Flags; update.UpdateFlags = (uint)flags;
#endregion PrimFlags #endregion PrimFlags

View File

@ -1490,15 +1490,14 @@ namespace OpenSim.Region.Framework.Scenes
public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags updateFlags) public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags updateFlags)
{ {
RootPart.SendUpdateToClient( RootPart.SendUpdateToClient(remoteClient, updateFlags);
remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID), updateFlags);
lock (m_parts) lock (m_parts)
{ {
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)
{ {
if (part != RootPart) if (part != RootPart)
part.SendUpdateToClient(remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID), updateFlags); part.SendUpdateToClient(remoteClient, updateFlags);
} }
} }
} }

View File

@ -2839,15 +2839,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
// /// <summary>
// ///
// /// </summary>
// /// <param name="remoteClient"></param>
// public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
// {
// m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags);
// }
/// <summary> /// <summary>
/// Send a full update for this part to all clients. /// Send a full update for this part to all clients.
/// </summary> /// </summary>
@ -2855,7 +2846,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{ {
SendUpdateToClient(avatar.ControllingClient, avatar.GenerateClientFlags(UUID), updateFlags); SendUpdateToClient(avatar.ControllingClient, updateFlags);
}); });
} }
@ -2869,17 +2860,14 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// Ugly reference :( // Ugly reference :(
if (avatar.UUID != agentID) if (avatar.UUID != agentID)
SendUpdateToClient(avatar.ControllingClient, avatar.GenerateClientFlags(UUID), updateFlags); SendUpdateToClient(avatar.ControllingClient, updateFlags);
}); });
} }
/// <summary> /// <summary>
/// Sends a full update to the client /// Sends an update for this object to a client
/// </summary> /// </summary>
/// <param name="remoteClient"></param> public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags updateFlags)
/// <param name="lPos"></param>
/// <param name="clientFlags"></param>
public void SendUpdateToClient(IClientAPI remoteClient, uint clientFlags, PrimUpdateFlags updateFlags)
{ {
// Sanity check // Sanity check
if (ParentGroup == null || ParentGroup.IsDeleted) if (ParentGroup == null || ParentGroup.IsDeleted)

View File

@ -789,11 +789,6 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneViewer.QueuePartForUpdate(part); m_sceneViewer.QueuePartForUpdate(part);
} }
public uint GenerateClientFlags(UUID ObjectID)
{
return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
}
/// <summary> /// <summary>
/// Send updates to the client about prims which have been placed on the update queue. We don't /// Send updates to the client about prims which have been placed on the update queue. We don't
/// necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent /// necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent

View File

@ -118,8 +118,7 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}", // "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
// part.Name, part.UUID, part.TimeStampFull); // part.Name, part.UUID, part.TimeStampFull);
part.SendUpdateToClient(m_presence.ControllingClient, part.SendUpdateToClient(m_presence.ControllingClient, PrimUpdateFlags.FullUpdate);
m_presence.GenerateClientFlags(part.UUID), PrimUpdateFlags.FullUpdate);
// We'll update to the part's timestamp rather than // We'll update to the part's timestamp rather than
// the current time to avoid the race condition // the current time to avoid the race condition
@ -137,7 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}", // "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}",
// part.Name, part.UUID, part.TimeStampTerse); // part.Name, part.UUID, part.TimeStampTerse);
part.SendUpdateToClient(m_presence.ControllingClient, m_presence.GenerateClientFlags(part.UUID), PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | part.SendUpdateToClient(m_presence.ControllingClient, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation |
PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
update.LastTerseUpdateTime = part.TimeStampTerse; update.LastTerseUpdateTime = part.TimeStampTerse;
@ -162,7 +161,7 @@ namespace OpenSim.Region.Framework.Scenes
continue; continue;
} }
part.SendUpdateToClient(m_presence.ControllingClient, m_presence.GenerateClientFlags(part.UUID), PrimUpdateFlags.FullUpdate); part.SendUpdateToClient(m_presence.ControllingClient, PrimUpdateFlags.FullUpdate);
} }
} }
} }