On teleport to a region that already has a child agent established (e.g. a neighbour) don't resend all the initial avatar and object data again.

This is unnecessary since it has been received (and data continues to be received) in the existing child connection.
0.8-extended
Justin Clark-Casey (justincc) 2014-08-15 21:34:58 +01:00 committed by Justin Clark-Casey
parent 4ec5349192
commit ad1b5959d3
7 changed files with 50 additions and 39 deletions

View File

@ -1296,7 +1296,7 @@ namespace OpenSim.Groups
presence.Grouptitle = Title;
if (! presence.IsChildAgent)
presence.SendAvatarDataToAllAgents();
presence.SendAvatarDataToAllClients();
}
}
}

View File

@ -71,7 +71,7 @@ namespace OpenSim.Framework
/// <remarks>
/// This includes scene object data and the appearance data of other avatars.
/// </remarks>
void SendInitialDataToMe();
void SendInitialDataToClient();
/// <summary>
/// Direction in which the scene presence is looking.

View File

@ -1741,7 +1741,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
bool tp = (aCircuit.teleportFlags > 0);
// Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from
if (!tp)
client.SceneAgent.SendInitialDataToMe();
client.SceneAgent.SendInitialDataToClient();
}
}
else

View File

@ -251,7 +251,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
private void SendAppearance(ScenePresence sp)
{
// Send the appearance to everyone in the scene
sp.SendAppearanceToAllOtherAgents();
sp.SendAppearanceToAllOtherClients();
// Send animations back to the avatar as well
sp.Animator.SendAnimPack();

View File

@ -1786,8 +1786,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
// now we have a child agent in this region. Request all interesting data about other (root) agents
agent.SendOtherAgentsAvatarDataToMe();
agent.SendOtherAgentsAppearanceToMe();
agent.SendOtherAgentsAvatarDataToClient();
agent.SendOtherAgentsAppearanceToClient();
// Backwards compatibility. Best effort
if (version == "Unknown" || version == string.Empty)

View File

@ -286,6 +286,11 @@ namespace OpenSim.Region.Framework.Scenes
}
}
/// <summary>
/// Set if initial data about the scene (avatars, objects) has been sent to the ControllingClient.
/// </summary>
public bool SentInitialDataToClient { get; private set; }
/// <summary>
/// Copy of the script states while the agent is in transit. This state may
/// need to be placed back in case of transfer fail.
@ -1255,7 +1260,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
SendAvatarDataToAllAgents();
SendAvatarDataToAllClients();
// send the animations of the other presences to me
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
@ -1295,7 +1300,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[SCENE PRESENCE]: Forcing viewers to update the avatar name for " + Name);
UseFakeGroupTitle = true;
SendAvatarDataToAllAgents(false);
SendAvatarDataToAllClients(false);
Util.FireAndForget(o =>
{
@ -1306,7 +1311,7 @@ namespace OpenSim.Region.Framework.Scenes
Thread.Sleep(5000);
UseFakeGroupTitle = false;
SendAvatarDataToAllAgents(false);
SendAvatarDataToAllClients(false);
});
}
@ -1741,9 +1746,9 @@ namespace OpenSim.Region.Framework.Scenes
// Tell the client that we're totally ready
ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
// Remember in HandleUseCircuitCode, we delayed this to here
if (m_teleportFlags > 0)
SendInitialDataToMe();
// Child agents send initial data up in LLUDPServer.HandleUseCircuitCode()
if (!SentInitialDataToClient)
SendInitialDataToClient();
// m_log.DebugFormat("[SCENE PRESENCE] Completed movement");
@ -2651,7 +2656,7 @@ namespace OpenSim.Region.Framework.Scenes
if (satOnObject)
{
SendAvatarDataToAllAgents();
SendAvatarDataToAllClients();
m_requestedSitTargetID = 0;
part.RemoveSittingAvatar(this);
@ -2946,7 +2951,7 @@ namespace OpenSim.Region.Framework.Scenes
Animator.TrySetMovementAnimation("SIT_GROUND");
else
Animator.TrySetMovementAnimation("SIT");
SendAvatarDataToAllAgents();
SendAvatarDataToAllClients();
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
}
@ -3061,7 +3066,7 @@ namespace OpenSim.Region.Framework.Scenes
sitAnimation = part.SitAnimation;
}
Animator.TrySetMovementAnimation(sitAnimation);
SendAvatarDataToAllAgents();
SendAvatarDataToAllClients();
TriggerScenePresenceUpdated();
}
}
@ -3184,7 +3189,7 @@ namespace OpenSim.Region.Framework.Scenes
// grab the latest PhysicsActor velocity, whereas m_velocity is often
// storing a requested force instead of an actual traveling velocity
if (Appearance.AvatarSize != m_lastSize && !IsLoggingIn)
SendAvatarDataToAllAgents();
SendAvatarDataToAllClients();
// Allow any updates for sitting avatars to that llSetPrimitiveLinkParams() can work for very
// small increments (e.g. sit position adjusters). An alternative may be to eliminate the tolerance
@ -3338,16 +3343,22 @@ namespace OpenSim.Region.Framework.Scenes
ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations);
}
public void SendInitialDataToMe()
public void SendInitialDataToClient()
{
SentInitialDataToClient = true;
// Send all scene object to the new client
Util.RunThreadNoTimeout(delegate
{
m_log.DebugFormat(
"[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}",
IsChildAgent ? "child" : "root", Name, Scene.Name, m_teleportFlags);
// we created a new ScenePresence (a new child agent) in a fresh region.
// Request info about all the (root) agents in this region
// Note: This won't send data *to* other clients in that region (children don't send)
SendOtherAgentsAvatarDataToMe();
SendOtherAgentsAppearanceToMe();
SendOtherAgentsAvatarDataToClient();
SendOtherAgentsAppearanceToClient();
EntityBase[] entities = Scene.Entities.GetEntities();
foreach (EntityBase e in entities)
@ -3356,7 +3367,7 @@ namespace OpenSim.Region.Framework.Scenes
((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient);
}
}, "SendInitialDataToMe", null);
}, "SendInitialDataToClient", null);
}
/// <summary>
@ -3389,10 +3400,10 @@ namespace OpenSim.Region.Framework.Scenes
// getting other avatars information was initiated elsewhere immediately after the child circuit connected... don't do it
// again here... this comes after the cached appearance check because the avatars
// appearance goes into the avatar update packet
SendAvatarDataToAllAgents();
SendAvatarDataToAllClients();
// This invocation always shows up in the viewer logs as an error. Is it needed?
SendAppearanceToAgent(this);
SendAppearanceToClient(this);
// If we are using the the cached appearance then send it out to everyone
if (cachedappearance)
@ -3402,20 +3413,20 @@ namespace OpenSim.Region.Framework.Scenes
// If the avatars baked textures are all in the cache, then we have a
// complete appearance... send it out, if not, then we'll send it when
// the avatar finishes updating its appearance
SendAppearanceToAllOtherAgents();
SendAppearanceToAllOtherClients();
}
}
public void SendAvatarDataToAllAgents()
public void SendAvatarDataToAllClients()
{
SendAvatarDataToAllAgents(true);
SendAvatarDataToAllClients(true);
}
/// <summary>
/// Send this agent's avatar data to all other root and child agents in the scene
/// This agent must be root. This avatar will receive its own update.
/// </summary>
public void SendAvatarDataToAllAgents(bool full)
public void SendAvatarDataToAllClients(bool full)
{
//m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAllAgents: {0} ({1})", Name, UUID);
// only send update from root agents to other clients; children are only "listening posts"
@ -3434,7 +3445,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
{
if (full)
SendAvatarDataToAgent(scenePresence);
SendAvatarDataToClient(scenePresence);
else
scenePresence.ControllingClient.SendAvatarDataImmediate(this);
count++;
@ -3447,7 +3458,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Send avatar data for all other root agents to this agent, this agent
/// can be either a child or root
/// </summary>
public void SendOtherAgentsAvatarDataToMe()
public void SendOtherAgentsAvatarDataToClient()
{
int count = 0;
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
@ -3456,7 +3467,7 @@ namespace OpenSim.Region.Framework.Scenes
if (scenePresence.UUID == UUID)
return;
scenePresence.SendAvatarDataToAgent(this);
scenePresence.SendAvatarDataToClient(this);
count++;
});
@ -3467,9 +3478,9 @@ namespace OpenSim.Region.Framework.Scenes
/// Send avatar data to an agent.
/// </summary>
/// <param name="avatar"></param>
public void SendAvatarDataToAgent(ScenePresence avatar)
public void SendAvatarDataToClient(ScenePresence avatar)
{
//m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
//m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToClient from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
avatar.ControllingClient.SendAvatarDataImmediate(this);
Animator.SendAnimPackToClient(avatar.ControllingClient);
@ -3479,9 +3490,9 @@ namespace OpenSim.Region.Framework.Scenes
/// Send this agent's appearance to all other root and child agents in the scene
/// This agent must be root.
/// </summary>
public void SendAppearanceToAllOtherAgents()
public void SendAppearanceToAllOtherClients()
{
// m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID);
// m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherClients: {0} {1}", Name, UUID);
// only send update from root agents to other clients; children are only "listening posts"
if (IsChildAgent)
@ -3500,7 +3511,7 @@ namespace OpenSim.Region.Framework.Scenes
if (scenePresence.UUID == UUID)
return;
SendAppearanceToAgent(scenePresence);
SendAppearanceToClient(scenePresence);
count++;
});
@ -3511,9 +3522,9 @@ namespace OpenSim.Region.Framework.Scenes
/// Send appearance from all other root agents to this agent. this agent
/// can be either root or child
/// </summary>
public void SendOtherAgentsAppearanceToMe()
public void SendOtherAgentsAppearanceToClient()
{
// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToClient {0} {1}", Name, UUID);
int count = 0;
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
@ -3522,7 +3533,7 @@ namespace OpenSim.Region.Framework.Scenes
if (scenePresence.UUID == UUID)
return;
scenePresence.SendAppearanceToAgent(this);
scenePresence.SendAppearanceToClient(this);
count++;
});
@ -3533,7 +3544,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Send appearance data to an agent.
/// </summary>
/// <param name="avatar"></param>
public void SendAppearanceToAgent(ScenePresence avatar)
public void SendAppearanceToClient(ScenePresence avatar)
{
// m_log.DebugFormat(
// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);

View File

@ -1381,7 +1381,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
presence.Grouptitle = Title;
if (! presence.IsChildAgent)
presence.SendAvatarDataToAllAgents();
presence.SendAvatarDataToAllClients();
}
}
}