Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.csavinationmerge
commit
0c1074537b
|
@ -314,6 +314,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
// ~SceneObjectPart()
|
||||
// {
|
||||
// Console.WriteLine(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
[TestFixture]
|
||||
public class SceneObjectBasicTests
|
||||
{
|
||||
// [TearDown]
|
||||
// public void TearDown()
|
||||
// {
|
||||
// Console.WriteLine("TearDown");
|
||||
// GC.Collect();
|
||||
// Thread.Sleep(3000);
|
||||
// }
|
||||
|
||||
// public class GcNotify
|
||||
// {
|
||||
// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
|
||||
// private static bool _initialized = false;
|
||||
//
|
||||
// public static void Initialize()
|
||||
// {
|
||||
// if (!_initialized)
|
||||
// {
|
||||
// _initialized = true;
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private GcNotify(){}
|
||||
//
|
||||
// ~GcNotify()
|
||||
// {
|
||||
// if (!Environment.HasShutdownStarted &&
|
||||
// !AppDomain.CurrentDomain.IsFinalizingForUnload())
|
||||
// {
|
||||
// Console.WriteLine("GcNotify called");
|
||||
// gcEvent.Set();
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Test adding an object to a scene.
|
||||
/// </summary>
|
||||
|
|
|
@ -121,8 +121,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
|||
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[NPC MODULE]: Creating NPC {0} {1} {2} at {3} in {4}",
|
||||
firstname, lastname, npcAvatar.AgentId, position, scene.RegionInfo.RegionName);
|
||||
"[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
|
||||
firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
|
||||
|
||||
AgentCircuitData acd = new AgentCircuitData();
|
||||
acd.AgentID = npcAvatar.AgentId;
|
||||
|
|
|
@ -2254,7 +2254,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
firstname, lastname, position, notecard,
|
||||
(options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
|
||||
false);
|
||||
// (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0);
|
||||
// (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) != 0);
|
||||
}
|
||||
|
||||
private LSL_Key NpcCreate(
|
||||
|
|
|
@ -31,7 +31,6 @@ using System.Collections.Generic;
|
|||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using log4net;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
|
@ -41,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
|||
{
|
||||
public class SensorRepeat
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public AsyncCommandManager m_CmdManager;
|
||||
|
||||
public SensorRepeat(AsyncCommandManager CmdManager)
|
||||
|
@ -452,12 +453,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
|||
|
||||
Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence =>
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}",
|
||||
// presence.Name, presence.PresenceType, ts.name, ts.type);
|
||||
|
||||
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
|
||||
{
|
||||
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
|
||||
if (npcData == null || !npcData.SenseAsAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}",
|
||||
// presence.Name, ts.itemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ts.type & AGENT) == 0)
|
||||
{
|
||||
|
@ -469,9 +479,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
|||
{
|
||||
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
|
||||
if (npcData != null && npcData.SenseAsAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}",
|
||||
// presence.Name, ts.itemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0)
|
||||
return;
|
||||
|
|
|
@ -50,7 +50,8 @@ namespace OpenSim.Tests.Common.Mock
|
|||
|
||||
~TestScene()
|
||||
{
|
||||
Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
|
||||
//Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
|
||||
Console.WriteLine("TestScene destructor called");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture
|
|||
[TestFixture]
|
||||
public class ObjectTortureTests
|
||||
{
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
}
|
||||
|
||||
// [Test]
|
||||
// public void Test0000Clean()
|
||||
// {
|
||||
|
@ -141,8 +148,18 @@ namespace OpenSim.Tests.Torture
|
|||
string.Format("Object {0} could not be retrieved", i));
|
||||
}
|
||||
|
||||
// This does not work to fire the SceneObjectGroup destructors - something else is hanging on to them.
|
||||
// scene.DeleteAllSceneObjects();
|
||||
// When a scene object is added to a scene, it is placed in the update list for sending to viewers
|
||||
// (though in this case we have none). When it is deleted, it is not removed from the update which is
|
||||
// fine since it will later be ignored.
|
||||
//
|
||||
// However, that means that we need to manually run an update here to clear out that list so that deleted
|
||||
// objects will be clean up by the garbage collector before the next stress test is run.
|
||||
scene.Update();
|
||||
|
||||
// Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
|
||||
// However, what we really need to do is find out why the entire scene is not garbage collected in
|
||||
// teardown.
|
||||
scene.DeleteAllSceneObjects();
|
||||
|
||||
Console.WriteLine(
|
||||
"Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
|
||||
|
|
Loading…
Reference in New Issue