Push updates from keyframe directly to the front of the output queue rather

than through the update system.
avinationmerge
Melanie 2013-02-12 01:02:16 +01:00
parent e85a6237bf
commit 04235e58e8
5 changed files with 46 additions and 10 deletions

View File

@ -698,7 +698,8 @@ namespace OpenSim.Framework
ExtraData = 1 << 20, ExtraData = 1 << 20,
Sound = 1 << 21, Sound = 1 << 21,
Joint = 1 << 22, Joint = 1 << 22,
FullUpdate = UInt32.MaxValue Immediate = 1 << 23,
FullUpdate = UInt32.MaxValue & (uint)~((uint)1<<23)
} }
public static class PrimUpdateFlagsExtensions public static class PrimUpdateFlagsExtensions

View File

@ -3721,6 +3721,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </summary> /// </summary>
public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
{ {
if ((updateFlags & PrimUpdateFlags.Immediate) != 0)
{
SendUnqueuedTerseUpdate((SceneObjectPart)entity);
return;
}
if (entity is SceneObjectPart) if (entity is SceneObjectPart)
{ {
SceneObjectPart e = (SceneObjectPart)entity; SceneObjectPart e = (SceneObjectPart)entity;
@ -4075,6 +4081,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ProcessEntityUpdates(-1); ProcessEntityUpdates(-1);
} }
public void SendUnqueuedTerseUpdate(SceneObjectPart part)
{
ImprovedTerseObjectUpdatePacket packet
= (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(
PacketType.ImprovedTerseObjectUpdate);
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
packet.RegionData.TimeDilation = Utils.FloatToUInt16(1.0f, 0.0f, 1.0f);
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
packet.ObjectData[0] = CreateImprovedTerseBlock(part, false);
OutPacket(packet, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
}
#endregion Primitive Packet/Data Sending Methods #endregion Primitive Packet/Data Sending Methods
// These are used to implement an adaptive backoff in the number // These are used to implement an adaptive backoff in the number

View File

@ -417,7 +417,7 @@ namespace OpenSim.Region.Framework.Scenes
m_group.RootPart.Velocity = Vector3.Zero; m_group.RootPart.Velocity = Vector3.Zero;
m_group.RootPart.AngularVelocity = Vector3.Zero; m_group.RootPart.AngularVelocity = Vector3.Zero;
m_group.SendGroupRootTerseUpdate(); m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate);
// m_group.RootPart.ScheduleTerseUpdate(); // m_group.RootPart.ScheduleTerseUpdate();
m_frames.Clear(); m_frames.Clear();
} }
@ -429,7 +429,7 @@ namespace OpenSim.Region.Framework.Scenes
m_group.RootPart.Velocity = Vector3.Zero; m_group.RootPart.Velocity = Vector3.Zero;
m_group.RootPart.AngularVelocity = Vector3.Zero; m_group.RootPart.AngularVelocity = Vector3.Zero;
m_group.SendGroupRootTerseUpdate(); m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate);
// m_group.RootPart.ScheduleTerseUpdate(); // m_group.RootPart.ScheduleTerseUpdate();
} }
@ -551,7 +551,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_group.RootPart.Velocity != Vector3.Zero) if (m_group.RootPart.Velocity != Vector3.Zero)
{ {
m_group.RootPart.Velocity = Vector3.Zero; m_group.RootPart.Velocity = Vector3.Zero;
m_group.SendGroupRootTerseUpdate(); m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate);
} }
return; return;
@ -695,7 +695,7 @@ namespace OpenSim.Region.Framework.Scenes
if (update) if (update)
{ {
m_group.SendGroupRootTerseUpdate(); m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate);
} }
} }
@ -731,7 +731,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_group.RootPart.Velocity != Vector3.Zero) if (m_group.RootPart.Velocity != Vector3.Zero)
{ {
m_group.RootPart.Velocity = Vector3.Zero; m_group.RootPart.Velocity = Vector3.Zero;
m_group.SendGroupRootTerseUpdate(); m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate);
// m_group.RootPart.ScheduleTerseUpdate(); // m_group.RootPart.ScheduleTerseUpdate();
} }
} }
@ -743,7 +743,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_group != null) if (m_group != null)
{ {
m_group.RootPart.Velocity = Vector3.Zero; m_group.RootPart.Velocity = Vector3.Zero;
m_group.SendGroupRootTerseUpdate(); m_group.SendGroupRootTerseUpdate(PrimUpdateFlags.Immediate);
// m_group.RootPart.ScheduleTerseUpdate(); // m_group.RootPart.ScheduleTerseUpdate();
if (m_running) if (m_running)

View File

@ -2637,11 +2637,16 @@ namespace OpenSim.Region.Framework.Scenes
/// external modules. /// external modules.
/// </summary> /// </summary>
public void SendGroupRootTerseUpdate() public void SendGroupRootTerseUpdate()
{
SendGroupRootTerseUpdate(0);
}
public void SendGroupRootTerseUpdate(PrimUpdateFlags flags)
{ {
if (IsDeleted) if (IsDeleted)
return; return;
RootPart.SendTerseUpdateToAllClients(); RootPart.SendTerseUpdateToAllClients(flags);
} }
public void QueueForUpdateCheck() public void QueueForUpdateCheck()

View File

@ -3314,6 +3314,11 @@ namespace OpenSim.Region.Framework.Scenes
/// Send a terse update to all clients /// Send a terse update to all clients
/// </summary> /// </summary>
public void SendTerseUpdateToAllClients() public void SendTerseUpdateToAllClients()
{
SendTerseUpdateToAllClients(0);
}
public void SendTerseUpdateToAllClients(PrimUpdateFlags flags)
{ {
if (ParentGroup == null || ParentGroup.Scene == null) if (ParentGroup == null || ParentGroup.Scene == null)
return; return;
@ -3328,7 +3333,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
{ {
SendTerseUpdateToClient(client); SendTerseUpdateToClient(client, flags);
}); });
} }
@ -5132,6 +5137,11 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Public Methods #endregion Public Methods
public void SendTerseUpdateToClient(IClientAPI remoteClient) public void SendTerseUpdateToClient(IClientAPI remoteClient)
{
SendTerseUpdateToClient(remoteClient, 0);
}
public void SendTerseUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags flags)
{ {
if (ParentGroup.IsDeleted) if (ParentGroup.IsDeleted)
return; return;
@ -5146,7 +5156,7 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient.SendEntityUpdate( remoteClient.SendEntityUpdate(
this, this,
PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity | flags);
ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); ParentGroup.Scene.StatsReporter.AddObjectUpdates(1);
} }