aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDan Lake2013-02-14 20:06:22 -0800
committerDan Lake2013-02-14 20:06:22 -0800
commite09467b30d5d27181c158961e95df25cd6001be5 (patch)
tree439acb650990a3495187f55d8a69b9a78f359c00 /OpenSim/Region/Framework
parentUse SortedDictionary in StatsManager instead of regular Dictionary so stats w... (diff)
parentEnable one sub-test in TestJsonSetValue() which now works (using identifier w... (diff)
downloadopensim-SC-e09467b30d5d27181c158961e95df25cd6001be5.zip
opensim-SC-e09467b30d5d27181c158961e95df25cd6001be5.tar.gz
opensim-SC-e09467b30d5d27181c158961e95df25cd6001be5.tar.bz2
opensim-SC-e09467b30d5d27181c158961e95df25cd6001be5.tar.xz
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs15
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs55
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
4 files changed, 77 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs
index cc7885a..b40d24f 100644
--- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs
@@ -31,6 +31,16 @@ using OpenMetaverse;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 // these could be expanded at some point to provide more type information
35 // for now value accounts for all base types
36 public enum JsonStoreNodeType
37 {
38 Undefined = 0,
39 Object = 1,
40 Array = 2,
41 Value = 3
42 }
43
34 public delegate void TakeValueCallback(string s); 44 public delegate void TakeValueCallback(string s);
35 45
36 public interface IJsonStoreModule 46 public interface IJsonStoreModule
@@ -38,13 +48,18 @@ namespace OpenSim.Region.Framework.Interfaces
38 bool AttachObjectStore(UUID objectID); 48 bool AttachObjectStore(UUID objectID);
39 bool CreateStore(string value, ref UUID result); 49 bool CreateStore(string value, ref UUID result);
40 bool DestroyStore(UUID storeID); 50 bool DestroyStore(UUID storeID);
51
52 JsonStoreNodeType GetPathType(UUID storeID, string path);
41 bool TestStore(UUID storeID); 53 bool TestStore(UUID storeID);
42 bool TestPath(UUID storeID, string path, bool useJson); 54 bool TestPath(UUID storeID, string path, bool useJson);
55
43 bool SetValue(UUID storeID, string path, string value, bool useJson); 56 bool SetValue(UUID storeID, string path, string value, bool useJson);
44 bool RemoveValue(UUID storeID, string path); 57 bool RemoveValue(UUID storeID, string path);
45 bool GetValue(UUID storeID, string path, bool useJson, out string value); 58 bool GetValue(UUID storeID, string path, bool useJson, out string value);
46 59
47 void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback); 60 void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback);
48 void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback); 61 void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback);
62
63 int GetArrayLength(UUID storeID, string path);
49 } 64 }
50} 65}
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs b/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs
index 8cef14e..6effcc1 100644
--- a/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs
@@ -26,18 +26,22 @@
26 */ 26 */
27 27
28using System; 28using System;
29using OpenMetaverse;
29using OpenMetaverse.StructuredData; 30using OpenMetaverse.StructuredData;
30 31
31namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
32{ 33{
34 public delegate void SimulatorFeaturesRequestDelegate(UUID agentID, ref OSDMap features);
35
33 /// <summary> 36 /// <summary>
34 /// Add remove or retrieve Simulator Features that will be given to a viewer via the SimulatorFeatures capability. 37 /// Add remove or retrieve Simulator Features that will be given to a viewer via the SimulatorFeatures capability.
35 /// </summary> 38 /// </summary>
36 public interface ISimulatorFeaturesModule 39 public interface ISimulatorFeaturesModule
37 { 40 {
41 event SimulatorFeaturesRequestDelegate OnSimulatorFeaturesRequest;
38 void AddFeature(string name, OSD value); 42 void AddFeature(string name, OSD value);
39 bool RemoveFeature(string name); 43 bool RemoveFeature(string name);
40 bool TryGetFeature(string name, out OSD value); 44 bool TryGetFeature(string name, out OSD value);
41 OSDMap GetFeatures(); 45 OSDMap GetFeatures();
42 } 46 }
43} \ No newline at end of file 47}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 9ee1520..59d0148 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -791,6 +791,19 @@ namespace OpenSim.Region.Framework.Scenes
791 public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); 791 public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
792 792
793 /// <summary> 793 /// <summary>
794 /// Triggered when an object is placed into the physical scene (PhysicsActor created).
795 /// </summary>
796 public event Action<SceneObjectPart> OnObjectAddedToPhysicalScene;
797 /// <summary>
798 /// Triggered when an object is removed from the physical scene (PhysicsActor destroyed).
799 /// </summary>
800 /// <remarks>
801 /// Note: this is triggered just before the PhysicsActor is removed from the
802 /// physics engine so the receiver can do any necessary cleanup before its destruction.
803 /// </remarks>
804 public event Action<SceneObjectPart> OnObjectRemovedFromPhysicalScene;
805
806 /// <summary>
794 /// Triggered when an object is removed from the scene. 807 /// Triggered when an object is removed from the scene.
795 /// </summary> 808 /// </summary>
796 /// <remarks> 809 /// <remarks>
@@ -1516,6 +1529,48 @@ namespace OpenSim.Region.Framework.Scenes
1516 } 1529 }
1517 } 1530 }
1518 1531
1532 public void TriggerObjectAddedToPhysicalScene(SceneObjectPart obj)
1533 {
1534 Action<SceneObjectPart> handler = OnObjectAddedToPhysicalScene;
1535 if (handler != null)
1536 {
1537 foreach (Action<SceneObjectPart> d in handler.GetInvocationList())
1538 {
1539 try
1540 {
1541 d(obj);
1542 }
1543 catch (Exception e)
1544 {
1545 m_log.ErrorFormat(
1546 "[EVENT MANAGER]: Delegate for TriggerObjectAddedToPhysicalScene failed - continuing. {0} {1}",
1547 e.Message, e.StackTrace);
1548 }
1549 }
1550 }
1551 }
1552
1553 public void TriggerObjectRemovedFromPhysicalScene(SceneObjectPart obj)
1554 {
1555 Action<SceneObjectPart> handler = OnObjectRemovedFromPhysicalScene;
1556 if (handler != null)
1557 {
1558 foreach (Action<SceneObjectPart> d in handler.GetInvocationList())
1559 {
1560 try
1561 {
1562 d(obj);
1563 }
1564 catch (Exception e)
1565 {
1566 m_log.ErrorFormat(
1567 "[EVENT MANAGER]: Delegate for TriggerObjectRemovedFromPhysicalScene failed - continuing. {0} {1}",
1568 e.Message, e.StackTrace);
1569 }
1570 }
1571 }
1572 }
1573
1519 public void TriggerShutdown() 1574 public void TriggerShutdown()
1520 { 1575 {
1521 Action handlerShutdown = OnShutdown; 1576 Action handlerShutdown = OnShutdown;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 9b29973..cce8b21 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4316,6 +4316,7 @@ namespace OpenSim.Region.Framework.Scenes
4316 } 4316 }
4317 4317
4318 PhysActor = pa; 4318 PhysActor = pa;
4319 ParentGroup.Scene.EventManager.TriggerObjectAddedToPhysicalScene(this);
4319 } 4320 }
4320 4321
4321 /// <summary> 4322 /// <summary>
@@ -4328,6 +4329,7 @@ namespace OpenSim.Region.Framework.Scenes
4328 /// </remarks> 4329 /// </remarks>
4329 public void RemoveFromPhysics() 4330 public void RemoveFromPhysics()
4330 { 4331 {
4332 ParentGroup.Scene.EventManager.TriggerObjectRemovedFromPhysicalScene(this);
4331 ParentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); 4333 ParentGroup.Scene.PhysicsScene.RemovePrim(PhysActor);
4332 PhysActor = null; 4334 PhysActor = null;
4333 } 4335 }