Merge commit '23ae4c0a4d813763bcc39db7693850a21727d7f2' into careminster

Conflicts:
	OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
avinationmerge
Melanie 2013-03-29 02:42:47 +00:00
commit f2f8248178
3 changed files with 33 additions and 1 deletions

View File

@ -2862,6 +2862,9 @@ namespace OpenSim.Region.Framework.Scenes
RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
// We must currently not resume scripts at this stage since AttachmentsModule does not have the
// information that this is due to a teleport/border cross rather than an ordinary attachment.
// We currently do this in Scene.MakeRootAgent() instead.
if (AttachmentsModule != null) if (AttachmentsModule != null)
AttachmentsModule.AttachObject(sp, grp, 0, false, false, false, true); AttachmentsModule.AttachObject(sp, grp, 0, false, false, false, true);
} }

View File

@ -3743,6 +3743,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="events"></param> /// <param name="events"></param>
public void SetScriptEvents(UUID scriptid, int events) public void SetScriptEvents(UUID scriptid, int events)
{ {
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Set script events for script with id {0} on {1}/{2} to {3} in {4}",
// scriptid, Name, ParentGroup.Name, events, ParentGroup.Scene.Name);
// scriptEvents oldparts; // scriptEvents oldparts;
lock (m_scriptEvents) lock (m_scriptEvents)
{ {

View File

@ -1113,6 +1113,31 @@ namespace OpenSim.Region.Framework.Scenes
Scene.AttachmentsModule.RezAttachments(this); Scene.AttachmentsModule.RezAttachments(this);
}); });
} }
else
{
// We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT
// and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
// be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are
// not transporting the required data.
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();
}
});
}
}
}
SendAvatarDataToAllAgents(); SendAvatarDataToAllAgents();