aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs80
1 files changed, 43 insertions, 37 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 9b6e58d..122a64f 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -248,8 +248,8 @@ namespace OpenSim.Region.Environment.Scenes
248 Animations.LoadAnims(); 248 Animations.LoadAnims();
249 249
250 //register for events 250 //register for events
251 m_controllingClient.OnRequestWearables += SendAppearance; 251 m_controllingClient.OnRequestWearables += SendOurAppearance;
252 m_controllingClient.OnSetAppearance += SetAppearance; 252 m_controllingClient.OnSetAppearance += new SetAppearance(SetAppearance);
253 m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; 253 m_controllingClient.OnCompleteMovementToRegion += CompleteMovement;
254 m_controllingClient.OnCompleteMovementToRegion += SendInitialData; 254 m_controllingClient.OnCompleteMovementToRegion += SendInitialData;
255 m_controllingClient.OnAgentUpdate += HandleAgentUpdate; 255 m_controllingClient.OnAgentUpdate += HandleAgentUpdate;
@@ -412,7 +412,7 @@ namespace OpenSim.Region.Environment.Scenes
412 m_visualParams[i] = visualParam[i].ParamValue; 412 m_visualParams[i] = visualParam[i].ParamValue;
413 } 413 }
414 414
415 SendAppearanceToAllOtherClients(); 415 SendAppearanceToAllOtherAgents();
416 } 416 }
417 417
418 /// <summary> 418 /// <summary>
@@ -707,19 +707,16 @@ namespace OpenSim.Region.Environment.Scenes
707 707
708 public void SendFullUpdateToAllClients() 708 public void SendFullUpdateToAllClients()
709 { 709 {
710 List<ScenePresence> agents = m_scene.GetScenePresences(); 710 List<ScenePresence> avatars = m_scene.GetScenePresences();
711 foreach (ScenePresence agent in agents) 711 foreach (ScenePresence avatar in avatars)
712 { 712 {
713 IClientAPI client = agent.ControllingClient; 713 SendFullUpdateToOtherClient(avatar);
714 client.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, 714 if (avatar.LocalId != LocalId)
715 LocalId, AbsolutePosition, m_textureEntry.ToBytes(), m_parentID );
716
717 if (agent.LocalId != LocalId)
718 { 715 {
719 if (!agent.m_isChildAgent) 716 if (!avatar.m_isChildAgent)
720 { 717 {
721 client.SendAppearance(m_controllingClient.AgentId, m_visualParams, 718 avatar.SendFullUpdateToOtherClient(this);
722 m_textureEntry.ToBytes()); 719 avatar.SendAppearanceToOtherAgent(this);
723 } 720 }
724 } 721 }
725 } 722 }
@@ -739,28 +736,22 @@ namespace OpenSim.Region.Environment.Scenes
739 } 736 }
740 737
741 SendFullUpdateToAllClients(); 738 SendFullUpdateToAllClients();
742 SendAppearanceToAllOtherClients(); 739 SendAppearanceToAllOtherAgents();
743 } 740 }
744 741
745 public void SetWearable( int wearableId, AvatarWearable wearable ) 742 /// <summary>
746 { 743 ///
747 m_wearables[wearableId] = wearable; 744 /// </summary>
748 745 /// <param name="client"></param>
749 m_scene.ForEachClient( delegate( IClientAPI client ) 746 public void SendOurAppearance(IClientAPI client)
750 {
751 SendAppearance( client );
752 });
753 }
754
755 public void SendAppearance(IClientAPI client)
756 { 747 {
757 client.SendWearables(m_wearables); 748 client.SendWearables(m_wearables);
758 749
759 //this.SendFullUpdateToAllClients(); 750 //this.SendFullUpdateToAllClients();
760 //this.SendAppearanceToAllOtherClients(); 751 //this.SendAppearanceToAllOtherAgents();
761 752
762 m_scene.SendAllSceneObjectsToClient(this); 753 m_scene.SendAllSceneObjectsToClient(this);
763 client.SendViewerTime(m_scene.TimePhase); 754 m_controllingClient.SendViewerTime(m_scene.TimePhase);
764 755
765 //Please don't remove the following code (at least not yet), just leave it commented out 756 //Please don't remove the following code (at least not yet), just leave it commented out
766 //gives the user god powers, should help with debuging things in the future 757 //gives the user god powers, should help with debuging things in the future
@@ -776,16 +767,25 @@ namespace OpenSim.Region.Environment.Scenes
776 /// <summary> 767 /// <summary>
777 /// 768 ///
778 /// </summary> 769 /// </summary>
779 public void SendAppearanceToAllOtherClients() 770 public void SendAppearanceToAllOtherAgents()
780 { 771 {
781 m_scene.ForEachClient(delegate(IClientAPI client) 772 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
782 { 773 {
783 if( client != m_controllingClient ) 774 if (scenePresence != this)
784 { 775 {
785 client.SendAppearance(m_controllingClient.AgentId, m_visualParams, 776 SendAppearanceToOtherAgent(scenePresence);
786 m_textureEntry.ToBytes() ); 777 }
787 } 778 });
788 }); 779 }
780
781 /// <summary>
782 ///
783 /// </summary>
784 /// <param name="avatarInfo"></param>
785 public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
786 {
787 avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams,
788 m_textureEntry.ToBytes());
789 } 789 }
790 790
791 /// <summary> 791 /// <summary>
@@ -1005,5 +1005,11 @@ namespace OpenSim.Region.Environment.Scenes
1005 { 1005 {
1006 RemoveFromPhysicalScene(); 1006 RemoveFromPhysicalScene();
1007 } 1007 }
1008
1009 public void SetWearable(int wearableId, AvatarWearable wearable)
1010 {
1011 m_wearables[wearableId] = wearable;
1012 SendOurAppearance( m_controllingClient );
1013 }
1008 } 1014 }
1009} 1015}