aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2012-02-09 00:19:37 +0000
committerMelanie2012-02-09 00:19:37 +0000
commit7c888f6af11b5f1d2e41add5ecadae4aa4b2dfa1 (patch)
tree14c6090f09e2d6bd400fbdaa2fe16299323f63a9 /OpenSim/Region
parentPush more NPC stuff into threads (diff)
parentminor: put in commented out logging statements for future reuse (diff)
downloadopensim-SC_OLD-7c888f6af11b5f1d2e41add5ecadae4aa4b2dfa1.zip
opensim-SC_OLD-7c888f6af11b5f1d2e41add5ecadae4aa4b2dfa1.tar.gz
opensim-SC_OLD-7c888f6af11b5f1d2e41add5ecadae4aa4b2dfa1.tar.bz2
opensim-SC_OLD-7c888f6af11b5f1d2e41add5ecadae4aa4b2dfa1.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/SceneGraph.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs21
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs23
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs8
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs11
7 files changed, 69 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 58de44e..01df575 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2310,8 +2310,25 @@ namespace OpenSim.Region.Framework.Scenes
2310 m_sceneGraph.DelinkObjects(parts); 2310 m_sceneGraph.DelinkObjects(parts);
2311 } 2311 }
2312 2312
2313 /// <summary>
2314 /// Link the scene objects containing the indicated parts to a root object.
2315 /// </summary>
2316 /// <param name="client"></param>
2317 /// <param name="parentPrimId">A root prim id of the object which will be the root prim of the resulting linkset.</param>
2318 /// <param name="childPrimIds">A list of child prims for the objects that should be linked in.</param>
2313 public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) 2319 public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds)
2314 { 2320 {
2321 LinkObjects(client.AgentId, parentPrimId, childPrimIds);
2322 }
2323
2324 /// <summary>
2325 /// Link the scene objects containing the indicated parts to a root object.
2326 /// </summary>
2327 /// <param name="agentId">The ID of the user linking.</param>
2328 /// <param name="parentPrimId">A root prim id of the object which will be the root prim of the resulting linkset.</param>
2329 /// <param name="childPrimIds">A list of child prims for the objects that should be linked in.</param>
2330 public void LinkObjects(UUID agentId, uint parentPrimId, List<uint> childPrimIds)
2331 {
2315 List<UUID> owners = new List<UUID>(); 2332 List<UUID> owners = new List<UUID>();
2316 2333
2317 List<SceneObjectPart> children = new List<SceneObjectPart>(); 2334 List<SceneObjectPart> children = new List<SceneObjectPart>();
@@ -2323,7 +2340,7 @@ namespace OpenSim.Region.Framework.Scenes
2323 return; 2340 return;
2324 } 2341 }
2325 2342
2326 if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) 2343 if (!Permissions.CanLinkObject(agentId, root.ParentGroup.RootPart.UUID))
2327 { 2344 {
2328 m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim"); 2345 m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim");
2329 return; 2346 return;
@@ -2339,7 +2356,7 @@ namespace OpenSim.Region.Framework.Scenes
2339 if (!owners.Contains(part.OwnerID)) 2356 if (!owners.Contains(part.OwnerID))
2340 owners.Add(part.OwnerID); 2357 owners.Add(part.OwnerID);
2341 2358
2342 if (Permissions.CanLinkObject(client.AgentId, part.ParentGroup.RootPart.UUID)) 2359 if (Permissions.CanLinkObject(agentId, part.ParentGroup.RootPart.UUID))
2343 children.Add(part); 2360 children.Add(part);
2344 } 2361 }
2345 2362
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 17563bd..6dd42dd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1751,6 +1751,10 @@ namespace OpenSim.Region.Framework.Scenes
1751 { 1751 {
1752 SceneObjectGroup child = children[i].ParentGroup; 1752 SceneObjectGroup child = children[i].ParentGroup;
1753 1753
1754 // Don't try and add a group to itself - this will only cause severe problems later on.
1755 if (child == parentGroup)
1756 continue;
1757
1754 // Make sure no child prim is set for sale 1758 // Make sure no child prim is set for sale
1755 // So that, on delink, no prims are unwittingly 1759 // So that, on delink, no prims are unwittingly
1756 // left for sale and sold off 1760 // left for sale and sold off
@@ -1777,8 +1781,13 @@ namespace OpenSim.Region.Framework.Scenes
1777 1781
1778 // We need to explicitly resend the newly link prim's object properties since no other actions 1782 // We need to explicitly resend the newly link prim's object properties since no other actions
1779 // occur on link to invoke this elsewhere (such as object selection) 1783 // occur on link to invoke this elsewhere (such as object selection)
1780 parentGroup.RootPart.CreateSelected = true; 1784 if (childGroups.Count > 0)
1781 parentGroup.TriggerScriptChangedEvent(Changed.LINK); 1785 {
1786 parentGroup.RootPart.CreateSelected = true;
1787 parentGroup.TriggerScriptChangedEvent(Changed.LINK);
1788 parentGroup.HasGroupChanged = true;
1789 parentGroup.ScheduleGroupForFullUpdate();
1790 }
1782 } 1791 }
1783 finally 1792 finally
1784 { 1793 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 46c4d7b..683aafc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2361,6 +2361,10 @@ namespace OpenSim.Region.Framework.Scenes
2361// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", 2361// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
2362// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 2362// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
2363 2363
2364 // Linking to ourselves is not a valid operation.
2365 if (objectGroup == this)
2366 return;
2367
2364 SceneObjectPart linkPart = objectGroup.m_rootPart; 2368 SceneObjectPart linkPart = objectGroup.m_rootPart;
2365 2369
2366 Vector3 oldGroupPosition = linkPart.GroupPosition; 2370 Vector3 oldGroupPosition = linkPart.GroupPosition;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index a2332bb..be5b4a8 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -39,14 +39,31 @@ using log4net;
39 39
40namespace OpenSim.Region.Framework.Scenes.Tests 40namespace OpenSim.Region.Framework.Scenes.Tests
41{ 41{
42 /// <summary>
43 /// Linking tests
44 /// </summary>
45 [TestFixture] 42 [TestFixture]
46 public class SceneObjectLinkingTests 43 public class SceneObjectLinkingTests
47 { 44 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 46
47 /// <summary>
48 /// Links to self should be ignored.
49 /// </summary>
50 [Test]
51 public void TestLinkToSelf()
52 {
53 TestHelpers.InMethod();
54
55 UUID ownerId = TestHelpers.ParseTail(0x1);
56 int nParts = 3;
57
58 TestScene scene = SceneHelpers.SetupScene();
59 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
60 scene.AddSceneObject(sog1);
61 scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId });
62// sog1.LinkToGroup(sog1);
63
64 Assert.That(sog1.Parts.Length, Is.EqualTo(nParts));
65 }
66
50 [Test] 67 [Test]
51 public void TestLinkDelink2SceneObjects() 68 public void TestLinkDelink2SceneObjects()
52 { 69 {
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 3ea7352..a0ae55a 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -299,13 +299,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC
299 NPCAvatar av; 299 NPCAvatar av;
300 if (m_avatars.TryGetValue(agentID, out av)) 300 if (m_avatars.TryGetValue(agentID, out av))
301 { 301 {
302// m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove", agentID, av.Name);
302 scene.RemoveClient(agentID, false); 303 scene.RemoveClient(agentID, false);
303 m_avatars.Remove(agentID); 304 m_avatars.Remove(agentID);
304 305
306// m_log.DebugFormat("[NPC MODULE]: Removed {0} {1}", agentID, av.Name);
305 return true; 307 return true;
306 } 308 }
307 } 309 }
308 310
311// m_log.DebugFormat("[NPC MODULE]: Could not find {0} to remove", agentID);
309 return false; 312 return false;
310 } 313 }
311 314
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 34f2cc7..da2ef7b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -538,6 +538,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
538 538
539 public bool Stop(int timeout) 539 public bool Stop(int timeout)
540 { 540 {
541// m_log.DebugFormat(
542// "[SCRIPT INSTANCE]: Stopping script {0} {1} with timeout {2}", ScriptName, ItemID, timeout);
543
541 IScriptWorkItem result; 544 IScriptWorkItem result;
542 545
543 lock (m_EventQueue) 546 lock (m_EventQueue)
@@ -772,7 +775,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
772 } 775 }
773 catch (Exception e) 776 catch (Exception e)
774 { 777 {
775 // m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message); 778// m_log.DebugFormat(
779// "[SCRIPT] Exception in script {0} {1}: {2}{3}",
780// ScriptName, ItemID, e.Message, e.StackTrace);
781
776 m_InEvent = false; 782 m_InEvent = false;
777 m_CurrentEvent = String.Empty; 783 m_CurrentEvent = String.Empty;
778 784
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 24a9418..f627e37 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -301,7 +301,7 @@ namespace OpenSim.Region.UserStatistics
301 301
302 public void OnRegisterCaps(UUID agentID, Caps caps) 302 public void OnRegisterCaps(UUID agentID, Caps caps)
303 { 303 {
304 m_log.DebugFormat("[VC]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); 304 m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
305 string capsPath = "/CAPS/VS/" + UUID.Random(); 305 string capsPath = "/CAPS/VS/" + UUID.Random();
306 caps.RegisterHandler("ViewerStats", 306 caps.RegisterHandler("ViewerStats",
307 new RestStreamHandler("POST", capsPath, 307 new RestStreamHandler("POST", capsPath,
@@ -462,7 +462,7 @@ namespace OpenSim.Region.UserStatistics
462 462
463 if (!m_sessions.ContainsKey(agentID)) 463 if (!m_sessions.ContainsKey(agentID))
464 { 464 {
465 m_log.Warn("[VS]: no session for stat disclosure"); 465 m_log.Warn("[WEB STATS MODULE]: no session for stat disclosure");
466 return new UserSessionID(); 466 return new UserSessionID();
467 } 467 }
468 uid = m_sessions[agentID]; 468 uid = m_sessions[agentID];
@@ -667,14 +667,13 @@ namespace OpenSim.Region.UserStatistics
667 { 667 {
668 updatecmd.ExecuteNonQuery(); 668 updatecmd.ExecuteNonQuery();
669 } 669 }
670 catch 670 catch (SqliteExecutionException)
671 (SqliteExecutionException)
672 { 671 {
673 m_log.Warn("[WEBSTATS]: failed to write stats to storage Execution Exception"); 672 m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage Execution Exception");
674 } 673 }
675 catch (SqliteSyntaxException) 674 catch (SqliteSyntaxException)
676 { 675 {
677 m_log.Warn("[WEBSTATS]: failed to write stats to storage SQL Syntax Exception"); 676 m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage SQL Syntax Exception");
678 } 677 }
679 678
680 } 679 }