aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-03-28 22:07:58 +0000
committerJustin Clark-Casey (justincc)2013-03-28 22:07:58 +0000
commitc2093ccce16cd5210c8e0759f23b5b4bd205b7af (patch)
tree907cb903d1fae01a00e9dbb535aaadf230719428 /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentAdd back a log message when we attempt a megaregion auto-reteleport (diff)
downloadopensim-SC_OLD-c2093ccce16cd5210c8e0759f23b5b4bd205b7af.zip
opensim-SC_OLD-c2093ccce16cd5210c8e0759f23b5b4bd205b7af.tar.gz
opensim-SC_OLD-c2093ccce16cd5210c8e0759f23b5b4bd205b7af.tar.bz2
opensim-SC_OLD-c2093ccce16cd5210c8e0759f23b5b4bd205b7af.tar.xz
Move the simulator-side RezAttachments call on login to SP.MakeRootAgent with the other attachments code, using TeleportFlags.ViaLogin check to fire if necessary.
This is to simplify the code (no tricky 'wasChild' signalling required) and to reduce the risk of a thread clash between simulator-side attaching (necessary for v1 viewers) and the viewer-side attaching the v3 viewers perform.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs41
1 files changed, 31 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f3b923f..4fb9a1b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -866,7 +866,6 @@ namespace OpenSim.Region.Framework.Scenes
866 866
867 //m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count); 867 //m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
868 868
869 bool wasChild = IsChildAgent;
870 IsChildAgent = false; 869 IsChildAgent = false;
871 870
872 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 871 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
@@ -952,18 +951,40 @@ namespace OpenSim.Region.Framework.Scenes
952 // and it has already rezzed the attachments and started their scripts. 951 // and it has already rezzed the attachments and started their scripts.
953 // We do the following only for non-login agents, because their scripts 952 // We do the following only for non-login agents, because their scripts
954 // haven't started yet. 953 // haven't started yet.
955 lock (m_attachments) 954 if ((TeleportFlags & TeleportFlags.ViaLogin) != 0)
955 {
956 // We leave a 5 second pause before attempting to rez attachments to avoid a clash with
957 // version 3 viewers that maybe doing their own attachment rezzing related to their current
958 // outfit folder on startup. If these operations do clash, then the symptoms are invisible
959 // attachments until one zooms in on the avatar.
960 //
961 // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly
962 // delaying any attachment related regression tests.
963 if (Scene.AttachmentsModule != null)
964 Util.FireAndForget(
965 o =>
966 {
967 if (Util.FireAndForgetMethod != FireAndForgetMethod.None)
968 System.Threading.Thread.Sleep(5000);
969
970 Scene.AttachmentsModule.RezAttachments(this);
971 });
972 }
973 else
956 { 974 {
957 if (wasChild && HasAttachments()) 975 lock (m_attachments)
958 { 976 {
959 m_log.DebugFormat( 977 if (HasAttachments())
960 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
961
962 // Resume scripts
963 foreach (SceneObjectGroup sog in m_attachments)
964 { 978 {
965 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); 979 m_log.DebugFormat(
966 sog.ResumeScripts(); 980 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
981
982 // Resume scripts
983 foreach (SceneObjectGroup sog in m_attachments)
984 {
985 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
986 sog.ResumeScripts();
987 }
967 } 988 }
968 } 989 }
969 } 990 }