Push more NPC stuff into threads

This commit is contained in:
Melanie
2012-02-08 13:04:23 +01:00
parent 236e1c45f2
commit 9c6ba8d18f
2 changed files with 41 additions and 24 deletions

View File

@@ -2584,18 +2584,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.High, "osNpcRemove");
m_host.AddScriptLPS(1);
ManualResetEvent ev = new ManualResetEvent(false);
Util.FireAndForget(delegate(object x) {
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
try
{
UUID npcId = new UUID(npc.m_string);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
module.DeleteNPC(npcId, World);
});
}
module.DeleteNPC(npcId, World);
}
}
finally
{
ev.Set();
}
});
ev.WaitOne();
}
public void osNpcPlayAnimation(LSL_Key npc, string animation)