Merge branch 'master' into careminster-presence-refactor
commit
d457b4c4b1
|
@ -328,7 +328,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an
|
/// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an
|
||||||
/// ownerless phantom.
|
/// ownerless phantom.
|
||||||
///
|
///
|
||||||
/// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock
|
/// All manipulation of this set has to occur under a lock
|
||||||
///
|
///
|
||||||
/// </value>
|
/// </value>
|
||||||
protected HashSet<uint> m_killRecord;
|
protected HashSet<uint> m_killRecord;
|
||||||
|
@ -1536,11 +1536,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
OutPacket(kill, ThrottleOutPacketType.State);
|
OutPacket(kill, ThrottleOutPacketType.State);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_killRecord.Add(localIDs[0]);
|
lock (m_killRecord)
|
||||||
|
{
|
||||||
|
m_killRecord.Add(localIDs[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lock (m_entityUpdates.SyncRoot)
|
lock (m_killRecord)
|
||||||
{
|
{
|
||||||
foreach (uint localID in localIDs)
|
foreach (uint localID in localIDs)
|
||||||
m_killRecord.Add(localID);
|
m_killRecord.Add(localID);
|
||||||
|
@ -3595,248 +3598,254 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
int updatesThisCall = 0;
|
int updatesThisCall = 0;
|
||||||
|
|
||||||
EntityUpdate update;
|
EntityUpdate update;
|
||||||
while (updatesThisCall < maxUpdates)
|
lock (m_killRecord)
|
||||||
{
|
{
|
||||||
lock (m_entityUpdates.SyncRoot)
|
while (updatesThisCall < maxUpdates)
|
||||||
if (!m_entityUpdates.TryDequeue(out update))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (update.Entity is SceneObjectPart)
|
|
||||||
{
|
{
|
||||||
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
lock (m_entityUpdates.SyncRoot)
|
||||||
|
if (!m_entityUpdates.TryDequeue(out update))
|
||||||
|
break;
|
||||||
|
|
||||||
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
|
if (update.Entity is SceneObjectPart)
|
||||||
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
|
{
|
||||||
// safety measure.
|
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
||||||
//
|
|
||||||
// If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
|
|
||||||
// after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
|
|
||||||
// updates and kills on different threads with different scheduling strategies, hence this protection.
|
|
||||||
//
|
|
||||||
// This doesn't appear to apply to child prims - a client will happily ignore these updates
|
|
||||||
// after the root prim has been deleted.
|
|
||||||
if (m_killRecord.Contains(part.LocalId))
|
|
||||||
continue;
|
|
||||||
if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (part.ParentGroup.IsDeleted)
|
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
|
||||||
continue;
|
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
|
||||||
|
// safety measure.
|
||||||
if (part.ParentGroup.IsAttachment)
|
//
|
||||||
{ // Someone else's HUD, why are we getting these?
|
// If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
|
||||||
if (part.ParentGroup.OwnerID != AgentId &&
|
// after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
|
||||||
part.ParentGroup.RootPart.Shape.State >= 30)
|
// updates and kills on different threads with different scheduling strategies, hence this protection.
|
||||||
|
//
|
||||||
|
// This doesn't appear to apply to child prims - a client will happily ignore these updates
|
||||||
|
// after the root prim has been deleted.
|
||||||
|
if (m_killRecord.Contains(part.LocalId))
|
||||||
continue;
|
continue;
|
||||||
ScenePresence sp;
|
if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
|
||||||
// Owner is not in the sim, don't update it to
|
|
||||||
// anyone
|
|
||||||
if (!m_scene.TryGetScenePresence(part.OwnerID, out sp))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
List<SceneObjectGroup> atts = sp.Attachments;
|
if (part.ParentGroup.IsDeleted)
|
||||||
bool found = false;
|
continue;
|
||||||
foreach (SceneObjectGroup att in atts)
|
|
||||||
{
|
if (part.ParentGroup.IsAttachment)
|
||||||
if (att == part.ParentGroup)
|
{ // Someone else's HUD, why are we getting these?
|
||||||
|
if (part.ParentGroup.OwnerID != AgentId &&
|
||||||
|
part.ParentGroup.RootPart.Shape.State >= 30)
|
||||||
|
continue;
|
||||||
|
ScenePresence sp;
|
||||||
|
// Owner is not in the sim, don't update it to
|
||||||
|
// anyone
|
||||||
|
if (!m_scene.TryGetScenePresence(part.OwnerID, out sp))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
List<SceneObjectGroup> atts = sp.Attachments;
|
||||||
|
bool found = false;
|
||||||
|
foreach (SceneObjectGroup att in atts)
|
||||||
{
|
{
|
||||||
found = true;
|
if (att == part.ParentGroup)
|
||||||
break;
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// It's an attachment of a valid avatar, but
|
||||||
|
// doesn't seem to be attached, skip
|
||||||
|
if (!found)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (part.ParentGroup.IsAttachment && m_disableFacelights)
|
||||||
|
{
|
||||||
|
if (part.ParentGroup.IsAttachment && m_disableFacelights)
|
||||||
|
{
|
||||||
|
if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&
|
||||||
|
part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand)
|
||||||
|
{
|
||||||
|
part.Shape.LightEntry = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's an attachment of a valid avatar, but
|
++updatesThisCall;
|
||||||
// doesn't seem to be attached, skip
|
|
||||||
if (!found)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (part.ParentGroup.IsAttachment && m_disableFacelights)
|
#region UpdateFlags to packet type conversion
|
||||||
{
|
|
||||||
if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&
|
PrimUpdateFlags updateFlags = update.Flags;
|
||||||
part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand)
|
|
||||||
|
bool canUseCompressed = true;
|
||||||
|
bool canUseImproved = true;
|
||||||
|
|
||||||
|
// Compressed object updates only make sense for LL primitives
|
||||||
|
if (!(update.Entity is SceneObjectPart))
|
||||||
{
|
{
|
||||||
part.Shape.LightEntry = false;
|
canUseCompressed = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
++updatesThisCall;
|
if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate))
|
||||||
|
{
|
||||||
|
canUseCompressed = false;
|
||||||
|
canUseImproved = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Acceleration) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
||||||
|
{
|
||||||
|
canUseCompressed = false;
|
||||||
|
}
|
||||||
|
|
||||||
#region UpdateFlags to packet type conversion
|
if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.ParentID) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Scale) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.PrimData) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Text) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.NameValue) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.ExtraData) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Sound) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Particles) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Material) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.ClickAction) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.MediaURL) ||
|
||||||
|
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
||||||
|
{
|
||||||
|
canUseImproved = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PrimUpdateFlags updateFlags = update.Flags;
|
#endregion UpdateFlags to packet type conversion
|
||||||
|
|
||||||
bool canUseCompressed = true;
|
#region Block Construction
|
||||||
bool canUseImproved = true;
|
|
||||||
|
|
||||||
// Compressed object updates only make sense for LL primitives
|
// TODO: Remove this once we can build compressed updates
|
||||||
if (!(update.Entity is SceneObjectPart))
|
|
||||||
{
|
|
||||||
canUseCompressed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate))
|
|
||||||
{
|
|
||||||
canUseCompressed = false;
|
|
||||||
canUseImproved = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Acceleration) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
|
||||||
{
|
|
||||||
canUseCompressed = false;
|
canUseCompressed = false;
|
||||||
|
|
||||||
|
if (!canUseImproved && !canUseCompressed)
|
||||||
|
{
|
||||||
|
if (update.Entity is ScenePresence)
|
||||||
|
{
|
||||||
|
objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// if (update.Entity is SceneObjectPart && ((SceneObjectPart)update.Entity).IsAttachment)
|
||||||
|
// {
|
||||||
|
// SceneObjectPart sop = (SceneObjectPart)update.Entity;
|
||||||
|
// string text = sop.Text;
|
||||||
|
// if (text.IndexOf("\n") >= 0)
|
||||||
|
// text = text.Remove(text.IndexOf("\n"));
|
||||||
|
//
|
||||||
|
// if (m_attachmentsSent.Contains(sop.ParentID))
|
||||||
|
// {
|
||||||
|
//// m_log.DebugFormat(
|
||||||
|
//// "[CLIENT]: Sending full info about attached prim {0} text {1}",
|
||||||
|
//// sop.LocalId, text);
|
||||||
|
//
|
||||||
|
// objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock(sop, this.m_agentId));
|
||||||
|
//
|
||||||
|
// m_attachmentsSent.Add(sop.LocalId);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[CLIENT]: Requeueing full update of prim {0} text {1} since we haven't sent its parent {2} yet",
|
||||||
|
// sop.LocalId, text, sop.ParentID);
|
||||||
|
//
|
||||||
|
// m_entityUpdates.Enqueue(double.MaxValue, update, sop.LocalId);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId));
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!canUseImproved)
|
||||||
|
{
|
||||||
|
compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId)
|
||||||
|
// Self updates go into a special list
|
||||||
|
terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
||||||
|
else
|
||||||
|
// Everything else goes here
|
||||||
|
terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Block Construction
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) ||
|
#region Packet Sending
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.ParentID) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Scale) ||
|
const float TIME_DILATION = 1.0f;
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.PrimData) ||
|
ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Text) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.NameValue) ||
|
if (terseAgentUpdateBlocks.IsValueCreated)
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.ExtraData) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Sound) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Particles) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Material) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.ClickAction) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.MediaURL) ||
|
|
||||||
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
|
||||||
{
|
{
|
||||||
canUseImproved = false;
|
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
|
||||||
|
|
||||||
|
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||||
|
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||||
|
packet.RegionData.TimeDilation = timeDilation;
|
||||||
|
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||||
|
|
||||||
|
for (int i = 0; i < blocks.Count; i++)
|
||||||
|
packet.ObjectData[i] = blocks[i];
|
||||||
|
|
||||||
|
OutPacket(packet, ThrottleOutPacketType.Unknown, true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endregion UpdateFlags to packet type conversion
|
if (objectUpdateBlocks.IsValueCreated)
|
||||||
|
|
||||||
#region Block Construction
|
|
||||||
|
|
||||||
// TODO: Remove this once we can build compressed updates
|
|
||||||
canUseCompressed = false;
|
|
||||||
|
|
||||||
if (!canUseImproved && !canUseCompressed)
|
|
||||||
{
|
|
||||||
if (update.Entity is ScenePresence)
|
|
||||||
{
|
{
|
||||||
objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity));
|
List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value;
|
||||||
|
|
||||||
|
ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
|
||||||
|
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||||
|
packet.RegionData.TimeDilation = timeDilation;
|
||||||
|
packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||||
|
|
||||||
|
for (int i = 0; i < blocks.Count; i++)
|
||||||
|
packet.ObjectData[i] = blocks[i];
|
||||||
|
|
||||||
|
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (compressedUpdateBlocks.IsValueCreated)
|
||||||
{
|
{
|
||||||
// if (update.Entity is SceneObjectPart && ((SceneObjectPart)update.Entity).IsAttachment)
|
List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value;
|
||||||
// {
|
|
||||||
// SceneObjectPart sop = (SceneObjectPart)update.Entity;
|
ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed);
|
||||||
// string text = sop.Text;
|
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||||
// if (text.IndexOf("\n") >= 0)
|
packet.RegionData.TimeDilation = timeDilation;
|
||||||
// text = text.Remove(text.IndexOf("\n"));
|
packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count];
|
||||||
//
|
|
||||||
// if (m_attachmentsSent.Contains(sop.ParentID))
|
for (int i = 0; i < blocks.Count; i++)
|
||||||
// {
|
packet.ObjectData[i] = blocks[i];
|
||||||
//// m_log.DebugFormat(
|
|
||||||
//// "[CLIENT]: Sending full info about attached prim {0} text {1}",
|
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||||
//// sop.LocalId, text);
|
}
|
||||||
//
|
|
||||||
// objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock(sop, this.m_agentId));
|
if (terseUpdateBlocks.IsValueCreated)
|
||||||
//
|
{
|
||||||
// m_attachmentsSent.Add(sop.LocalId);
|
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value;
|
||||||
// }
|
|
||||||
// else
|
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||||
// {
|
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||||
// m_log.DebugFormat(
|
packet.RegionData.TimeDilation = timeDilation;
|
||||||
// "[CLIENT]: Requeueing full update of prim {0} text {1} since we haven't sent its parent {2} yet",
|
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||||
// sop.LocalId, text, sop.ParentID);
|
|
||||||
//
|
for (int i = 0; i < blocks.Count; i++)
|
||||||
// m_entityUpdates.Enqueue(double.MaxValue, update, sop.LocalId);
|
packet.ObjectData[i] = blocks[i];
|
||||||
// }
|
|
||||||
// }
|
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||||
// else
|
|
||||||
// {
|
|
||||||
objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!canUseImproved)
|
|
||||||
{
|
|
||||||
compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId)
|
|
||||||
// Self updates go into a special list
|
|
||||||
terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
|
||||||
else
|
|
||||||
// Everything else goes here
|
|
||||||
terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Block Construction
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Packet Sending
|
|
||||||
|
|
||||||
const float TIME_DILATION = 1.0f;
|
|
||||||
ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
|
|
||||||
|
|
||||||
if (terseAgentUpdateBlocks.IsValueCreated)
|
|
||||||
{
|
|
||||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
|
|
||||||
|
|
||||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
|
||||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
|
||||||
packet.RegionData.TimeDilation = timeDilation;
|
|
||||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
|
||||||
|
|
||||||
for (int i = 0; i < blocks.Count; i++)
|
|
||||||
packet.ObjectData[i] = blocks[i];
|
|
||||||
|
|
||||||
OutPacket(packet, ThrottleOutPacketType.Unknown, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (objectUpdateBlocks.IsValueCreated)
|
|
||||||
{
|
|
||||||
List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value;
|
|
||||||
|
|
||||||
ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
|
|
||||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
|
||||||
packet.RegionData.TimeDilation = timeDilation;
|
|
||||||
packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
|
||||||
|
|
||||||
for (int i = 0; i < blocks.Count; i++)
|
|
||||||
packet.ObjectData[i] = blocks[i];
|
|
||||||
|
|
||||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (compressedUpdateBlocks.IsValueCreated)
|
|
||||||
{
|
|
||||||
List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value;
|
|
||||||
|
|
||||||
ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed);
|
|
||||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
|
||||||
packet.RegionData.TimeDilation = timeDilation;
|
|
||||||
packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count];
|
|
||||||
|
|
||||||
for (int i = 0; i < blocks.Count; i++)
|
|
||||||
packet.ObjectData[i] = blocks[i];
|
|
||||||
|
|
||||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (terseUpdateBlocks.IsValueCreated)
|
|
||||||
{
|
|
||||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value;
|
|
||||||
|
|
||||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
|
||||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
|
||||||
packet.RegionData.TimeDilation = timeDilation;
|
|
||||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
|
||||||
|
|
||||||
for (int i = 0; i < blocks.Count; i++)
|
|
||||||
packet.ObjectData[i] = blocks[i];
|
|
||||||
|
|
||||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Packet Sending
|
#endregion Packet Sending
|
||||||
|
|
|
@ -152,7 +152,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
private int m_update_backup = 200;
|
private int m_update_backup = 200;
|
||||||
private int m_update_terrain = 50;
|
private int m_update_terrain = 50;
|
||||||
private int m_update_land = 1;
|
private int m_update_land = 1;
|
||||||
private int m_update_coarse_locations = 50;
|
private int m_update_coarse_locations = 80;
|
||||||
|
|
||||||
private int frameMS;
|
private int frameMS;
|
||||||
private int physicsMS2;
|
private int physicsMS2;
|
||||||
|
@ -181,6 +181,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
private object m_deleting_scene_object = new object();
|
private object m_deleting_scene_object = new object();
|
||||||
private object m_cleaningAttachments = new object();
|
private object m_cleaningAttachments = new object();
|
||||||
|
|
||||||
|
private bool m_cleaningTemps = false;
|
||||||
|
|
||||||
private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||||
private bool m_reprioritizationEnabled = true;
|
private bool m_reprioritizationEnabled = true;
|
||||||
private double m_reprioritizationInterval = 5000.0;
|
private double m_reprioritizationInterval = 5000.0;
|
||||||
|
@ -1296,10 +1298,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
physicsMS = Util.EnvironmentTickCountSubtract(tmpPhysicsMS);
|
physicsMS = Util.EnvironmentTickCountSubtract(tmpPhysicsMS);
|
||||||
|
|
||||||
// Delete temp-on-rez stuff
|
// Delete temp-on-rez stuff
|
||||||
if (m_frame % m_update_backup == 0)
|
if (m_frame % 1000 == 0 && !m_cleaningTemps)
|
||||||
{
|
{
|
||||||
int tmpTempOnRezMS = Util.EnvironmentTickCount();
|
int tmpTempOnRezMS = Util.EnvironmentTickCount();
|
||||||
CleanTempObjects();
|
m_cleaningTemps = true;
|
||||||
|
Util.FireAndForget(delegate { CleanTempObjects(); m_cleaningTemps = false; });
|
||||||
tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpTempOnRezMS);
|
tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpTempOnRezMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1326,12 +1329,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
terrainMS = Util.EnvironmentTickCountSubtract(terMS);
|
terrainMS = Util.EnvironmentTickCountSubtract(terMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_frame % m_update_land == 0)
|
//if (m_frame % m_update_land == 0)
|
||||||
{
|
//{
|
||||||
int ldMS = Util.EnvironmentTickCount();
|
// int ldMS = Util.EnvironmentTickCount();
|
||||||
UpdateLand();
|
// UpdateLand();
|
||||||
landMS = Util.EnvironmentTickCountSubtract(ldMS);
|
// landMS = Util.EnvironmentTickCountSubtract(ldMS);
|
||||||
}
|
//}
|
||||||
|
|
||||||
frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS);
|
frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS);
|
||||||
otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS;
|
otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS;
|
||||||
|
@ -1424,13 +1427,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private void CheckAtTargets()
|
private void CheckAtTargets()
|
||||||
{
|
{
|
||||||
|
Dictionary<UUID, SceneObjectGroup>.ValueCollection objs;
|
||||||
lock (m_groupsWithTargets)
|
lock (m_groupsWithTargets)
|
||||||
{
|
objs = m_groupsWithTargets.Values;
|
||||||
foreach (SceneObjectGroup entry in m_groupsWithTargets.Values)
|
|
||||||
{
|
foreach (SceneObjectGroup entry in objs)
|
||||||
entry.checkAtTargets();
|
entry.checkAtTargets();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4539,6 +4541,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteFromStorage(UUID uuid)
|
public void DeleteFromStorage(UUID uuid)
|
||||||
|
|
|
@ -2635,6 +2635,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
#region Overridden Methods
|
#region Overridden Methods
|
||||||
|
|
||||||
|
private bool sendingPrims = false;
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
const float ROTATION_TOLERANCE = 0.01f;
|
const float ROTATION_TOLERANCE = 0.01f;
|
||||||
|
@ -2642,7 +2644,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
const float POSITION_TOLERANCE = 0.05f;
|
const float POSITION_TOLERANCE = 0.05f;
|
||||||
//const int TIME_MS_TOLERANCE = 3000;
|
//const int TIME_MS_TOLERANCE = 3000;
|
||||||
|
|
||||||
|
if (!sendingPrims)
|
||||||
|
Util.FireAndForget(delegate { sendingPrims = true; SendPrimUpdates(); sendingPrims = false; });
|
||||||
|
|
||||||
if (m_isChildAgent == false)
|
if (m_isChildAgent == false)
|
||||||
{
|
{
|
||||||
|
@ -2670,6 +2673,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// followed suggestion from mic bowman. reversed the two lines below.
|
// followed suggestion from mic bowman. reversed the two lines below.
|
||||||
if (m_parentID == 0 && m_physicsActor != null || m_parentID != 0) // Check that we have a physics actor or we're sitting on something
|
if (m_parentID == 0 && m_physicsActor != null || m_parentID != 0) // Check that we have a physics actor or we're sitting on something
|
||||||
CheckForBorderCrossing();
|
CheckForBorderCrossing();
|
||||||
|
|
||||||
CheckForSignificantMovement(); // sends update to the modules.
|
CheckForSignificantMovement(); // sends update to the modules.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3037,6 +3037,7 @@
|
||||||
<Reference name="OpenSim.Framework.Statistics"/>
|
<Reference name="OpenSim.Framework.Statistics"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Region.CoreModules"/>
|
<Reference name="OpenSim.Region.CoreModules"/>
|
||||||
|
<Reference name="OpenSim.Region.OptionalModules"/>
|
||||||
<Reference name="OpenSim.Region.Physics.Manager"/>
|
<Reference name="OpenSim.Region.Physics.Manager"/>
|
||||||
<Reference name="OpenSim.Services.Interfaces"/>
|
<Reference name="OpenSim.Services.Interfaces"/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue