aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs29
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs53
2 files changed, 38 insertions, 44 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fd20c60..3835047 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2978,35 +2978,6 @@ namespace OpenSim.Region.Framework.Scenes
2978 m_eventManager.TriggerOnNewPresence(sp); 2978 m_eventManager.TriggerOnNewPresence(sp);
2979 2979
2980 sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags; 2980 sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags;
2981
2982 // The first agent upon login is a root agent by design.
2983 // For this agent we will have to rez the attachments.
2984 // All other AddNewClient calls find aCircuit.child to be true.
2985 if (aCircuit.child == false)
2986 {
2987 // We have to set SP to be a root agent here so that SP.MakeRootAgent() will later not try to
2988 // start the scripts again (since this is done in RezAttachments()).
2989 // XXX: This is convoluted.
2990 sp.IsChildAgent = false;
2991 sp.IsLoggingIn = true;
2992
2993 // We leave a 5 second pause before attempting to rez attachments to avoid a clash with
2994 // version 3 viewers that maybe doing their own attachment rezzing related to their current
2995 // outfit folder on startup. If these operations do clash, then the symptoms are invisible
2996 // attachments until one zooms in on the avatar.
2997 //
2998 // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly
2999 // delaying any attachment related regression tests.
3000 if (AttachmentsModule != null)
3001 Util.FireAndForget(
3002 o =>
3003 {
3004 if (Util.FireAndForgetMethod != FireAndForgetMethod.None)
3005 Thread.Sleep(5000);
3006
3007 AttachmentsModule.RezAttachments(sp);
3008 });
3009 }
3010 } 2981 }
3011 else 2982 else
3012 { 2983 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 322afd2..300ddb3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -941,8 +941,6 @@ namespace OpenSim.Region.Framework.Scenes
941 "[SCENE]: Upgrading child to root agent for {0} in {1}", 941 "[SCENE]: Upgrading child to root agent for {0} in {1}",
942 Name, m_scene.RegionInfo.RegionName); 942 Name, m_scene.RegionInfo.RegionName);
943 943
944 bool wasChild = IsChildAgent;
945
946 if (ParentUUID != UUID.Zero) 944 if (ParentUUID != UUID.Zero)
947 { 945 {
948 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID); 946 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID);
@@ -975,6 +973,9 @@ namespace OpenSim.Region.Framework.Scenes
975 IsLoggingIn = false; 973 IsLoggingIn = false;
976 } 974 }
977 975
976 //m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
977
978 IsChildAgent = false;
978 979
979 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 980 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
980 if (gm != null) 981 if (gm != null)
@@ -1095,22 +1096,44 @@ namespace OpenSim.Region.Framework.Scenes
1095 // and it has already rezzed the attachments and started their scripts. 1096 // and it has already rezzed the attachments and started their scripts.
1096 // We do the following only for non-login agents, because their scripts 1097 // We do the following only for non-login agents, because their scripts
1097 // haven't started yet. 1098 // haven't started yet.
1098 lock (m_attachments) 1099 if ((TeleportFlags & TeleportFlags.ViaLogin) != 0)
1100 {
1101 // We leave a 5 second pause before attempting to rez attachments to avoid a clash with
1102 // version 3 viewers that maybe doing their own attachment rezzing related to their current
1103 // outfit folder on startup. If these operations do clash, then the symptoms are invisible
1104 // attachments until one zooms in on the avatar.
1105 //
1106 // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly
1107 // delaying any attachment related regression tests.
1108 if (Scene.AttachmentsModule != null)
1109 Util.FireAndForget(
1110 o =>
1111 {
1112 if (Util.FireAndForgetMethod != FireAndForgetMethod.None)
1113 System.Threading.Thread.Sleep(5000);
1114
1115 Scene.AttachmentsModule.RezAttachments(this);
1116 });
1117 }
1118 else
1099 { 1119 {
1100 if (wasChild && HasAttachments()) 1120 lock (m_attachments)
1101 { 1121 {
1102 m_log.DebugFormat( 1122 if (HasAttachments())
1103 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); 1123 {
1124 m_log.DebugFormat(
1125 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
1104 1126
1105 // Resume scripts 1127 // Resume scripts
1106 Util.FireAndForget(delegate(object x) { 1128 Util.FireAndForget(delegate(object x) {
1107 foreach (SceneObjectGroup sog in m_attachments) 1129 foreach (SceneObjectGroup sog in m_attachments)
1108 { 1130 {
1109 sog.ScheduleGroupForFullUpdate(); 1131 sog.ScheduleGroupForFullUpdate();
1110 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); 1132 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
1111 sog.ResumeScripts(); 1133 sog.ResumeScripts();
1112 } 1134 }
1113 }); 1135 });
1136 }
1114 } 1137 }
1115 } 1138 }
1116 1139