send the avatar data after sending attachments, by the same Entity updates

path
avinationmerge
UbitUmarov 2014-08-19 05:13:18 +01:00
parent 42a58101cf
commit 1c9af8727d
1 changed files with 42 additions and 8 deletions

View File

@ -1908,10 +1908,12 @@ namespace OpenSim.Region.Framework.Scenes
// sog.ScheduleGroupForFullUpdate(); // sog.ScheduleGroupForFullUpdate();
m_scene.ForEachScenePresence(delegate(ScenePresence p) m_scene.ForEachScenePresence(delegate(ScenePresence p)
{ {
if (p != this && sog.HasPrivateAttachmentPoint)
return;
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
return; return;
sog.SendFullUpdateToClient(p.ControllingClient); sog.SendFullUpdateToClient(p.ControllingClient);
p.ControllingClient.SendAvatarDataImmediate(this); // resend our data -> test 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());
@ -3377,6 +3379,16 @@ namespace OpenSim.Region.Framework.Scenes
ControllingClient.SendAgentTerseUpdate(p); ControllingClient.SendAgentTerseUpdate(p);
} }
public void SendFullUpdateToClient(IClientAPI remoteClient)
{
if (remoteClient.IsActive)
{
//m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity);
remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate);
m_scene.StatsReporter.AddAgentUpdates(1);
}
}
/// <summary> /// <summary>
/// Sends a location update to the client connected to this scenePresence /// Sends a location update to the client connected to this scenePresence
/// via entity updates /// via entity updates
@ -4672,18 +4684,40 @@ namespace OpenSim.Region.Framework.Scenes
return validated; return validated;
} }
public void SendAttachmentsToAllAgents()
public void SendAttachmentsToClient(IClientAPI client)
{ {
lock (m_attachments) lock (m_attachments)
{ {
foreach (SceneObjectGroup gobj in m_attachments) foreach (SceneObjectGroup sog in m_attachments)
{ {
gobj.SendFullUpdateToClient(client); m_scene.ForEachScenePresence(delegate(ScenePresence p)
{
if (p != this && sog.HasPrivateAttachmentPoint)
return;
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
return;
sog.SendFullUpdateToClient(p.ControllingClient);
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
});
} }
} }
} }
// send attachments to a client without filters except for huds
// for now they are checked in several places down the line...
public void SendAttachmentsToAgentNF(ScenePresence p)
{
lock (m_attachments)
{
foreach (SceneObjectGroup sog in m_attachments)
{
if (p == this || !sog.HasPrivateAttachmentPoint)
sog.SendFullUpdateToClient(p.ControllingClient);
}
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
}
}
/// <summary> /// <summary>
/// Send a script event to this scene presence's attachments /// Send a script event to this scene presence's attachments
/// </summary> /// </summary>
@ -5458,7 +5492,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname); m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
ControllingClient.SendAvatarDataImmediate(p); ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this); p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient); p.SendAttachmentsToAgentNF(this);
if (p.Animator != null) if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient); p.Animator.SendAnimPackToClient(ControllingClient);
@ -5775,7 +5809,7 @@ namespace OpenSim.Region.Framework.Scenes
p.ControllingClient.SendAvatarDataImmediate(this); p.ControllingClient.SendAvatarDataImmediate(this);
// m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname); // m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
SendAppearanceToAgent(p); SendAppearanceToAgent(p);
SendAttachmentsToClient(p.ControllingClient); SendAttachmentsToAgentNF(p);
if (Animator != null) if (Animator != null)
Animator.SendAnimPackToClient(p.ControllingClient); Animator.SendAnimPackToClient(p.ControllingClient);
} }
@ -5790,7 +5824,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); // m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
ControllingClient.SendAvatarDataImmediate(p); ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this); p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient); p.SendAttachmentsToAgentNF(this);
if (p.Animator != null) if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient); p.Animator.SendAnimPackToClient(ControllingClient);
} }