From 7a2a2e68e7e235b9d79c09d98a4cf0b6f87a2a85 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 14 Aug 2009 14:18:56 +0100 Subject: Remove the script sponsor logic because scripts are timing out again. This needs to be looked into. This commit, unfortunately, reinstates a memory leak in regions that see significant script fluctuation, e.g. lots of scripted attachments, or script development. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 +++--- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 +++--- .../Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 15 ++++++++------- .../Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 7 +------ 4 files changed, 15 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ff85b96..691732a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -125,9 +125,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (lease.CurrentState == LeaseState.Initial) { - lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); - lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); - lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); + lease.InitialLeaseTime = TimeSpan.FromMinutes(0); +// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); +// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); } return lease; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6539bda..6e3a3ab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -166,9 +166,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (lease.CurrentState == LeaseState.Initial) { - lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); - lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); - lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); + lease.InitialLeaseTime = TimeSpan.FromMinutes(0); +// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); +// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); } return lease; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index d119a77..838cafb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -42,16 +42,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public partial class ScriptBaseClass : MarshalByRefObject, IScript { private Dictionary inits = new Dictionary(); - private ScriptSponsor m_sponser; +// private ScriptSponsor m_sponser; public override Object InitializeLifetimeService() { ILease lease = (ILease)base.InitializeLifetimeService(); if (lease.CurrentState == LeaseState.Initial) { - lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); - lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); - lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); + // Infinite + lease.InitialLeaseTime = TimeSpan.FromMinutes(0); +// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); +// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); } return lease; } @@ -79,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase } } - m_sponser = new ScriptSponsor(); +// m_sponser = new ScriptSponsor(); } private Executor m_Executor = null; @@ -112,7 +113,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return; ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject); - lease.Register(m_sponser); +// lease.Register(m_sponser); MethodInfo mi = inits[api]; @@ -126,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public void Close() { - m_sponser.Close(); +// m_sponser.Close(); } public Dictionary GetVars() diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 4211ced..7bbaac0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -53,7 +53,7 @@ using OpenSim.Region.ScriptEngine.Interfaces; namespace OpenSim.Region.ScriptEngine.Shared.Instance { - public class ScriptInstance : MarshalByRefObject, IScriptInstance, ISponsor + public class ScriptInstance : MarshalByRefObject, IScriptInstance { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -1006,10 +1006,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance { return true; } - - public TimeSpan Renewal(ILease lease) - { - return lease.InitialLeaseTime; - } } } -- cgit v1.1 From a851b68333756d11be2c5afe2aa76c58ae771b4b Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 14 Aug 2009 14:27:56 +0100 Subject: Remove one more sponsor reference --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 7bbaac0..225126d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance "SecondLife.Script"); ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); - lease.Register(this); +// lease.Register(this); } catch (Exception) { -- cgit v1.1 From 957962b48276861948267701159775c2361b235b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Aug 2009 19:06:24 +0100 Subject: Remove NRE catching on TestReplicateArchivePathToUserInventory() since race failure now appears to have gone --- .../Archiver/Tests/InventoryArchiverTests.cs | 36 ++++++---------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 28b4d64..2169e36 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -395,17 +395,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager, InventoryReceived); Monitor.Wait(this, 60000); } - - //userInfo.FetchInventory(); - /* - for (int i = 0 ; i < 50 ; i++) - { - if (userInfo.HasReceivedInventory == true) - break; - Thread.Sleep(200); - } - Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); - */ Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); @@ -429,22 +418,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); - try - { - new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) - .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); - - Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); - InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); - Assert.That(folder1, Is.Not.Null, "Could not find folder a"); - InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); - Assert.That(folder2, Is.Not.Null, "Could not find folder b"); - } - catch (NullReferenceException e) - { - // Non fatal for now until we resolve the race condition - Console.WriteLine("Test failed with {0}", e); - } + new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) + .ReplicateArchivePathToUserInventory( + itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); + + Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); + InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); + Assert.That(folder1, Is.Not.Null, "Could not find folder a"); + InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); + Assert.That(folder2, Is.Not.Null, "Could not find folder b"); } } } -- cgit v1.1 From dce81225c50e9ce15187bfb412870716127a31fa Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 14 Aug 2009 14:15:49 -0400 Subject: * allocate the dictionary for AgentCircuitData.ChildrenCapSeeds when creating the circuitdata object to see if it's the cause of a null reference exception in the TestAddNeighbourRegio test --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index a3672d5..88452d2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -113,6 +113,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests agent.InventoryFolder = UUID.Zero; agent.startpos = Vector3.Zero; agent.CapsPath = GetRandomCapsObjectPath(); + agent.ChildrenCapSeeds = new Dictionary(); string reason; scene.NewUserConnection(agent, out reason); -- cgit v1.1 From a668a5b0d39f04497e5ea170e5af0e659a43febb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Aug 2009 19:59:42 +0100 Subject: Add standard doc and standard doc formatting to IAssetService --- .../Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 2169e36..9784fcf 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryArchiverModule archiverModule = new InventoryArchiverModule(); - Scene scene = SceneSetupHelpers.SetupScene(""); + Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); CommunicationsManager cm = scene.CommsManager; -- cgit v1.1 From ff28ecee1b35ba24ec538d8ed018c764476c62b4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Aug 2009 20:07:13 +0100 Subject: Re-enable TestSaveIarV0_1() Implement more parts of TestAssetService --- .../Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 9784fcf..c66678f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). /// - //[Test] + [Test] public void TestSaveIarV0_1() { TestHelper.InMethod(); -- cgit v1.1 From e17a2331a02d36a3b9f6f37630601ab4a63a4fb2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Aug 2009 20:38:56 +0100 Subject: * Re-enable TestLoadIarV0_1ExistingUsers() --- .../Inventory/Archiver/Tests/InventoryArchiverTests.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index c66678f..470a386 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// an account exists with the creator name. /// - //[Test] + [Test] public void TestLoadIarV0_1ExistingUsers() { TestHelper.InMethod(); @@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene - Scene scene = SceneSetupHelpers.SetupScene(); + Scene scene = SceneSetupHelpers.SetupScene("inventory"); IUserAdminService userAdminService = scene.CommsManager.UserAdminService; SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); @@ -276,16 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); - //userInfo.FetchInventory(); - /* - for (int i = 0 ; i < 50 ; i++) - { - if (userInfo.HasReceivedInventory == true) - break; - Thread.Sleep(200); - } - Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); - */ + InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); Assert.That( -- cgit v1.1 From 1b933c91160a27fe53f3dff2e706363190b1ede9 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 14 Aug 2009 19:12:42 -0400 Subject: * Put the StandaloneTeleportTest in a new thread and call Thread.Join() inside a try/Catch (ThreadAbortException) to try and get around scene code aborting the testing thread. Use a Messenger class to report the results back to the test thread. --- .../Scenes/Tests/StandaloneTeleportTests.cs | 115 +++++++++++++++++---- 1 file changed, 95 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs index ed2d317..23eab90 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs @@ -38,6 +38,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion; using OpenSim.Tests.Common; using OpenSim.Tests.Common.Mock; using OpenSim.Tests.Common.Setup; +using System.Threading; namespace OpenSim.Region.Framework.Scenes.Tests { @@ -55,56 +56,130 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestSimpleNotNeighboursTeleport() { TestHelper.InMethod(); + ThreadRunResults results = new ThreadRunResults(); + results.Result = false; + results.Message = "Test did not run"; + TestRunning testClass = new TestRunning(results); + Thread testThread = new Thread(testClass.run); + + try + { + // Seems kind of redundant to start a thread and then join it, however.. We need to protect against + // A thread abort exception in the simulator code. + testThread.Start(); + testThread.Join(); + } + catch (ThreadAbortException) + { + + } + Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message); // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); + } + + } + + public class ThreadRunResults + { + public bool Result = false; + public string Message = string.Empty; + } + + public class TestRunning + { + public ThreadRunResults results; + public TestRunning(ThreadRunResults t) + { + results = t; + } + public void run(object o) + { + //results.Result = true; log4net.Config.XmlConfigurator.Configure(); - + UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); TestCommunicationsManager cm = new TestCommunicationsManager(); // shared module ISharedRegionModule interregionComms = new RESTInterregionComms(); - + Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm); SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); sceneA.RegisterRegionWithGrid(); - + Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); sceneB.RegisterRegionWithGrid(); - - UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); + + UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); - + ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface(); + + results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl); + if (!results.Result) + { + results.Message = "Incorrect caps object path set up in sceneA"; + return; + } + + /* Assert.That( - sceneACapsModule.GetCapsPath(agentId), - Is.EqualTo(client.CapsSeedUrl), + sceneACapsModule.GetCapsPath(agentId), + Is.EqualTo(client.CapsSeedUrl), "Incorrect caps object path set up in sceneA"); - + */ // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. - client.TeleportTargetScene = sceneB; - client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); - Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); - Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); + + client.TeleportTargetScene = sceneB; + client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); + + results.Result = (sceneB.GetScenePresence(agentId) != null); + if (!results.Result) + { + results.Message = "Client does not have an agent in sceneB"; + return; + } + + //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); + //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); + + results.Result = (sceneA.GetScenePresence(agentId) == null); + if (!results.Result) + { + results.Message = "Client still had an agent in sceneA"; + return; + } + ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface(); - + + + results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl); + if (!results.Result) + { + results.Message = "Incorrect caps object path set up in sceneB"; + return; + } + // Temporary assertion - caps url construction should at least be doable through a method. + /* Assert.That( - "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/", - Is.EqualTo(client.CapsSeedUrl), - "Incorrect caps object path set up in sceneB"); - + "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/", + Is.EqualTo(client.CapsSeedUrl), + "Incorrect caps object path set up in sceneB"); + */ // This assertion will currently fail since we don't remove the caps paths when no longer needed //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path"); - + // TODO: Check that more of everything is as it should be - + // TODO: test what happens if we try to teleport to a region that doesn't exist } } -- cgit v1.1 From 2f61fb0243e8e6b4da6e2ca1847faaba3ccee3d9 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 14 Aug 2009 21:19:04 -0400 Subject: * minor : comments * also re-trigger panda --- .../Framework/Scenes/SceneCommunicationService.cs | 72 +++++++++++++++++++++- 1 file changed, 69 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 0140faa..c1e39a9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -48,6 +48,9 @@ namespace OpenSim.Region.Framework.Scenes public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List regionlst); + /// + /// Class that Region communications runs through + /// public class SceneCommunicationService //one instance per region { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -60,15 +63,46 @@ namespace OpenSim.Region.Framework.Scenes protected List m_agentsInTransit; + /// + /// An agent is crossing into this region + /// public event AgentCrossing OnAvatarCrossingIntoRegion; + + /// + /// A user will arrive shortly, set up appropriate credentials so it can connect + /// public event ExpectUserDelegate OnExpectUser; + + /// + /// A Prim will arrive shortly + /// public event ExpectPrimDelegate OnExpectPrim; public event CloseAgentConnection OnCloseAgentConnection; + + /// + /// A new prim has arrived + /// public event PrimCrossing OnPrimCrossingIntoRegion; + + /// + /// A New Region is up and available + /// public event RegionUp OnRegionUp; + + /// + /// We have a child agent for this avatar and we're getting a status update about it + /// public event ChildAgentUpdate OnChildAgentUpdate; //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; + + /// + /// Time to log one of our users off. Grid Service sends this mostly + /// public event LogOffUser OnLogOffUser; + + /// + /// A region wants land data from us! + /// public event GetLandData OnGetLandData; private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; @@ -123,11 +157,20 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Returns a region with the name closest to string provided + /// + /// Partial Region Name for matching + /// Region Information for the region public RegionInfo RequestClosestRegion(string name) { return m_commsProvider.GridService.RequestClosestRegion(name); } + /// + /// This region is shutting down, de-register all events! + /// De-Register region from Grid! + /// public void Close() { if (regionCommsHost != null) @@ -159,10 +202,9 @@ namespace OpenSim.Region.Framework.Scenes #region CommsManager Event handlers /// - /// + /// A New User will arrive shortly, Informs the scene that there's a new user on the way /// - /// - /// + /// Data we need to ensure that the agent can connect /// protected void NewUserConnection(AgentCircuitData agent) { @@ -174,6 +216,12 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// The Grid has requested us to log-off the user + /// + /// Unique ID of agent to log-off + /// The secret string that the region establishes with the grid when registering + /// The message to send to the user that tells them why they were logged off protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message) { handlerLogOffUser = OnLogOffUser; @@ -183,6 +231,11 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// A New Region is now available. Inform the scene that there is a new region available. + /// + /// Information about the new region that is available + /// True if the event was handled protected bool newRegionUp(RegionInfo region) { handlerRegionUp = OnRegionUp; @@ -194,6 +247,11 @@ namespace OpenSim.Region.Framework.Scenes return true; } + /// + /// Inform the scene that we've got an update about a child agent that we have + /// + /// + /// protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData) { handlerChildAgentUpdate = OnChildAgentUpdate; @@ -204,6 +262,7 @@ namespace OpenSim.Region.Framework.Scenes return true; } + protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) { handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; @@ -213,6 +272,13 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// We have a new prim from a neighbor + /// + /// unique ID for the primative + /// XML2 encoded data of the primative + /// An Int that represents the version of the XMLMethod + /// True if the prim was accepted, false if it was not protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod) { handlerExpectPrim = OnExpectPrim; -- cgit v1.1 From f208628667aed5d1d98d17b5dda815ae5ed9bcc9 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 14 Aug 2009 21:37:25 -0400 Subject: * minor : Comments * Also re-trigger Panda. --- OpenSim/Region/Framework/Scenes/Scene.cs | 71 ++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 919075c..56e5ef0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2170,6 +2170,14 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Sets the Home Point. The GridService uses this to know where to put a user when they log-in + /// + /// + /// + /// + /// + /// public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) { UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); @@ -2340,6 +2348,12 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Removes region from an avatar's known region list. This coincides with child agents. For each child agent, there will be a known region entry. + /// + /// + /// + /// public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List regionslst) { ScenePresence av = GetScenePresence(avatarID); @@ -2355,12 +2369,19 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Closes all endpoints with the circuitcode provided. + /// + /// Circuit Code of the endpoint to close public override void CloseAllAgents(uint circuitcode) { // Called by ClientView to kill all circuit codes ClientManager.CloseAllAgents(circuitcode); } + /// + /// Inform all other ScenePresences on this Scene that someone else has changed position on the minimap. + /// public void NotifyMyCoarseLocationChange() { ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); @@ -2455,9 +2476,10 @@ namespace OpenSim.Region.Framework.Scenes /// The return bool should allow for connections to be refused, but as not all calling paths /// take proper notice of it let, we allowed banned users in still. /// - /// - /// - /// + /// CircuitData of the agent who is connecting + /// Outputs the reason for the false response on this string + /// True if the region accepts this agent. False if it does not. False will + /// also return a reason. public bool NewUserConnection(AgentCircuitData agent, out string reason) { // Don't disable this log message - it's too helpful @@ -2530,6 +2552,13 @@ namespace OpenSim.Region.Framework.Scenes return true; } + /// + /// Verifies that the user has a session on the Grid + /// + /// Circuit Data of the Agent we're verifying + /// Outputs the reason for the false response on this string + /// True if the user has a session on the grid. False if it does not. False will + /// also return a reason. public virtual bool AuthenticateUser(AgentCircuitData agent, out string reason) { reason = String.Empty; @@ -2542,6 +2571,13 @@ namespace OpenSim.Region.Framework.Scenes return result; } + /// + /// Verify if the user can connect to this region. Checks the banlist and ensures that the region is set for public access + /// + /// The circuit data for the agent + /// outputs the reason to this string + /// True if the region accepts this agent. False if it does not. False will + /// also return a reason. protected virtual bool AuthorizeUser(AgentCircuitData agent, out string reason) { reason = String.Empty; @@ -2600,16 +2636,32 @@ namespace OpenSim.Region.Framework.Scenes return true; } + /// + /// Update an AgentCircuitData object with new information + /// + /// Information to update the AgentCircuitData with public void UpdateCircuitData(AgentCircuitData data) { m_authenticateHandler.UpdateAgentData(data); } + /// + /// Change the Circuit Code for the user's Circuit Data + /// + /// The old Circuit Code. Must match a previous circuit code + /// The new Circuit Code. Must not be an already existing circuit code + /// True if we successfully changed it. False if we did not public bool ChangeCircuitCode(uint oldcc, uint newcc) { return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); } + /// + /// The Grid has requested that we log-off a user. Log them off. + /// + /// Unique ID of the avatar to log-off + /// SecureSessionID of the user, or the RegionSecret text when logging on to the grid + /// message to display to the user. Reason for being logged off public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message) { ScenePresence loggingOffUser = null; @@ -2675,6 +2727,13 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// We've got an update about an agent that sees into this region, + /// send it to ScenePresence for processing It's the full data. + /// + /// Agent that contains all of the relevant things about an agent. + /// Appearance, animations, position, etc. + /// true if we handled it. public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) { // m_log.DebugFormat( @@ -2692,6 +2751,12 @@ namespace OpenSim.Region.Framework.Scenes return false; } + /// + /// We've got an update about an agent that sees into this region, + /// send it to ScenePresence for processing It's only positional data + /// + /// AgentPosition that contains agent positional data so we can know what to send + /// true if we handled it. public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) { //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); -- cgit v1.1 From 95be3eccd28f39b33e70202d2db4f7d57a99c9c8 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 15 Aug 2009 00:01:58 -0400 Subject: * minor: comments * also re-trigger panda --- OpenSim/Region/Framework/Scenes/Scene.cs | 101 ++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 56e5ef0..18d7bad 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1038,6 +1038,10 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Send out simstats data to all clients + /// + /// Stats on the Simulator's performance private void SendSimStatsPackets(SimStats stats) { List StatSendAgents = GetScenePresences(); @@ -1050,6 +1054,9 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Recount SceneObjectPart in parcel aabb + /// private void UpdateLand() { if (LandChannel != null) @@ -1061,11 +1068,17 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Update the terrain if it needs to be updated. + /// private void UpdateTerrain() { EventManager.TriggerTerrainTick(); } + /// + /// Back up queued up changes + /// private void UpdateStorageBackup() { if (!m_backingup) @@ -1078,6 +1091,9 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Sends out the OnFrame event to the modules + /// private void UpdateEvents() { m_eventManager.TriggerOnFrame(); @@ -1133,6 +1149,10 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Synchronous force backup. For deletes and links/unlinks + /// + /// Object to be backed up public void ForceSceneObjectBackup(SceneObjectGroup group) { if (group != null) @@ -1141,6 +1161,13 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Return object to avatar Message + /// + /// Avatar Unique Id + /// Name of object returned + /// Location of object returned + /// Reasion for object return public void AddReturn(UUID agentID, string objectName, Vector3 location, string reason) { lock (m_returns) @@ -1167,6 +1194,9 @@ namespace OpenSim.Region.Framework.Scenes #region Load Terrain + /// + /// Store the terrain in the persistant data store + /// public void SaveTerrain() { m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); @@ -1269,6 +1299,10 @@ namespace OpenSim.Region.Framework.Scenes #region Load Land + /// + /// Loads all Parcel data from the datastore for region identified by regionID + /// + /// Unique Identifier of the Region to load parcel data for public void loadAllLandObjectsFromStorage(UUID regionID) { m_log.Info("[SCENE]: Loading land objects from storage"); @@ -1322,6 +1356,20 @@ namespace OpenSim.Region.Framework.Scenes m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); } + + /// + /// Gets a new rez location based on the raycast and the size of the object that is being rezzed. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) { Vector3 pos = Vector3.Zero; @@ -1412,6 +1460,19 @@ namespace OpenSim.Region.Framework.Scenes } } + + /// + /// Create a New SceneObjectGroup/Part by raycasting + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, byte RayEndIsIntersection) @@ -1829,6 +1890,12 @@ namespace OpenSim.Region.Framework.Scenes return true; } + /// + /// Attachment rezzing + /// + /// Agent Unique ID + /// Object ID + /// False public virtual bool IncomingCreateObject(UUID userID, UUID itemID) { ScenePresence sp = GetScenePresence(userID); @@ -1841,6 +1908,13 @@ namespace OpenSim.Region.Framework.Scenes return false; } + /// + /// Adds a Scene Object group to the Scene. + /// Verifies that the creator of the object is not banned from the simulator. + /// Checks if the item is an Attachment + /// + /// + /// True if the SceneObjectGroup was added, False if it was not public bool AddSceneObject(SceneObjectGroup sceneObject) { // If the user is banned, we won't let any of their objects @@ -1933,6 +2007,10 @@ namespace OpenSim.Region.Framework.Scenes #region Add/Remove Avatar Methods + /// + /// Adding a New Client and Create a Presence for it. + /// + /// public override void AddNewClient(IClientAPI client) { SubscribeToClientEvents(client); @@ -1977,6 +2055,10 @@ namespace OpenSim.Region.Framework.Scenes EventManager.TriggerOnNewClient(client); } + /// + /// Register for events from the client + /// + /// The IClientAPI of the connected client protected virtual void SubscribeToClientEvents(IClientAPI client) { client.OnRegionHandShakeReply += SendLayerData; @@ -2070,8 +2152,8 @@ namespace OpenSim.Region.Framework.Scenes /// /// Teleport an avatar to their home region /// - /// - /// + /// The avatar's Unique ID + /// The IClientAPI for the client public virtual void TeleportClientHome(UUID agentId, IClientAPI client) { UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); @@ -2099,6 +2181,21 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Duplicates object specified by localID at position raycasted against RayTargetObject using + /// RayEnd and RayStart to determine what the angle of the ray is + /// + /// ID of object to duplicate + /// + /// Agent doing the duplication + /// Group of new object + /// The target of the Ray + /// The ending of the ray (farthest away point) + /// The Beginning of the ray (closest point) + /// Bool to bypass raycasting + /// The End specified is the place to add the object + /// Position the object at the center of the face that it's colliding with + /// Rotate the object the same as the localID object public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) -- cgit v1.1 From 72c2819c53e395569cb6b1cd047159ab07b18966 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 15 Aug 2009 00:22:18 -0400 Subject: * Comment out XEngineTest that doesn't appear to test anything. It just creates a scene named 'My Test' which just happens to be the last scene displayed in the nunit log before it goes boom. --- OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs index aac52a4..637b52f 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs @@ -40,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests /// /// Scene presence tests /// + /// Commented out XEngineTests that don't do anything + /* [TestFixture] public class XEngineTest { @@ -65,4 +67,5 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests xengine.RegionLoaded(scene); } } + * } -- cgit v1.1 From ddac88da6a952f24f35caa69be0cff2dd725e824 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 15 Aug 2009 00:29:34 -0400 Subject: * whoops, missing a / --- OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs index 637b52f..045abb4 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs @@ -67,5 +67,5 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests xengine.RegionLoaded(scene); } } - * + */ } -- cgit v1.1