aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-11-25 01:25:56 +0000
committerMelanie2010-11-25 01:25:56 +0000
commiteb9d7bff6c8dc73c86632ea0dbc7081503334cf3 (patch)
tree2d1446d488e7864a04be4ce7958c196e4cf33107
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentPrevent an overlength button label from producing a debug dump and aborting (diff)
downloadopensim-SC-eb9d7bff6c8dc73c86632ea0dbc7081503334cf3.zip
opensim-SC-eb9d7bff6c8dc73c86632ea0dbc7081503334cf3.tar.gz
opensim-SC-eb9d7bff6c8dc73c86632ea0dbc7081503334cf3.tar.bz2
opensim-SC-eb9d7bff6c8dc73c86632ea0dbc7081503334cf3.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs35
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs10
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs233
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs9
9 files changed, 158 insertions, 176 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index cc9fcea..1600bdc 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -302,31 +302,26 @@ namespace OpenSim.Framework
302 if (args["start_pos"] != null) 302 if (args["start_pos"] != null)
303 Vector3.TryParse(args["start_pos"].AsString(), out startpos); 303 Vector3.TryParse(args["start_pos"].AsString(), out startpos);
304 304
305// DEBUG ON 305 m_log.InfoFormat("[AGENTCIRCUITDATA] agentid={0}, child={1}, startpos={2}",AgentID,child,startpos.ToString());
306 m_log.WarnFormat("[AGENTCIRCUITDATA] agentid={0}, child={1}, startpos={2}",AgentID,child,startpos.ToString());
307// DEBUG OFF
308 306
309 try { 307 try {
310 // Unpack various appearance elements 308 // Unpack various appearance elements
311 Appearance = new AvatarAppearance(AgentID); 309 Appearance = new AvatarAppearance(AgentID);
312 310
313 // Eventually this code should be deprecated, use full appearance 311 // Eventually this code should be deprecated, use full appearance
314 // packing in packed_appearance 312 // packing in packed_appearance
315 if (args["appearance_serial"] != null) 313 if (args["appearance_serial"] != null)
316 Appearance.Serial = args["appearance_serial"].AsInteger(); 314 Appearance.Serial = args["appearance_serial"].AsInteger();
317 315
318 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"].Type == OSDType.Map)) 316 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"].Type == OSDType.Map))
319 { 317 {
320 Appearance.Unpack((OSDMap)args["packed_appearance"]); 318 Appearance.Unpack((OSDMap)args["packed_appearance"]);
321// DEBUG ON 319 m_log.InfoFormat("[AGENTCIRCUITDATA] unpacked appearance");
322 m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); 320 }
323// DEBUG OFF 321 else
322 m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance");
324 } 323 }
325// DEBUG ON 324 catch (Exception e)
326 else
327 m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance");
328// DEBUG OFF
329 } catch (Exception e)
330 { 325 {
331 m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message); 326 m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message);
332 } 327 }
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index a227338..ce0b2fb 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -331,9 +331,7 @@ namespace OpenSim.Framework
331 331
332 public virtual OSDMap Pack() 332 public virtual OSDMap Pack()
333 { 333 {
334// DEBUG ON 334 m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
335 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] Pack data");
336// DEBUG OFF
337 335
338 OSDMap args = new OSDMap(); 336 OSDMap args = new OSDMap();
339 args["message_type"] = OSD.FromString("AgentData"); 337 args["message_type"] = OSD.FromString("AgentData");
@@ -454,9 +452,7 @@ namespace OpenSim.Framework
454 /// <param name="hash"></param> 452 /// <param name="hash"></param>
455 public virtual void Unpack(OSDMap args) 453 public virtual void Unpack(OSDMap args)
456 { 454 {
457// DEBUG ON 455 m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data");
458 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] Unpack data");
459// DEBUG OFF
460 456
461 if (args.ContainsKey("region_id")) 457 if (args.ContainsKey("region_id"))
462 UUID.TryParse(args["region_id"].AsString(), out RegionID); 458 UUID.TryParse(args["region_id"].AsString(), out RegionID);
@@ -613,10 +609,8 @@ namespace OpenSim.Framework
613 609
614 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) 610 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
615 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]); 611 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]);
616// DEBUG ON
617 else 612 else
618 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); 613 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance");
619// DEBUG OFF
620 614
621 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) 615 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
622 { 616 {
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 0df4585..ab1c206 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
183 }); 183 });
184 } 184 }
185 185
186 // m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId); 186 m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId);
187 } 187 }
188 188
189 // Process the visual params, this may change height as well 189 // Process the visual params, this may change height as well
@@ -196,12 +196,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
196 sp.SetHeight(sp.Appearance.AvatarHeight); 196 sp.SetHeight(sp.Appearance.AvatarHeight);
197 } 197 }
198 } 198 }
199
200 // Send the appearance back to the avatar, not clear that this is needed
201 sp.ControllingClient.SendAvatarDataImmediate(sp);
202 // AvatarAppearance avp = sp.Appearance;
203 // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes());
204
205 } 199 }
206 200
207 201
@@ -274,21 +268,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
274 268
275 // Send the appearance to everyone in the scene 269 // Send the appearance to everyone in the scene
276 sp.SendAppearanceToAllOtherAgents(); 270 sp.SendAppearanceToAllOtherAgents();
277 // sp.ControllingClient.SendAvatarDataImmediate(sp);
278
279 // Send the appearance back to the avatar
280 // AvatarAppearance avp = sp.Appearance;
281 // sp.ControllingClient.SendAppearance(avp.Owner, avp.VisualParams, avp.Texture.GetBytes());
282
283/*
284// this needs to be fixed, the flag should be on scene presence not the region module
285 // Start the animations if necessary
286 if (!m_startAnimationSet)
287 {
288 sp.Animator.UpdateMovementAnimations();
289 m_startAnimationSet = true;
290 }
291*/
292 } 271 }
293 272
294 private void HandleAppearanceSave(UUID agentid) 273 private void HandleAppearanceSave(UUID agentid)
@@ -374,6 +353,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
374 353
375 // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); 354 // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId);
376 355
356 // operate on a copy of the appearance so we don't have to lock anything
377 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); 357 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false);
378 358
379 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) 359 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
@@ -388,9 +368,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
388 SetAppearanceAssets(sp.UUID, ref avatAppearance); 368 SetAppearanceAssets(sp.UUID, ref avatAppearance);
389 369
390 // could get fancier with the locks here, but in the spirit of "last write wins" 370 // could get fancier with the locks here, but in the spirit of "last write wins"
391 // this should work correctly 371 // this should work correctly, also, we don't need to send the appearance here
372 // since the "iswearing" will trigger a new set of visual param and baked texture changes
373 // when those complete, the new appearance will be sent
392 sp.Appearance = avatAppearance; 374 sp.Appearance = avatAppearance;
393 m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance); 375 QueueAppearanceSave(client.AgentId);
394 } 376 }
395 377
396 private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) 378 private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 81d6f70..aa7a1cd 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -925,8 +925,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
925 } 925 }
926 926
927 agent.MakeChildAgent(); 927 agent.MakeChildAgent();
928
928 // now we have a child agent in this region. Request all interesting data about other (root) agents 929 // now we have a child agent in this region. Request all interesting data about other (root) agents
929 agent.SendInitialFullUpdateToAllClients(); 930 agent.SendOtherAgentsAvatarDataToMe();
931 agent.SendOtherAgentsAppearanceToMe();
930 932
931 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); 933 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
932 934
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f3964c2..bcb715b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Framework.Scenes
398 Vector3 offset = p.GetWorldPosition() - av.ParentPosition; 398 Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
399 av.AbsolutePosition += offset; 399 av.AbsolutePosition += offset;
400 av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition 400 av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
401 av.SendFullUpdateToAllClients(); 401 av.SendAvatarDataToAllAgents();
402 } 402 }
403 } 403 }
404 } 404 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index bdd42fc..8cc2be1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -803,7 +803,7 @@ namespace OpenSim.Region.Framework.Scenes
803 { 803 {
804 Vector3 offset = (m_offsetPosition - oldpos); 804 Vector3 offset = (m_offsetPosition - oldpos);
805 av.OffsetPosition += offset; 805 av.OffsetPosition += offset;
806 av.SendFullUpdateToAllClients(); 806 av.SendAvatarDataToAllAgents();
807 } 807 }
808 } 808 }
809 } 809 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c35df08..98a3b29 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -767,7 +767,9 @@ namespace OpenSim.Region.Framework.Scenes
767 // Note: This won't send data *to* other clients in that region (children don't send) 767 // Note: This won't send data *to* other clients in that region (children don't send)
768 768
769// MIC: This gets called again in CompleteMovement 769// MIC: This gets called again in CompleteMovement
770 SendInitialFullUpdateToAllClients(); 770 // SendInitialFullUpdateToAllClients();
771 SendOtherAgentsAvatarDataToMe();
772 SendOtherAgentsAppearanceToMe();
771 773
772 RegisterToEvents(); 774 RegisterToEvents();
773 SetDirectionVectors(); 775 SetDirectionVectors();
@@ -1757,7 +1759,7 @@ namespace OpenSim.Region.Framework.Scenes
1757 { 1759 {
1758 AbsolutePosition = part.AbsolutePosition; 1760 AbsolutePosition = part.AbsolutePosition;
1759 Velocity = Vector3.Zero; 1761 Velocity = Vector3.Zero;
1760 SendFullUpdateToAllClients(); 1762 SendAvatarDataToAllAgents();
1761 1763
1762 HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); //KF ?? 1764 HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); //KF ??
1763 } 1765 }
@@ -1867,7 +1869,7 @@ namespace OpenSim.Region.Framework.Scenes
1867 m_parentID = 0; 1869 m_parentID = 0;
1868 m_linkedPrim = UUID.Zero; 1870 m_linkedPrim = UUID.Zero;
1869 m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); 1871 m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
1870 SendFullUpdateToAllClients(); 1872 SendAvatarDataToAllAgents();
1871 m_requestedSitTargetID = 0; 1873 m_requestedSitTargetID = 0;
1872 if (m_physicsActor != null && m_appearance != null) 1874 if (m_physicsActor != null && m_appearance != null)
1873 { 1875 {
@@ -2462,8 +2464,8 @@ namespace OpenSim.Region.Framework.Scenes
2462 Velocity = Vector3.Zero; 2464 Velocity = Vector3.Zero;
2463 RemoveFromPhysicalScene(); 2465 RemoveFromPhysicalScene();
2464 Animator.TrySetMovementAnimation(sitAnimation); 2466 Animator.TrySetMovementAnimation(sitAnimation);
2465 SendFullUpdateToAllClients(); 2467 SendAvatarDataToAllAgents();
2466 SendTerseUpdateToAllClients(); 2468 //SendTerseUpdateToAllClients();
2467 } 2469 }
2468 2470
2469 public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal) 2471 public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal)
@@ -2742,165 +2744,169 @@ namespace OpenSim.Region.Framework.Scenes
2742 } 2744 }
2743 2745
2744 /// <summary> 2746 /// <summary>
2745 /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) 2747 /// Do everything required once a client completes its movement into a region and becomes
2748 /// a root agent.
2746 /// </summary> 2749 /// </summary>
2747 /// <param name="remoteAvatar"></param> 2750 private void SendInitialData()
2748 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
2749 { 2751 {
2750 // 2 stage check is needed. 2752 // Moved this into CompleteMovement to ensure that m_appearance is initialized before
2751 if (remoteAvatar == null) 2753 // the inventory arrives
2752 return; 2754 // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
2753 2755
2754 IClientAPI cl = remoteAvatar.ControllingClient; 2756 // This agent just became root. We are going to tell everyone about it. The process of
2755 if (cl == null) 2757 // getting other avatars information was initiated in the constructor... don't do it
2756 return; 2758 // again here...
2759 SendAvatarDataToAllAgents();
2757 2760
2758 if (m_appearance.Texture == null) 2761 // We have an appearance but we may not have the baked textures. Check the asset cache
2759 return; 2762 // to see if all the baked textures are already here.
2760 2763 if (m_scene.AvatarFactory != null)
2761// MT: This is needed for sit. It's legal to send it to oneself, and the name 2764 {
2762// of the method is a misnomer 2765 if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient))
2763// 2766 {
2764// if (LocalId == remoteAvatar.LocalId) 2767// m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
2765// { 2768 SendAppearanceToAgent(this);
2766// m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID);
2767// return;
2768// }
2769 2769
2770 if (IsChildAgent) 2770 // If the avatars baked textures are all in the cache, then we have a
2771 // complete appearance... send it out, if not, then we'll send it when
2772 // the avatar finishes updating its appearance
2773 SendAppearanceToAllOtherAgents();
2774 }
2775 }
2776 else
2771 { 2777 {
2772 m_log.WarnFormat("[SCENEPRESENCE]: A child agent is attempting to send out avatar data; {0}", UUID); 2778 m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name);
2773 return;
2774 } 2779 }
2775
2776 remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this);
2777 m_scene.StatsReporter.AddAgentUpdates(1);
2778 } 2780 }
2779 2781
2780 /// <summary> 2782 /// <summary>
2781 /// Tell *ALL* agents about this agent 2783 /// Send this agent's avatar data to all other root and child agents in the scene
2784 /// This agent must be root. This avatar will receive its own update.
2782 /// </summary> 2785 /// </summary>
2783 public void SendInitialFullUpdateToAllClients() 2786 public void SendAvatarDataToAllAgents()
2784 { 2787 {
2785 m_perfMonMS = Util.EnvironmentTickCount(); 2788 // only send update from root agents to other clients; children are only "listening posts"
2786 int avUpdates = 0; 2789 if (IsChildAgent)
2787 m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
2788 { 2790 {
2789 ++avUpdates; 2791 m_log.Warn("[SCENEPRESENCE] attempt to send avatar data from a child agent");
2790 2792 return;
2791 // Don't update ourselves 2793 }
2792 if (avatar.LocalId == LocalId) 2794
2793 return; 2795 m_perfMonMS = Util.EnvironmentTickCount();
2794
2795 // If this is a root agent, then get info about the avatar
2796 if (!IsChildAgent)
2797 {
2798 SendFullUpdateToOtherClient(avatar);
2799 }
2800 2796
2801 // If the other avatar is a root 2797 int count = 0;
2802 if (!avatar.IsChildAgent) 2798 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
2803 { 2799 {
2804 avatar.SendFullUpdateToOtherClient(this); 2800 SendAvatarDataToAgent(scenePresence);
2805 avatar.SendAppearanceToOtherAgent(this); 2801 count++;
2806 avatar.Animator.SendAnimPackToClient(ControllingClient); 2802 });
2807 }
2808 });
2809 2803
2810 m_scene.StatsReporter.AddAgentUpdates(avUpdates); 2804 m_scene.StatsReporter.AddAgentUpdates(count);
2811 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 2805 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2812
2813 //Animator.SendAnimPack();
2814 } 2806 }
2815 2807
2816 public void SendFullUpdateToAllClients() 2808 /// <summary>
2809 /// Send avatar data for all other root agents to this agent, this agent
2810 /// can be either a child or root
2811 /// </summary>
2812 public void SendOtherAgentsAvatarDataToMe()
2817 { 2813 {
2818 m_perfMonMS = Util.EnvironmentTickCount(); 2814 m_perfMonMS = Util.EnvironmentTickCount();
2819 2815
2820 // only send update from root agents to other clients; children are only "listening posts"
2821 if (IsChildAgent)
2822 {
2823 m_log.Warn("[SCENEPRESENCE] attempt to send update from a childagent");
2824 return;
2825 }
2826
2827 int count = 0; 2816 int count = 0;
2828 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 2817 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
2829 { 2818 {
2830 if (sp.IsChildAgent) 2819 // only send information about root agents
2831 return; 2820 if (scenePresence.IsChildAgent)
2832 SendFullUpdateToOtherClient(sp); 2821 return;
2833 ++count; 2822
2834 }); 2823 // only send information about other root agents
2824 if (scenePresence.UUID == UUID)
2825 return;
2826
2827 scenePresence.SendAvatarDataToAgent(this);
2828 count++;
2829 });
2830
2835 m_scene.StatsReporter.AddAgentUpdates(count); 2831 m_scene.StatsReporter.AddAgentUpdates(count);
2836 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 2832 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2837
2838 Animator.SendAnimPack();
2839 } 2833 }
2840 2834
2841 /// <summary> 2835 /// <summary>
2842 /// Do everything required once a client completes its movement into a region 2836 /// Send avatar data to an agent.
2843 /// </summary> 2837 /// </summary>
2844 public void SendInitialData() 2838 /// <param name="avatar"></param>
2839 private void SendAvatarDataToAgent(ScenePresence avatar)
2845 { 2840 {
2846 // Moved this into CompleteMovement to ensure that m_appearance is initialized before 2841// m_log.WarnFormat("[SP] Send avatar data from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
2847 // the inventory arrives
2848 // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
2849 2842
2850 m_controllingClient.SendAvatarDataImmediate(this); 2843 avatar.ControllingClient.SendAvatarDataImmediate(this);
2851 if (m_scene.AvatarFactory != null) 2844 Animator.SendAnimPackToClient(avatar.ControllingClient);
2852 { 2845 }
2853 if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient)) 2846
2854 { 2847 /// <summary>
2855// m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); 2848 /// Send this agent's appearance to all other root and child agents in the scene
2856 m_controllingClient.SendAppearance( 2849 /// This agent must be root.
2857 m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); 2850 /// </summary>
2858 } 2851 public void SendAppearanceToAllOtherAgents()
2859 } 2852 {
2860 else 2853 // only send update from root agents to other clients; children are only "listening posts"
2854 if (IsChildAgent)
2861 { 2855 {
2862 m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name); 2856 m_log.Warn("[SCENEPRESENCE] attempt to send avatar data from a child agent");
2857 return;
2863 } 2858 }
2859
2860 m_perfMonMS = Util.EnvironmentTickCount();
2861
2862 int count = 0;
2863 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
2864 {
2865 if (scenePresence.UUID == UUID)
2866 return;
2864 2867
2865 SendInitialFullUpdateToAllClients(); 2868 SendAppearanceToAgent(scenePresence);
2869 count++;
2870 });
2871
2872 m_scene.StatsReporter.AddAgentUpdates(count);
2873 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2866 } 2874 }
2867 2875
2868 /// <summary> 2876 /// <summary>
2869 /// 2877 /// Send appearance from all other root agents to this agent. this agent
2878 /// can be either root or child
2870 /// </summary> 2879 /// </summary>
2871 public void SendAppearanceToAllOtherAgents() 2880 public void SendOtherAgentsAppearanceToMe()
2872 { 2881 {
2873// DEBUG ON
2874// m_log.WarnFormat("[SCENEPRESENCE]: Send appearance from {0} to all other agents", m_uuid);
2875// DEBUG OFF
2876 m_perfMonMS = Util.EnvironmentTickCount(); 2882 m_perfMonMS = Util.EnvironmentTickCount();
2877 2883
2884 int count = 0;
2878 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2885 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
2879 { 2886 {
2880 if (scenePresence.UUID != UUID) 2887 // only send information about root agents
2881 { 2888 if (scenePresence.IsChildAgent)
2882 SendAppearanceToOtherAgent(scenePresence); 2889 return;
2883 } 2890
2891 // only send information about other root agents
2892 if (scenePresence.UUID == UUID)
2893 return;
2894
2895 scenePresence.SendAppearanceToAgent(this);
2896 count++;
2884 }); 2897 });
2885 2898
2899 m_scene.StatsReporter.AddAgentUpdates(count);
2886 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 2900 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2887 } 2901 }
2888 2902
2889 /// <summary> 2903 /// <summary>
2890 /// Send appearance data to an agent that isn't this one. 2904 /// Send appearance data to an agent.
2891 /// </summary> 2905 /// </summary>
2892 /// <param name="avatar"></param> 2906 /// <param name="avatar"></param>
2893 public void SendAppearanceToOtherAgent(ScenePresence avatar) 2907 private void SendAppearanceToAgent(ScenePresence avatar)
2894 { 2908 {
2895 if (LocalId == avatar.LocalId)
2896 {
2897 m_log.WarnFormat("[SCENE PRESENCE]: An agent is attempting to send appearance data to itself; {0}", UUID);
2898 return;
2899 }
2900
2901// DEBUG ON
2902// m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); 2909// m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
2903// DEBUG OFF
2904 2910
2905 avatar.ControllingClient.SendAppearance( 2911 avatar.ControllingClient.SendAppearance(
2906 m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); 2912 m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
@@ -3413,9 +3419,6 @@ namespace OpenSim.Region.Framework.Scenes
3413 3419
3414 public void CopyFrom(AgentData cAgent) 3420 public void CopyFrom(AgentData cAgent)
3415 { 3421 {
3416// DEBUG ON
3417 m_log.ErrorFormat("[SCENEPRESENCE] CALLING COPYFROM");
3418// DEBUG OFF
3419 m_originRegionID = cAgent.RegionID; 3422 m_originRegionID = cAgent.RegionID;
3420 3423
3421 m_callbackURI = cAgent.CallbackURI; 3424 m_callbackURI = cAgent.CallbackURI;
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index 0c8113e..ccf5289 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -1173,10 +1173,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1173 presence = scene.GetScenePresence(AgentID); 1173 presence = scene.GetScenePresence(AgentID);
1174 if (presence != null) 1174 if (presence != null)
1175 { 1175 {
1176 presence.Grouptitle = Title; 1176 if (presence.Grouptitle != Title)
1177 {
1178 presence.Grouptitle = Title;
1177 1179
1178 // FixMe: Ter suggests a "Schedule" method that I can't find. 1180 if (! presence.IsChildAgent)
1179 presence.SendFullUpdateToAllClients(); 1181 presence.SendAvatarDataToAllAgents();
1182 }
1180 } 1183 }
1181 } 1184 }
1182 } 1185 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 7e9224d..1dd4ca4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4007,6 +4007,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4007 { 4007 {
4008 linknum -= (m_host.ParentGroup.PrimCount) + 1; 4008 linknum -= (m_host.ParentGroup.PrimCount) + 1;
4009 4009
4010 if (linknum < 0)
4011 return UUID.Zero.ToString();
4012
4010 List<ScenePresence> avatars = GetLinkAvatars(ScriptBaseClass.LINK_SET); 4013 List<ScenePresence> avatars = GetLinkAvatars(ScriptBaseClass.LINK_SET);
4011 if (avatars.Count > linknum) 4014 if (avatars.Count > linknum)
4012 { 4015 {
@@ -6753,7 +6756,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6753 } 6756 }
6754 if (buttons.Data[i].ToString().Length > 24) 6757 if (buttons.Data[i].ToString().Length > 24)
6755 { 6758 {
6756 LSLError("button label cannot be longer than 24 characters"); 6759 llWhisper(ScriptBaseClass.DEBUG_CHANNEL, "button label cannot be longer than 24 characters");
6757 return; 6760 return;
6758 } 6761 }
6759 buts[i] = buttons.Data[i].ToString(); 6762 buts[i] = buttons.Data[i].ToString();
@@ -7316,7 +7319,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7316 LSL_Vector v; 7319 LSL_Vector v;
7317 v = rules.GetVector3Item(idx++); 7320 v = rules.GetVector3Item(idx++);
7318 av.OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z); 7321 av.OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z);
7319 av.SendFullUpdateToAllClients(); 7322 av.SendAvatarDataToAllAgents();
7320 7323
7321 break; 7324 break;
7322 7325
@@ -7326,7 +7329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7326 LSL_Rotation r; 7329 LSL_Rotation r;
7327 r = rules.GetQuaternionItem(idx++); 7330 r = rules.GetQuaternionItem(idx++);
7328 av.OffsetRotation = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); 7331 av.OffsetRotation = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s);
7329 av.SendFullUpdateToAllClients(); 7332 av.SendAvatarDataToAllAgents();
7330 break; 7333 break;
7331 } 7334 }
7332 } 7335 }