sending attachment kills before putting them back doesnt cover all cases

and seems heavy for viewers
avinationmerge
UbitUmarov 2014-08-20 17:48:10 +01:00
parent d16f7df673
commit b21b6532b0
1 changed files with 21 additions and 24 deletions

View File

@ -1878,7 +1878,6 @@ namespace OpenSim.Region.Framework.Scenes
if (!IsChildAgent) if (!IsChildAgent)
{ {
ValidateAndSendAppearanceAndAgentData(); ValidateAndSendAppearanceAndAgentData();
m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts));
@ -1900,35 +1899,30 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat( m_log.DebugFormat(
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
List<uint> kk = new List<uint>();
// Resume scripts this possible should also be moved down after sending the avatar to viewer ? // Resume scripts this possible should also be moved down after sending the avatar to viewer ?
foreach (SceneObjectGroup sog in m_attachments) foreach (SceneObjectGroup sog in m_attachments)
{ {
foreach (SceneObjectPart part in sog.Parts)
kk.Add(part.LocalId);
sog.SendFullUpdateToClient(ControllingClient); sog.SendFullUpdateToClient(ControllingClient);
SendFullUpdateToClient(ControllingClient); SendFullUpdateToClient(ControllingClient);
// sog.ScheduleGroupForFullUpdate(); if (!sog.HasPrivateAttachmentPoint)
m_scene.ForEachScenePresence(delegate(ScenePresence p)
{ {
if (p == this) // sog.ScheduleGroupForFullUpdate();
return; m_scene.ForEachScenePresence(delegate(ScenePresence p)
if (sog.HasPrivateAttachmentPoint) {
return; if (p == this)
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) return;
return;
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
p.ControllingClient.SendKillObject(kk); return;
sog.SendFullUpdateToClient(p.ControllingClient);
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path sog.SendFullUpdateToClient(p.ControllingClient);
}); SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
});
}
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
sog.ResumeScripts(); sog.ResumeScripts();
kk.Clear();
} }
} }
} }
@ -4758,6 +4752,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
// send attachments to a client without filters except for huds
// for now they are checked in several places down the line...
// kills all parts before sending
public void SendAttachmentsToAgentNFPK(ScenePresence p) public void SendAttachmentsToAgentNFPK(ScenePresence p)
{ {
lock (m_attachments) lock (m_attachments)
@ -5680,7 +5677,7 @@ namespace OpenSim.Region.Framework.Scenes
p.SendAppearanceToAgent(this); p.SendAppearanceToAgent(this);
if (p.Animator != null) if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient); p.Animator.SendAnimPackToClient(ControllingClient);
p.SendAttachmentsToAgentNFPK(this); p.SendAttachmentsToAgentNF(this);
} }
} }
} }
@ -5995,7 +5992,7 @@ namespace OpenSim.Region.Framework.Scenes
SendAppearanceToAgent(p); SendAppearanceToAgent(p);
if (Animator != null) if (Animator != null)
Animator.SendAnimPackToClient(p.ControllingClient); Animator.SendAnimPackToClient(p.ControllingClient);
SendAttachmentsToAgentNFPK(p); SendAttachmentsToAgentNF(p);
} }
} }
@ -6011,7 +6008,7 @@ namespace OpenSim.Region.Framework.Scenes
p.SendAppearanceToAgent(this); p.SendAppearanceToAgent(this);
if (p.Animator != null) if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient); p.Animator.SendAnimPackToClient(ControllingClient);
p.SendAttachmentsToAgentNFPK(this); p.SendAttachmentsToAgentNF(this);
} }
} }
} }