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.user_profiles
parent
9ca54d00d8
commit
c2093ccce1
|
@ -197,7 +197,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0}", sp.Name);
|
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0} from simulator-side", sp.Name);
|
||||||
|
|
||||||
List<AvatarAttachment> attachments = sp.Appearance.GetAttachments();
|
List<AvatarAttachment> attachments = sp.Appearance.GetAttachments();
|
||||||
foreach (AvatarAttachment attach in attachments)
|
foreach (AvatarAttachment attach in attachments)
|
||||||
|
|
|
@ -2820,34 +2820,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_eventManager.TriggerOnNewPresence(sp);
|
m_eventManager.TriggerOnNewPresence(sp);
|
||||||
|
|
||||||
sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags;
|
sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags;
|
||||||
|
|
||||||
// The first agent upon login is a root agent by design.
|
|
||||||
// For this agent we will have to rez the attachments.
|
|
||||||
// All other AddNewClient calls find aCircuit.child to be true.
|
|
||||||
if (aCircuit.child == false)
|
|
||||||
{
|
|
||||||
// We have to set SP to be a root agent here so that SP.MakeRootAgent() will later not try to
|
|
||||||
// start the scripts again (since this is done in RezAttachments()).
|
|
||||||
// XXX: This is convoluted.
|
|
||||||
sp.IsChildAgent = false;
|
|
||||||
|
|
||||||
// We leave a 5 second pause before attempting to rez attachments to avoid a clash with
|
|
||||||
// version 3 viewers that maybe doing their own attachment rezzing related to their current
|
|
||||||
// outfit folder on startup. If these operations do clash, then the symptoms are invisible
|
|
||||||
// attachments until one zooms in on the avatar.
|
|
||||||
//
|
|
||||||
// We do not pause if we are launching on the same thread anyway in order to avoid pointlessly
|
|
||||||
// delaying any attachment related regression tests.
|
|
||||||
if (AttachmentsModule != null)
|
|
||||||
Util.FireAndForget(
|
|
||||||
o =>
|
|
||||||
{
|
|
||||||
if (Util.FireAndForgetMethod != FireAndForgetMethod.None)
|
|
||||||
Thread.Sleep(5000);
|
|
||||||
|
|
||||||
AttachmentsModule.RezAttachments(sp);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -866,7 +866,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
//m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
|
//m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
|
||||||
|
|
||||||
bool wasChild = IsChildAgent;
|
|
||||||
IsChildAgent = false;
|
IsChildAgent = false;
|
||||||
|
|
||||||
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
|
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||||
|
@ -952,9 +951,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// and it has already rezzed the attachments and started their scripts.
|
// and it has already rezzed the attachments and started their scripts.
|
||||||
// We do the following only for non-login agents, because their scripts
|
// We do the following only for non-login agents, because their scripts
|
||||||
// haven't started yet.
|
// haven't started yet.
|
||||||
|
if ((TeleportFlags & TeleportFlags.ViaLogin) != 0)
|
||||||
|
{
|
||||||
|
// We leave a 5 second pause before attempting to rez attachments to avoid a clash with
|
||||||
|
// version 3 viewers that maybe doing their own attachment rezzing related to their current
|
||||||
|
// outfit folder on startup. If these operations do clash, then the symptoms are invisible
|
||||||
|
// attachments until one zooms in on the avatar.
|
||||||
|
//
|
||||||
|
// We do not pause if we are launching on the same thread anyway in order to avoid pointlessly
|
||||||
|
// delaying any attachment related regression tests.
|
||||||
|
if (Scene.AttachmentsModule != null)
|
||||||
|
Util.FireAndForget(
|
||||||
|
o =>
|
||||||
|
{
|
||||||
|
if (Util.FireAndForgetMethod != FireAndForgetMethod.None)
|
||||||
|
System.Threading.Thread.Sleep(5000);
|
||||||
|
|
||||||
|
Scene.AttachmentsModule.RezAttachments(this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
lock (m_attachments)
|
lock (m_attachments)
|
||||||
{
|
{
|
||||||
if (wasChild && HasAttachments())
|
if (HasAttachments())
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
||||||
|
@ -967,6 +987,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// send the animations of the other presences to me
|
// send the animations of the other presences to me
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
|
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
|
||||||
|
|
Loading…
Reference in New Issue