Merge commit 'c2093ccce16cd5210c8e0759f23b5b4bd205b7af' into careminster

Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
avinationmerge
Melanie 2013-03-29 01:50:34 +00:00
commit 120903efb6
3 changed files with 39 additions and 45 deletions

View File

@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
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);
XmlDocument doc = new XmlDocument();
string stateData = String.Empty;

View File

@ -2978,35 +2978,6 @@ namespace OpenSim.Region.Framework.Scenes
m_eventManager.TriggerOnNewPresence(sp);
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;
sp.IsLoggingIn = true;
// 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
{

View File

@ -941,8 +941,6 @@ namespace OpenSim.Region.Framework.Scenes
"[SCENE]: Upgrading child to root agent for {0} in {1}",
Name, m_scene.RegionInfo.RegionName);
bool wasChild = IsChildAgent;
if (ParentUUID != UUID.Zero)
{
m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID);
@ -975,6 +973,9 @@ namespace OpenSim.Region.Framework.Scenes
IsLoggingIn = false;
}
//m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
IsChildAgent = false;
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null)
@ -1095,22 +1096,44 @@ namespace OpenSim.Region.Framework.Scenes
// and it has already rezzed the attachments and started their scripts.
// We do the following only for non-login agents, because their scripts
// haven't started yet.
lock (m_attachments)
if ((TeleportFlags & TeleportFlags.ViaLogin) != 0)
{
if (wasChild && HasAttachments())
{
m_log.DebugFormat(
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
// Resume scripts
Util.FireAndForget(delegate(object x) {
foreach (SceneObjectGroup sog in m_attachments)
// 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 =>
{
sog.ScheduleGroupForFullUpdate();
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
sog.ResumeScripts();
}
});
if (Util.FireAndForgetMethod != FireAndForgetMethod.None)
System.Threading.Thread.Sleep(5000);
Scene.AttachmentsModule.RezAttachments(this);
});
}
else
{
lock (m_attachments)
{
if (HasAttachments())
{
m_log.DebugFormat(
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
// Resume scripts
Util.FireAndForget(delegate(object x) {
foreach (SceneObjectGroup sog in m_attachments)
{
sog.ScheduleGroupForFullUpdate();
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
sog.ResumeScripts();
}
});
}
}
}