aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-23 20:02:32 +0000
committerMelanie Thielker2008-09-23 20:02:32 +0000
commit88277366bf2cad50947c55d1bf6bf6115ec98fe5 (patch)
tree2788e3338deee3e639f76e5a3dbe349c30174645 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase
parent* OGP GET, look for Accept header application/llsd+xml with an optional ?q= (diff)
downloadopensim-SC_OLD-88277366bf2cad50947c55d1bf6bf6115ec98fe5.zip
opensim-SC_OLD-88277366bf2cad50947c55d1bf6bf6115ec98fe5.tar.gz
opensim-SC_OLD-88277366bf2cad50947c55d1bf6bf6115ec98fe5.tar.bz2
opensim-SC_OLD-88277366bf2cad50947c55d1bf6bf6115ec98fe5.tar.xz
Switches the direct event postings in the API file over to the Shared/
new style of parameter passing, using the IEventReceiver interface.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs29
3 files changed, 21 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
index ac0ab7e..8538c13 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
@@ -355,10 +355,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
355 /// <param name="param">Array of parameters to match event mask</param> 355 /// <param name="param">Array of parameters to match event mask</param>
356 public bool AddToScriptQueue(uint localID, UUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) 356 public bool AddToScriptQueue(uint localID, UUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param)
357 { 357 {
358 List<UUID> keylist = new List<UUID>(m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID)); 358 List<UUID> keylist = m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID);
359 359
360System.Console.WriteLine("==> got {0} keys", keylist.Count);
360 if (!keylist.Contains(itemID)) // We don't manage that script 361 if (!keylist.Contains(itemID)) // We don't manage that script
362 {
363System.Console.WriteLine("==> Script not found");
361 return false; 364 return false;
365 }
362 366
363 lock (eventQueue) 367 lock (eventQueue)
364 { 368 {
@@ -379,6 +383,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
379 383
380 // Add it to queue 384 // Add it to queue
381 eventQueue.Enqueue(QIS); 385 eventQueue.Enqueue(QIS);
386System.Console.WriteLine("==> PostedEvent");
382 } 387 }
383 return true; 388 return true;
384 } 389 }
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
index 79f521d..01af0af 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
@@ -197,7 +197,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
197 197
198 public bool PostScriptEvent(UUID itemID, EventParams p) 198 public bool PostScriptEvent(UUID itemID, EventParams p)
199 { 199 {
200 return m_EventQueueManager.AddToScriptQueue(0, itemID, p.EventName, EventQueueManager.llDetectNull, p.Params); 200 uint localID = m_ScriptManager.GetLocalID(itemID);
201 return m_EventQueueManager.AddToScriptQueue(localID, itemID, p.EventName, EventQueueManager.llDetectNull, p.Params);
201 } 202 }
202 203
203 #endregion 204 #endregion
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
index 8d4dc56..ff8e16f 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
@@ -341,6 +341,16 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
341 Script.Exec.ExecuteEvent(FunctionName, args); 341 Script.Exec.ExecuteEvent(FunctionName, args);
342 } 342 }
343 343
344 public uint GetLocalID(UUID itemID)
345 {
346 foreach (KeyValuePair<uint, Dictionary<UUID, IScript> > k in Scripts)
347 {
348 if (k.Value.ContainsKey(itemID))
349 return k.Key;
350 }
351 return 0;
352 }
353
344 public int GetStateEventFlags(uint localID, UUID itemID) 354 public int GetStateEventFlags(uint localID, UUID itemID)
345 { 355 {
346 // Console.WriteLine("GetStateEventFlags for <" + localID + "," + itemID + ">"); 356 // Console.WriteLine("GetStateEventFlags for <" + localID + "," + itemID + ">");
@@ -368,22 +378,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
368 378
369 public List<UUID> GetScriptKeys(uint localID) 379 public List<UUID> GetScriptKeys(uint localID)
370 { 380 {
371 if (localID == 0) // Find it
372 {
373 List<UUID> keylist = new List<UUID>();
374
375 foreach (Dictionary<UUID, IScript> d in Scripts.Values)
376 {
377 foreach (UUID id in d.Keys)
378 {
379 if (!keylist.Contains(id))
380 keylist.Add(id);
381 }
382 }
383 }
384
385 if (Scripts.ContainsKey(localID) == false) 381 if (Scripts.ContainsKey(localID) == false)
386 return null; 382 return new List<UUID>();
387 383
388 Dictionary<UUID, IScript> Obj; 384 Dictionary<UUID, IScript> Obj;
389 Scripts.TryGetValue(localID, out Obj); 385 Scripts.TryGetValue(localID, out Obj);
@@ -395,6 +391,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
395 { 391 {
396 lock (scriptLock) 392 lock (scriptLock)
397 { 393 {
394 IScript Script = null;
395
398 if (Scripts.ContainsKey(localID) == false) 396 if (Scripts.ContainsKey(localID) == false)
399 return null; 397 return null;
400 398
@@ -404,7 +402,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
404 return null; 402 return null;
405 403
406 // Get script 404 // Get script
407 IScript Script;
408 Obj.TryGetValue(itemID, out Script); 405 Obj.TryGetValue(itemID, out Script);
409 return Script; 406 return Script;
410 } 407 }