diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 2831326027..d121d1a8ce 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -1296,7 +1296,7 @@ namespace OpenSim.Groups presence.Grouptitle = Title; if (! presence.IsChildAgent) - presence.SendAvatarDataToAllAgents(); + presence.SendAvatarDataToAllClients(); } } } diff --git a/OpenSim/Framework/ISceneAgent.cs b/OpenSim/Framework/ISceneAgent.cs index 563d906b7f..1e8f896c50 100644 --- a/OpenSim/Framework/ISceneAgent.cs +++ b/OpenSim/Framework/ISceneAgent.cs @@ -71,7 +71,7 @@ namespace OpenSim.Framework /// /// This includes scene object data and the appearance data of other avatars. /// - void SendInitialDataToMe(); + void SendInitialDataToClient(); /// /// Direction in which the scene presence is looking. diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 5a9646a320..0df22bf72d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -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 diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 9f99143948..d8c159f518 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -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(); diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 7ef83c0da4..1fa219585c 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -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) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2418830223..025ae38dad 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -286,6 +286,11 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Set if initial data about the scene (avatars, objects) has been sent to the ControllingClient. + /// + public bool SentInitialDataToClient { get; private set; } + /// /// 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); } /// @@ -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); } /// /// 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. /// - 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 /// - 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. /// /// - 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. /// - 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 /// - 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. /// /// - 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); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 8a9e4d2dc4..dff3f78f33 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -1381,7 +1381,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups presence.Grouptitle = Title; if (! presence.IsChildAgent) - presence.SendAvatarDataToAllAgents(); + presence.SendAvatarDataToAllClients(); } } }