Stop attachments from causing an update to be sent on every frame in which
an avatar moves.0.6.1-post-fixes
parent
ce37b80c68
commit
fc6f3edec6
|
@ -2356,9 +2356,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
return att.UUID;
|
||||
}
|
||||
|
||||
public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos)
|
||||
public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent)
|
||||
{
|
||||
m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos, false);
|
||||
m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent);
|
||||
}
|
||||
|
||||
public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
|
||||
|
|
|
@ -2042,6 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp, bool silent)
|
||||
{
|
||||
bool successYN = false;
|
||||
grp.RootPart.UpdateFlag = 0;
|
||||
int primcrossingXMLmethod = 0;
|
||||
|
||||
if (newRegionHandle != 0)
|
||||
|
@ -2139,7 +2140,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
grp.SetFromAssetID(grp.RootPart.LastOwnerID);
|
||||
m_log.DebugFormat("[ATTACHMENT]: Attach to avatar {0}", sp.UUID.ToString());
|
||||
AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition);
|
||||
AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1575,6 +1575,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
lock (m_parts)
|
||||
{
|
||||
bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
|
||||
|
||||
//if (IsAttachment)
|
||||
//{
|
||||
//foreach (SceneObjectPart part in m_parts.Values)
|
||||
|
@ -1584,7 +1586,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
//return;
|
||||
//}
|
||||
|
||||
if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02)
|
||||
if ((Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) && UsePhysics)
|
||||
{
|
||||
m_rootPart.UpdateFlag = 1;
|
||||
lastPhysGroupPos = AbsolutePosition;
|
||||
|
@ -1596,10 +1598,11 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
checkAtTargets();
|
||||
|
||||
if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
|
||||
if (((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
|
||||
|| (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
|
||||
|| (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1)
|
||||
|| (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))
|
||||
&& UsePhysics)
|
||||
{
|
||||
m_rootPart.UpdateFlag = 1;
|
||||
|
||||
|
|
|
@ -646,7 +646,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// We deal with the possibility that two updates occur at
|
||||
// the same unix time at the update point itself.
|
||||
|
||||
if (update.LastFullUpdateTime < part.TimeStampFull)
|
||||
if ((update.LastFullUpdateTime < part.TimeStampFull) ||
|
||||
part.IsAttachment)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
|
||||
|
@ -693,6 +694,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
if (part != part.ParentGroup.RootPart)
|
||||
continue;
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
part.ParentGroup.SendFullUpdateToClient(ControllingClient);
|
||||
continue;
|
||||
}
|
||||
|
@ -3184,7 +3186,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
// Attach from world, if not already attached
|
||||
if (att.ParentGroup != null && !att.IsAttachment)
|
||||
m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero);
|
||||
m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero, false);
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue