aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs32
1 files changed, 13 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index ccc4be7..6f6e0cb 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -703,28 +703,27 @@ namespace OpenSim.Region.Environment.Scenes
703 /// </summary> 703 /// </summary>
704 public void MakeRootAgent(Vector3 pos, bool isFlying) 704 public void MakeRootAgent(Vector3 pos, bool isFlying)
705 { 705 {
706 m_log.DebugFormat(
707 "[SCENE]: Upgrading child to root agent for {0} in {1}",
708 Name, m_scene.RegionInfo.RegionName);
709
706 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 710 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
707 if (gm != null) 711 if (gm != null)
708 m_grouptitle = gm.GetGroupTitle(m_uuid); 712 m_grouptitle = gm.GetGroupTitle(m_uuid);
709 713
710 m_scene.SetRootAgentScene(m_uuid); 714 m_scene.SetRootAgentScene(m_uuid);
711 715
712 IAvatarFactory ava = m_scene.RequestModuleInterface<IAvatarFactory>(); 716 // Moved this from SendInitialData to ensure that m_appearance is initialized
713 if (ava != null) 717 // before the inventory is processed in MakeRootAgent. This fixes a race condition
714 { 718 // related to the handling of attachments
715 ava.TryGetAvatarAppearance(m_uuid, out m_appearance); 719 m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
716 }
717
718 m_log.DebugFormat(
719 "[SCENE]: Upgrading child to root agent for {0} in {1}",
720 Name, m_scene.RegionInfo.RegionName);
721 720
722 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0) 721 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0)
723 { 722 {
724 Vector3 emergencyPos = new Vector3(128, 128, 128); 723 Vector3 emergencyPos = new Vector3(128, 128, 128);
725 724
726 m_log.WarnFormat( 725 m_log.WarnFormat(
727 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 726 "[SCENE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
728 pos, Name, UUID, emergencyPos); 727 pos, Name, UUID, emergencyPos);
729 728
730 pos = emergencyPos; 729 pos = emergencyPos;
@@ -892,11 +891,6 @@ namespace OpenSim.Region.Environment.Scenes
892 891
893 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); 892 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
894 893
895 // Moved this from SendInitialData to ensure that m_appearance is initialized
896 // before the inventory is processed in MakeRootAgent. This fixes a race condition
897 // related to the handling of attachments
898 m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
899
900 if (m_isChildAgent) 894 if (m_isChildAgent)
901 { 895 {
902 m_isChildAgent = false; 896 m_isChildAgent = false;
@@ -1854,7 +1848,7 @@ namespace OpenSim.Region.Environment.Scenes
1854 /// <param name="client"></param> 1848 /// <param name="client"></param>
1855 public void SendOwnAppearance() 1849 public void SendOwnAppearance()
1856 { 1850 {
1857 m_log.Info("[APPEARANCE] Sending Own Appearance"); 1851 m_log.Info("[APPEARANCE]: Sending Own Appearance");
1858 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); 1852 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
1859 // ControllingClient.SendAppearance( 1853 // ControllingClient.SendAppearance(
1860 // m_appearance.Owner, 1854 // m_appearance.Owner,
@@ -1868,7 +1862,7 @@ namespace OpenSim.Region.Environment.Scenes
1868 /// </summary> 1862 /// </summary>
1869 public void SendAppearanceToAllOtherAgents() 1863 public void SendAppearanceToAllOtherAgents()
1870 { 1864 {
1871 m_log.Info("[APPEARANCE] Sending Appearance to All Other Agents"); 1865 m_log.Info("[APPEARANCE]: Sending Appearance to All Other Agents");
1872 m_perfMonMS=System.Environment.TickCount; 1866 m_perfMonMS=System.Environment.TickCount;
1873 1867
1874 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 1868 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
@@ -1892,7 +1886,7 @@ namespace OpenSim.Region.Environment.Scenes
1892 1886
1893 public void SetAppearance(byte[] texture, List<byte> visualParam) 1887 public void SetAppearance(byte[] texture, List<byte> visualParam)
1894 { 1888 {
1895 m_log.Info("[APPEARANCE] Setting Appearance"); 1889 m_log.Info("[APPEARANCE]: Setting Appearance");
1896 m_appearance.SetAppearance(texture, visualParam); 1890 m_appearance.SetAppearance(texture, visualParam);
1897 SetHeight(m_appearance.AvatarHeight); 1891 SetHeight(m_appearance.AvatarHeight);
1898 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); 1892 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
@@ -1903,7 +1897,7 @@ namespace OpenSim.Region.Environment.Scenes
1903 1897
1904 public void SetWearable(int wearableId, AvatarWearable wearable) 1898 public void SetWearable(int wearableId, AvatarWearable wearable)
1905 { 1899 {
1906 m_log.Info("[APPEARANCE] Setting Wearable"); 1900 m_log.Info("[APPEARANCE]: Setting Wearable");
1907 m_appearance.SetWearable(wearableId, wearable); 1901 m_appearance.SetWearable(wearableId, wearable);
1908 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); 1902 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
1909 m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); 1903 m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);