aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2009-04-11 16:51:27 +0000
committerMelanie Thielker2009-04-11 16:51:27 +0000
commit217b2d93ae77925e9ebbb0ef3e9b44d47e4234db (patch)
treedabfaa379dec57167e8a34a67f1089d2c2bd367f
parent* Minor MRM Cleanup (diff)
downloadopensim-SC_OLD-217b2d93ae77925e9ebbb0ef3e9b44d47e4234db.zip
opensim-SC_OLD-217b2d93ae77925e9ebbb0ef3e9b44d47e4234db.tar.gz
opensim-SC_OLD-217b2d93ae77925e9ebbb0ef3e9b44d47e4234db.tar.bz2
opensim-SC_OLD-217b2d93ae77925e9ebbb0ef3e9b44d47e4234db.tar.xz
Adding a script event, changed(CHANGED_ANIMATION)
This is sent to all root prims of all attachments of an avatar when the animation state changes. llGetAnimation() can thenbe used to find the new movement animation. This eliminates the need for fast timers in AOs
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs23
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs9
5 files changed, 42 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index 7d7f904..51dcb7d 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -38,5 +38,6 @@ namespace OpenSim.Region.Framework.Interfaces
38 string GetXMLState(UUID itemID); 38 string GetXMLState(UUID itemID);
39 39
40 bool PostScriptEvent(UUID itemID, string name, Object[] args); 40 bool PostScriptEvent(UUID itemID, string name, Object[] args);
41 bool PostObjectEvent(UUID itemID, string name, Object[] args);
41 } 42 }
42} 43}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 2c316a6..d06c583 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -223,6 +223,8 @@ namespace OpenSim.Region.Framework.Scenes
223 string m_callbackURI; 223 string m_callbackURI;
224 ulong m_rootRegionHandle; 224 ulong m_rootRegionHandle;
225 225
226 private IScriptModule[] m_scriptEngines;
227
226 #region Properties 228 #region Properties
227 229
228 /// <summary> 230 /// <summary>
@@ -585,6 +587,8 @@ namespace OpenSim.Region.Framework.Scenes
585 if (gm != null) 587 if (gm != null)
586 m_grouptitle = gm.GetGroupTitle(m_uuid); 588 m_grouptitle = gm.GetGroupTitle(m_uuid);
587 589
590 m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
591
588 AbsolutePosition = m_controllingClient.StartPos; 592 AbsolutePosition = m_controllingClient.StartPos;
589 AdjustKnownSeeds(); 593 AdjustKnownSeeds();
590 594
@@ -1943,7 +1947,24 @@ namespace OpenSim.Region.Framework.Scenes
1943 1947
1944 if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero)) 1948 if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero))
1945 { 1949 {
1946 SendAnimPack(); 1950 if (m_scriptEngines != null)
1951 {
1952 lock (m_attachments)
1953 {
1954 foreach (SceneObjectGroup grp in m_attachments)
1955 {
1956 // 16384 is CHANGED_ANIMATION
1957 //
1958 // Send this to all attachment root prims
1959 //
1960 foreach (IScriptModule m in m_scriptEngines)
1961 {
1962 m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] {16384});
1963 }
1964 SendAnimPack();
1965 }
1966 }
1967 }
1947 } 1968 }
1948 } 1969 }
1949 1970
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index 34a7c7a..c3b52df 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -222,6 +222,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
222 return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); 222 return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0]));
223 } 223 }
224 224
225 public bool PostObjectEvent(UUID itemID, string name, Object[] p)
226 {
227 SceneObjectPart part = m_Scene.GetSceneObjectPart(itemID);
228 if (part == null)
229 return false;
230
231 return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0]));
232 }
233
225 public DetectParams GetDetectParams(UUID itemID, int number) 234 public DetectParams GetDetectParams(UUID itemID, int number)
226 { 235 {
227 uint localID = m_ScriptManager.GetLocalID(itemID); 236 uint localID = m_ScriptManager.GetLocalID(itemID);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 5969a43..c9777ad 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -268,6 +268,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
268 public const int CHANGED_REGION_RESTART = 256; 268 public const int CHANGED_REGION_RESTART = 256;
269 public const int CHANGED_REGION = 512; 269 public const int CHANGED_REGION = 512;
270 public const int CHANGED_TELEPORT = 1024; 270 public const int CHANGED_TELEPORT = 1024;
271 public const int CHANGED_ANIMATION = 16384;
271 public const int TYPE_INVALID = 0; 272 public const int TYPE_INVALID = 0;
272 public const int TYPE_INTEGER = 1; 273 public const int TYPE_INTEGER = 1;
273 public const int TYPE_FLOAT = 2; 274 public const int TYPE_FLOAT = 2;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 037c494..f47e57d 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -938,6 +938,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
938 return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); 938 return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0]));
939 } 939 }
940 940
941 public bool PostObjectEvent(UUID itemID, string name, Object[] p)
942 {
943 SceneObjectPart part = m_Scene.GetSceneObjectPart(itemID);
944 if (part == null)
945 return false;
946
947 return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0]));
948 }
949
941 public Assembly OnAssemblyResolve(object sender, 950 public Assembly OnAssemblyResolve(object sender,
942 ResolveEventArgs args) 951 ResolveEventArgs args)
943 { 952 {