From b3a12167d6dd9cbd21c57ca103d8c3f60ba93e73 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 9 Jan 2012 17:54:35 -0500 Subject: Use our TeleportFlags Switch to our TeleportFlags enum instead of LibOMV because we need to define a type for HG Logins. Also moved some debugging in ScenePresence into a function to make it simpler to enable/disable. --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 027ec96..5e1c768 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2528,7 +2528,7 @@ namespace OpenSim.Region.Framework.Scenes sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type); m_eventManager.TriggerOnNewPresence(sp); - sp.TeleportFlags = (TeleportFlags)aCircuit.teleportFlags; + 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. @@ -3333,7 +3333,7 @@ namespace OpenSim.Region.Framework.Scenes { // Let the SP know how we got here. This has a lot of interesting // uses down the line. - sp.TeleportFlags = (TeleportFlags)teleportFlags; + sp.TeleportFlags = (TPFlags)teleportFlags; if (sp.IsChildAgent) { -- cgit v1.1 From 707c8c6f2b7671c0a439a28921daeac8e7219639 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 9 Jan 2012 18:19:55 -0500 Subject: Add some run-time debugging support Add configuration option - DEBUG to enable debugging methods. This is temporary for helping users testing teleport routing be able to report back the data with the test cases. We can remove when finished with this, or leave it if it proves to be useful. Users: set DEBUG = true in OpenSim.ini to get more information from teleport routing. The default is false. It presently prints the TeleportFlags value. --- OpenSim/Region/Framework/Scenes/Scene.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5e1c768..ed6f68a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -65,6 +65,7 @@ namespace OpenSim.Region.Framework.Scenes #region Fields public bool EmergencyMonitoring = false; + public bool DEBUG = false; public SynchronizeSceneHandler SynchronizeScene; public SimStatsReporter StatsReporter; @@ -650,6 +651,8 @@ namespace OpenSim.Region.Framework.Scenes // IConfig startupConfig = m_config.Configs["Startup"]; + DEBUG = startupConfig.GetBoolean("DEBUG", false); + m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); if (!m_useBackup) -- cgit v1.1 From 3deb52d3996b45228c2301ecc7445514099f3b13 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 10 Jan 2012 13:41:35 -0500 Subject: Teleport Debugging Move setting from ini to existing facitilies - thanks justincc toggle with console command: debug teleport --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ed6f68a..f03c345 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -651,8 +651,6 @@ namespace OpenSim.Region.Framework.Scenes // IConfig startupConfig = m_config.Configs["Startup"]; - DEBUG = startupConfig.GetBoolean("DEBUG", false); - m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); if (!m_useBackup) -- cgit v1.1 From da720ce9be7d050ad2ff26c97490ebd4e17be2cc Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 26 Jan 2012 10:21:45 +0000 Subject: Support rejecting a teleport if a user is banned in all parcels that have spawn points --- OpenSim/Region/Framework/Scenes/Scene.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f03c345..984058c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5067,6 +5067,36 @@ namespace OpenSim.Region.Framework.Scenes } } + if (position == Vector3.Zero) // Teleport + { + if (!RegionInfo.EstateSettings.AllowDirectTeleport) + { + SceneObjectGroup telehub; + if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && (telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject)) != null) + { + List spawnPoints = RegionInfo.RegionSettings.SpawnPoints(); + bool banned = true; + foreach (SpawnPoint sp in spawnPoints) + { + Vector3 spawnPoint = sp.GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); + ILandObject land = LandChannel.GetLandObject(spawnPoint.X, spawnPoint.Y); + if (land == null) + continue; + if (land.IsEitherBannedOrRestricted(agentID)) + continue; + banned = false; + break; + } + + if (banned) + { + reason = "No suitable landing point found"; + return false; + } + } + } + } + reason = String.Empty; return true; } -- cgit v1.1 From f3780b9eaeae8834c49f6e2f6045ef922916924d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 31 Jan 2012 19:56:37 +0000 Subject: Add torture tests to test adding 10,000, 100,000 and 200,000 single prim scene objects. These can be run using the "nant torture" target. They are not part of "nant test" due to their long-run future nature. Such tests are designed to do some testing of extreme situations and give some feedback on memory usage, etc. However, data can be inconsistent due to different machine circumstances and virtual machine actions. This area is under development. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 984058c..975d769 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1943,6 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes /// If true, the object is made persistent into the scene. /// If false, the object will not persist over server restarts /// + /// true if the object was added. false if not public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) { return AddNewSceneObject(sceneObject, attachToBackup, true); @@ -1960,6 +1961,7 @@ namespace OpenSim.Region.Framework.Scenes /// If true, updates for the new scene object are sent to all viewers in range. /// If false, it is left to the caller to schedule the update /// + /// true if the object was added. false if not public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) { if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates)) -- cgit v1.1 From 9bd02b5da19ae758bfb7a543976b26ced0cd1ba2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 31 Jan 2012 21:57:45 +0000 Subject: Move object delete commands into a commands region module, in preparation for adding similar show commands. --- OpenSim/Region/Framework/Scenes/Scene.cs | 104 ------------------------------- 1 file changed, 104 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 975d769..df6c88f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -600,23 +600,6 @@ namespace OpenSim.Region.Framework.Scenes "reload estate", "Reload the estate data", HandleReloadEstate); - MainConsole.Instance.Commands.AddCommand("region", false, "delete object owner", - "delete object owner ", - "Delete object by owner", HandleDeleteObject); - MainConsole.Instance.Commands.AddCommand("region", false, "delete object creator", - "delete object creator ", - "Delete object by creator", HandleDeleteObject); - MainConsole.Instance.Commands.AddCommand("region", false, "delete object uuid", - "delete object uuid ", - "Delete object by uuid", HandleDeleteObject); - MainConsole.Instance.Commands.AddCommand("region", false, "delete object name", - "delete object name ", - "Delete object by name", HandleDeleteObject); - - MainConsole.Instance.Commands.AddCommand("region", false, "delete object outside", - "delete object outside", - "Delete all objects outside boundaries", HandleDeleteObject); - //Bind Storage Manager functions to some land manager functions for this scene EventManager.OnLandObjectAdded += new EventManager.LandObjectAdded(simDataService.StoreLandObject); @@ -4860,93 +4843,6 @@ namespace OpenSim.Region.Framework.Scenes } } - private void HandleDeleteObject(string module, string[] cmd) - { - if (cmd.Length < 3) - return; - - string mode = cmd[2]; - string o = ""; - - if (mode != "outside") - { - if (cmd.Length < 4) - return; - - o = cmd[3]; - } - - List deletes = new List(); - - UUID match; - - switch (mode) - { - case "owner": - if (!UUID.TryParse(o, out match)) - return; - ForEachSOG(delegate (SceneObjectGroup g) - { - if (g.OwnerID == match && !g.IsAttachment) - deletes.Add(g); - }); - break; - case "creator": - if (!UUID.TryParse(o, out match)) - return; - ForEachSOG(delegate (SceneObjectGroup g) - { - if (g.RootPart.CreatorID == match && !g.IsAttachment) - deletes.Add(g); - }); - break; - case "uuid": - if (!UUID.TryParse(o, out match)) - return; - ForEachSOG(delegate (SceneObjectGroup g) - { - if (g.UUID == match && !g.IsAttachment) - deletes.Add(g); - }); - break; - case "name": - ForEachSOG(delegate (SceneObjectGroup g) - { - if (g.RootPart.Name == o && !g.IsAttachment) - deletes.Add(g); - }); - break; - case "outside": - ForEachSOG(delegate (SceneObjectGroup g) - { - SceneObjectPart rootPart = g.RootPart; - bool delete = false; - - if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0) - { - delete = true; - } - else - { - ILandObject parcel = LandChannel.GetLandObject(rootPart.GroupPosition.X, rootPart.GroupPosition.Y); - - if (parcel == null || parcel.LandData.Name == "NO LAND") - delete = true; - } - - if (delete && !g.IsAttachment && !deletes.Contains(g)) - deletes.Add(g); - }); - break; - } - - foreach (SceneObjectGroup g in deletes) - { - m_log.InfoFormat("[SCENE]: Deleting object {0}", g.UUID); - DeleteSceneObject(g, false); - } - } - private void HandleReloadEstate(string module, string[] cmd) { if (MainConsole.Instance.ConsoleScene == null || -- cgit v1.1 From fcc1fa2c32af3df8962e470150b641dda036a8ab Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 1 Feb 2012 09:36:14 +0000 Subject: Straighten out some attachment mess. Don't save attachment states for HG visitors at all. On Leaving a sim, save only the changed ones. Don't save all scripted stuff when leaving a sim. --- OpenSim/Region/Framework/Scenes/Scene.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index df6c88f..34d1151 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3104,7 +3104,17 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerOnRemovePresence(agentID); if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) - AttachmentsModule.SaveChangedAttachments(avatar); + { + IUserManagement uMan = m_aScene.RequestModuleInterface(); + // Don't save attachments for HG visitors, it + // messes up their inventory. When a HG visitor logs + // out on a foreign grid, their attachments will be + // reloaded in the state they were in when they left + // the home grid. This is best anyway as the visited + // grid may use an incompatible script engine. + if (uMan == null || uMan.IsLocalGridUser(id)) + AttachmentsModule.SaveChangedAttachments(avatar, false); + } ForEachClient( delegate(IClientAPI client) -- cgit v1.1 From 241ddd031f36eda9f1339398ae30d52c1b9e83e5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 1 Feb 2012 09:45:15 +0000 Subject: Fix copy/paste errors --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 34d1151..2af4a1c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3105,14 +3105,14 @@ namespace OpenSim.Region.Framework.Scenes if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) { - IUserManagement uMan = m_aScene.RequestModuleInterface(); + IUserManagement uMan = RequestModuleInterface(); // Don't save attachments for HG visitors, it // messes up their inventory. When a HG visitor logs // out on a foreign grid, their attachments will be // reloaded in the state they were in when they left // the home grid. This is best anyway as the visited // grid may use an incompatible script engine. - if (uMan == null || uMan.IsLocalGridUser(id)) + if (uMan == null || uMan.IsLocalGridUser(avatar.UUID)) AttachmentsModule.SaveChangedAttachments(avatar, false); } -- cgit v1.1 From 003bd9f1b3a774141d53282d3b3c13a7e121f0a4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 1 Feb 2012 10:05:04 +0000 Subject: Small optimization to last commit --- OpenSim/Region/Framework/Scenes/Scene.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2af4a1c..23fee4e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3056,11 +3056,11 @@ namespace OpenSim.Region.Framework.Scenes public override void RemoveClient(UUID agentID, bool closeChildAgents) { CheckHeartbeat(); - bool childagentYN = false; + bool isChildAgent = false; ScenePresence avatar = GetScenePresence(agentID); if (avatar != null) { - childagentYN = avatar.IsChildAgent; + isChildAgent = avatar.IsChildAgent; if (avatar.ParentID != 0) { @@ -3071,9 +3071,9 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat( "[SCENE]: Removing {0} agent {1} from region {2}", - (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); + (isChildAgent ? "child" : "root"), agentID, RegionInfo.RegionName); - m_sceneGraph.removeUserCount(!childagentYN); + m_sceneGraph.removeUserCount(!isChildAgent); // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI @@ -3103,7 +3103,7 @@ namespace OpenSim.Region.Framework.Scenes { m_eventManager.TriggerOnRemovePresence(agentID); - if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) + if (AttachmentsModule != null && !isChildAgent && avatar.PresenceType != PresenceType.Npc) { IUserManagement uMan = RequestModuleInterface(); // Don't save attachments for HG visitors, it -- cgit v1.1