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

View File

@ -1490,15 +1490,14 @@ namespace OpenSim.Region.Framework.Scenes
public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags updateFlags)
{
RootPart.SendUpdateToClient(
remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID), updateFlags);
RootPart.SendUpdateToClient(remoteClient, updateFlags);
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
{
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>
/// Send a full update for this part to all clients.
/// </summary>
@ -2855,7 +2846,7 @@ namespace OpenSim.Region.Framework.Scenes
{
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 :(
if (avatar.UUID != agentID)
SendUpdateToClient(avatar.ControllingClient, avatar.GenerateClientFlags(UUID), updateFlags);
SendUpdateToClient(avatar.ControllingClient, updateFlags);
});
}
/// <summary>
/// Sends a full update to the client
/// Sends an update for this object to a client
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="lPos"></param>
/// <param name="clientFlags"></param>
public void SendUpdateToClient(IClientAPI remoteClient, uint clientFlags, PrimUpdateFlags updateFlags)
public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags updateFlags)
{
// Sanity check
if (ParentGroup == null || ParentGroup.IsDeleted)

View File

@ -789,11 +789,6 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneViewer.QueuePartForUpdate(part);
}
public uint GenerateClientFlags(UUID ObjectID)
{
return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
}
/// <summary>
/// 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

View File

@ -118,8 +118,7 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
// part.Name, part.UUID, part.TimeStampFull);
part.SendUpdateToClient(m_presence.ControllingClient,
m_presence.GenerateClientFlags(part.UUID), PrimUpdateFlags.FullUpdate);
part.SendUpdateToClient(m_presence.ControllingClient, PrimUpdateFlags.FullUpdate);
// We'll update to the part's timestamp rather than
// 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}",
// 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);
update.LastTerseUpdateTime = part.TimeStampTerse;
@ -162,7 +161,7 @@ namespace OpenSim.Region.Framework.Scenes
continue;
}
part.SendUpdateToClient(m_presence.ControllingClient, m_presence.GenerateClientFlags(part.UUID), PrimUpdateFlags.FullUpdate);
part.SendUpdateToClient(m_presence.ControllingClient, PrimUpdateFlags.FullUpdate);
}
}
}