diff options
author | Melanie Thielker | 2008-09-23 20:02:32 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-23 20:02:32 +0000 |
commit | 88277366bf2cad50947c55d1bf6bf6115ec98fe5 (patch) | |
tree | 2788e3338deee3e639f76e5a3dbe349c30174645 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs | |
parent | * OGP GET, look for Accept header application/llsd+xml with an optional ?q= (diff) | |
download | opensim-SC-88277366bf2cad50947c55d1bf6bf6115ec98fe5.zip opensim-SC-88277366bf2cad50947c55d1bf6bf6115ec98fe5.tar.gz opensim-SC-88277366bf2cad50947c55d1bf6bf6115ec98fe5.tar.bz2 opensim-SC-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/ScriptManager.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs | 29 |
1 files changed, 13 insertions, 16 deletions
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 | } |