aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs79
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs)72
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs)342
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/OSSL_ScriptCommands.cs)76
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Dataserver.cs)9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/HttpRequest.cs)14
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Listener.cs)9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs)30
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Timer.cs)7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/XmlRequest.cs)22
10 files changed, 386 insertions, 274 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs
new file mode 100644
index 0000000..f7f2676
--- /dev/null
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Reflection;
32using OpenSim.Region.ScriptEngine.Interfaces;
33
34namespace OpenSim.Region.ScriptEngine.Shared.Api
35{
36 public class ApiManager
37 {
38 private Dictionary<string,Type> m_Apis = new Dictionary<string,Type>();
39
40 public string[] GetApis()
41 {
42 if(m_Apis.Count > 0)
43 {
44 List<string> l = new List<string>(m_Apis.Keys);
45 return l.ToArray();
46 }
47
48 Assembly a = Assembly.GetExecutingAssembly();
49
50 Type[] types = a.GetExportedTypes();
51
52 foreach (Type t in types)
53 {
54 string name = t.ToString();
55 int idx = name.LastIndexOf('.');
56 if(idx != -1)
57 name = name.Substring(idx+1);
58
59 if(name.EndsWith("_Api"))
60 {
61 name = name.Substring(0, name.Length - 4);
62 m_Apis[name] = t;
63 }
64 }
65
66 List<string> ret = new List<string>(m_Apis.Keys);
67 return ret.ToArray();
68 }
69
70 public IScriptApi CreateApi(string api)
71 {
72 if(!m_Apis.ContainsKey(api))
73 return null;
74
75 IScriptApi ret = (IScriptApi)(Activator.CreateInstance(m_Apis[api]));
76 return ret;
77 }
78 }
79}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index fdad5b0..8c967a2 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -32,11 +32,12 @@ using System.Threading;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Region.Environment.Interfaces; 34using OpenSim.Region.Environment.Interfaces;
35using OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins; 35using OpenSim.Region.ScriptEngine.Interfaces;
36using Timer=OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins.Timer; 36using OpenSim.Region.ScriptEngine.Shared;
37using Dataserver=OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins.Dataserver; 37using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
38using Timer=OpenSim.Region.ScriptEngine.Shared.Api.Plugins.Timer;
38 39
39namespace OpenSim.Region.ScriptEngine.XEngine 40namespace OpenSim.Region.ScriptEngine.Shared.Api
40{ 41{
41 /// <summary> 42 /// <summary>
42 /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc. 43 /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc.
@@ -46,18 +47,57 @@ namespace OpenSim.Region.ScriptEngine.XEngine
46 private static Thread cmdHandlerThread; 47 private static Thread cmdHandlerThread;
47 private static int cmdHandlerThreadCycleSleepms; 48 private static int cmdHandlerThreadCycleSleepms;
48 49
49 public XEngine m_ScriptEngine; 50 private static List<AsyncCommandManager> m_Managers = new List<AsyncCommandManager>();
51 public IScriptEngine m_ScriptEngine;
50 52
51 public Dataserver m_Dataserver; 53 private Dataserver m_Dataserver;
52 public Timer m_Timer; 54 private Timer m_Timer;
53 public HttpRequest m_HttpRequest; 55 private HttpRequest m_HttpRequest;
54 public Listener m_Listener; 56 private Listener m_Listener;
55 public SensorRepeat m_SensorRepeat; 57 private SensorRepeat m_SensorRepeat;
56 public XmlRequest m_XmlRequest; 58 private XmlRequest m_XmlRequest;
57 59
58 public AsyncCommandManager(XEngine _ScriptEngine) 60 public Dataserver DataserverPlugin
61 {
62 get { return m_Dataserver; }
63 }
64
65 public Timer TimerPlugin
66 {
67 get { return m_Timer; }
68 }
69
70 public HttpRequest HttpRequestPlugin
71 {
72 get { return m_HttpRequest; }
73 }
74
75 public Listener ListenerPlugin
76 {
77 get { return m_Listener; }
78 }
79
80 public SensorRepeat SensorRepeatPlugin
81 {
82 get { return m_SensorRepeat; }
83 }
84
85 public XmlRequest XmlRequestPlugin
86 {
87 get { return m_XmlRequest; }
88 }
89
90 public AsyncCommandManager[] Managers
91 {
92 get { return m_Managers.ToArray(); }
93 }
94
95 public AsyncCommandManager(IScriptEngine _ScriptEngine)
59 { 96 {
60 m_ScriptEngine = _ScriptEngine; 97 m_ScriptEngine = _ScriptEngine;
98 if(!m_Managers.Contains(this))
99 m_Managers.Add(this);
100
61 ReadConfig(); 101 ReadConfig();
62 102
63 // Create instances of all plugins 103 // Create instances of all plugins
@@ -87,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
87 127
88 public void ReadConfig() 128 public void ReadConfig()
89 { 129 {
90 cmdHandlerThreadCycleSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("AsyncLLCommandLoopms", 100); 130 cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100);
91 } 131 }
92 132
93 ~AsyncCommandManager() 133 ~AsyncCommandManager()
@@ -119,9 +159,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
119 { 159 {
120 Thread.Sleep(cmdHandlerThreadCycleSleepms); 160 Thread.Sleep(cmdHandlerThreadCycleSleepms);
121 161
122 foreach (XEngine xe in XEngine.ScriptEngines) 162 foreach (AsyncCommandManager m in m_Managers)
123 { 163 {
124 xe.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass(); 164 m.DoOneCmdHandlerPass();
125 } 165 }
126 } 166 }
127 } 167 }
@@ -131,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
131 } 171 }
132 } 172 }
133 173
134 internal void DoOneCmdHandlerPass() 174 public void DoOneCmdHandlerPass()
135 { 175 {
136 // Check timers 176 // Check timers
137 m_Timer.CheckTimerEvents(); 177 m_Timer.CheckTimerEvents();
diff --git a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 9c660c1..7832633 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/LSL_ScriptCommands.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -41,65 +41,50 @@ using OpenSim.Region.Environment.Interfaces;
41using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; 41using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney;
42using OpenSim.Region.Environment.Modules.World.Land; 42using OpenSim.Region.Environment.Modules.World.Land;
43using OpenSim.Region.Environment.Scenes; 43using OpenSim.Region.Environment.Scenes;
44using OpenSim.Region.ScriptEngine.XEngine; 44using OpenSim.Region.ScriptEngine.Shared;
45using OpenSim.Region.ScriptEngine.XEngine.Script; 45using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
46using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
47using OpenSim.Region.ScriptEngine.Interfaces;
48using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
46 49
47 50namespace OpenSim.Region.ScriptEngine.Shared.Api
48namespace OpenSim.Region.ScriptEngine.XEngine
49{ 51{
50 /// <summary> 52 /// <summary>
51 /// Contains all LSL ll-functions. This class will be in Default AppDomain. 53 /// Contains all LSL ll-functions. This class will be in Default AppDomain.
52 /// </summary> 54 /// </summary>
53 public class LSL_ScriptCommands : MarshalByRefObject, ILSL_ScriptCommands 55 public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi
54 { 56 {
55 // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 57 // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
56 58
57 internal XEngine m_ScriptEngine; 59 internal IScriptEngine m_ScriptEngine;
58 internal XScriptInstance m_Instance;
59 internal SceneObjectPart m_host; 60 internal SceneObjectPart m_host;
60 internal uint m_localID; 61 internal uint m_localID;
61 internal LLUUID m_itemID; 62 internal LLUUID m_itemID;
62 internal bool throwErrorOnNotImplemented = true; 63 internal bool throwErrorOnNotImplemented = true;
64 internal static AsyncCommandManager AsyncCommands = null;
63 65
64 public LSL_ScriptCommands(XEngine ScriptEngine, XScriptInstance instance, SceneObjectPart host, uint localID, LLUUID itemID) 66 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID)
65 { 67 {
66 m_ScriptEngine = ScriptEngine; 68 m_ScriptEngine = ScriptEngine;
67 m_Instance = instance;
68 m_host = host; 69 m_host = host;
69 m_localID = localID; 70 m_localID = localID;
70 m_itemID = itemID; 71 m_itemID = itemID;
71 72
72 //m_log.Info(ScriptEngineName, "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); 73 AsyncCommands = (AsyncCommandManager)ScriptEngine.AsyncCommands;
73 } 74 }
74 75
75 private DateTime m_timer = DateTime.Now; 76 private DateTime m_timer = DateTime.Now;
76 private string m_state = "default";
77 private bool m_waitingForScriptAnswer=false; 77 private bool m_waitingForScriptAnswer=false;
78 78
79 79
80 public string State
81 {
82 get { return m_Instance.State; }
83 set { m_Instance.State = value; }
84 }
85
86 public void state(string newState)
87 {
88 m_Instance.SetState(newState);
89 }
90
91 // Object never expires 80 // Object never expires
92 public override Object InitializeLifetimeService() 81 public override Object InitializeLifetimeService()
93 { 82 {
94 //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()");
95 // return null;
96 ILease lease = (ILease)base.InitializeLifetimeService(); 83 ILease lease = (ILease)base.InitializeLifetimeService();
97 84
98 if (lease.CurrentState == LeaseState.Initial) 85 if (lease.CurrentState == LeaseState.Initial)
99 { 86 {
100 lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); 87 lease.InitialLeaseTime = TimeSpan.Zero;
101 // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
102 // lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
103 } 88 }
104 return lease; 89 return lease;
105 } 90 }
@@ -109,6 +94,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
109 get { return m_ScriptEngine.World; } 94 get { return m_ScriptEngine.World; }
110 } 95 }
111 96
97 public void state(string newState)
98 {
99 m_ScriptEngine.SetState(m_itemID, newState);
100 }
101
112 public void llSay(int channelID, string text) 102 public void llSay(int channelID, string text)
113 { 103 {
114 m_host.AddScriptLPS(1); 104 m_host.AddScriptLPS(1);
@@ -501,7 +491,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
501 LLUUID keyID = LLUUID.Zero; 491 LLUUID keyID = LLUUID.Zero;
502 LLUUID.TryParse(id, out keyID); 492 LLUUID.TryParse(id, out keyID);
503 493
504 m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); 494 AsyncCommands.SensorRepeatPlugin.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host);
505 } 495 }
506 496
507 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) 497 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
@@ -510,13 +500,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
510 LLUUID keyID = LLUUID.Zero; 500 LLUUID keyID = LLUUID.Zero;
511 LLUUID.TryParse(id, out keyID); 501 LLUUID.TryParse(id, out keyID);
512 502
513 m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); 503 AsyncCommands.SensorRepeatPlugin.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host);
514 } 504 }
515 505
516 public void llSensorRemove() 506 public void llSensorRemove()
517 { 507 {
518 m_host.AddScriptLPS(1); 508 m_host.AddScriptLPS(1);
519 m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.UnSetSenseRepeaterEvents(m_localID, m_itemID); 509 AsyncCommands.SensorRepeatPlugin.UnSetSenseRepeaterEvents(m_localID, m_itemID);
520 } 510 }
521 511
522 public string resolveName(LLUUID objecUUID) 512 public string resolveName(LLUUID objecUUID)
@@ -550,7 +540,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
550 public string llDetectedName(int number) 540 public string llDetectedName(int number)
551 { 541 {
552 m_host.AddScriptLPS(1); 542 m_host.AddScriptLPS(1);
553 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 543 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
554 if (d == null) 544 if (d == null)
555 return String.Empty; 545 return String.Empty;
556 return d.Name; 546 return d.Name;
@@ -559,7 +549,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
559 public string llDetectedKey(int number) 549 public string llDetectedKey(int number)
560 { 550 {
561 m_host.AddScriptLPS(1); 551 m_host.AddScriptLPS(1);
562 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 552 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
563 if (d == null) 553 if (d == null)
564 return String.Empty; 554 return String.Empty;
565 return d.Key.ToString(); 555 return d.Key.ToString();
@@ -568,7 +558,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
568 public string llDetectedOwner(int number) 558 public string llDetectedOwner(int number)
569 { 559 {
570 m_host.AddScriptLPS(1); 560 m_host.AddScriptLPS(1);
571 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 561 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
572 if (d == null) 562 if (d == null)
573 return String.Empty; 563 return String.Empty;
574 return d.Owner.ToString(); 564 return d.Owner.ToString();
@@ -577,7 +567,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
577 public LSL_Types.LSLInteger llDetectedType(int number) 567 public LSL_Types.LSLInteger llDetectedType(int number)
578 { 568 {
579 m_host.AddScriptLPS(1); 569 m_host.AddScriptLPS(1);
580 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 570 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
581 if (d == null) 571 if (d == null)
582 return 0; 572 return 0;
583 return new LSL_Types.LSLInteger(d.Type); 573 return new LSL_Types.LSLInteger(d.Type);
@@ -586,7 +576,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
586 public LSL_Types.Vector3 llDetectedPos(int number) 576 public LSL_Types.Vector3 llDetectedPos(int number)
587 { 577 {
588 m_host.AddScriptLPS(1); 578 m_host.AddScriptLPS(1);
589 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 579 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
590 if (d == null) 580 if (d == null)
591 return new LSL_Types.Vector3(); 581 return new LSL_Types.Vector3();
592 return d.Position; 582 return d.Position;
@@ -595,7 +585,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
595 public LSL_Types.Vector3 llDetectedVel(int number) 585 public LSL_Types.Vector3 llDetectedVel(int number)
596 { 586 {
597 m_host.AddScriptLPS(1); 587 m_host.AddScriptLPS(1);
598 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 588 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
599 if (d == null) 589 if (d == null)
600 return new LSL_Types.Vector3(); 590 return new LSL_Types.Vector3();
601 return d.Velocity; 591 return d.Velocity;
@@ -604,7 +594,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
604 public LSL_Types.Vector3 llDetectedGrab(int number) 594 public LSL_Types.Vector3 llDetectedGrab(int number)
605 { 595 {
606 m_host.AddScriptLPS(1); 596 m_host.AddScriptLPS(1);
607 XDetectParams parms = m_ScriptEngine.GetDetectParams(m_itemID, number); 597 DetectParams parms = m_ScriptEngine.GetDetectParams(m_itemID, number);
608 if (parms == null) 598 if (parms == null)
609 return new LSL_Types.Vector3(0, 0, 0); 599 return new LSL_Types.Vector3(0, 0, 0);
610 600
@@ -614,7 +604,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
614 public LSL_Types.Quaternion llDetectedRot(int number) 604 public LSL_Types.Quaternion llDetectedRot(int number)
615 { 605 {
616 m_host.AddScriptLPS(1); 606 m_host.AddScriptLPS(1);
617 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 607 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
618 if (d == null) 608 if (d == null)
619 return new LSL_Types.Quaternion(); 609 return new LSL_Types.Quaternion();
620 return d.Rotation; 610 return d.Rotation;
@@ -623,7 +613,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
623 public LSL_Types.LSLInteger llDetectedGroup(int number) 613 public LSL_Types.LSLInteger llDetectedGroup(int number)
624 { 614 {
625 m_host.AddScriptLPS(1); 615 m_host.AddScriptLPS(1);
626 XDetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); 616 DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number);
627 if (d == null) 617 if (d == null)
628 return new LSL_Types.LSLInteger(0); 618 return new LSL_Types.LSLInteger(0);
629 if (m_host.GroupID == d.Group) 619 if (m_host.GroupID == d.Group)
@@ -634,7 +624,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
634 public LSL_Types.LSLInteger llDetectedLinkNumber(int number) 624 public LSL_Types.LSLInteger llDetectedLinkNumber(int number)
635 { 625 {
636 m_host.AddScriptLPS(1); 626 m_host.AddScriptLPS(1);
637 XDetectParams parms = m_ScriptEngine.GetDetectParams(m_itemID, number); 627 DetectParams parms = m_ScriptEngine.GetDetectParams(m_itemID, number);
638 if (parms == null) 628 if (parms == null)
639 return new LSL_Types.LSLInteger(0); 629 return new LSL_Types.LSLInteger(0);
640 630
@@ -675,7 +665,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
675 665
676 int statusrotationaxis = 0; 666 int statusrotationaxis = 0;
677 667
678 if ((status & BuiltIn_Commands_BaseClass.STATUS_PHYSICS) == BuiltIn_Commands_BaseClass.STATUS_PHYSICS) 668 if ((status & ScriptBaseClass.STATUS_PHYSICS) == ScriptBaseClass.STATUS_PHYSICS)
679 { 669 {
680 if (value == 1) 670 if (value == 1)
681 m_host.ScriptSetPhysicsStatus(true); 671 m_host.ScriptSetPhysicsStatus(true);
@@ -683,7 +673,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
683 m_host.ScriptSetPhysicsStatus(false); 673 m_host.ScriptSetPhysicsStatus(false);
684 } 674 }
685 675
686 if ((status & BuiltIn_Commands_BaseClass.STATUS_PHANTOM) == BuiltIn_Commands_BaseClass.STATUS_PHANTOM) 676 if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM)
687 { 677 {
688 if (value == 1) 678 if (value == 1)
689 m_host.ScriptSetPhantomStatus(true); 679 m_host.ScriptSetPhantomStatus(true);
@@ -691,32 +681,32 @@ namespace OpenSim.Region.ScriptEngine.XEngine
691 m_host.ScriptSetPhantomStatus(false); 681 m_host.ScriptSetPhantomStatus(false);
692 } 682 }
693 683
694 if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) 684 if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS)
695 { 685 {
696 m_host.AddFlag(LLObject.ObjectFlags.CastShadows); 686 m_host.AddFlag(LLObject.ObjectFlags.CastShadows);
697 } 687 }
698 688
699 if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) 689 if ((status & ScriptBaseClass.STATUS_ROTATE_X) == ScriptBaseClass.STATUS_ROTATE_X)
700 { 690 {
701 statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X; 691 statusrotationaxis |= ScriptBaseClass.STATUS_ROTATE_X;
702 } 692 }
703 693
704 if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) 694 if ((status & ScriptBaseClass.STATUS_ROTATE_Y) == ScriptBaseClass.STATUS_ROTATE_Y)
705 { 695 {
706 statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y; 696 statusrotationaxis |= ScriptBaseClass.STATUS_ROTATE_Y;
707 } 697 }
708 698
709 if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) 699 if ((status & ScriptBaseClass.STATUS_ROTATE_Z) == ScriptBaseClass.STATUS_ROTATE_Z)
710 { 700 {
711 statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z; 701 statusrotationaxis |= ScriptBaseClass.STATUS_ROTATE_Z;
712 } 702 }
713 703
714 if ((status & BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) == BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) 704 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB)
715 { 705 {
716 NotImplemented("llSetStatus - STATUS_BLOCK_GRAB"); 706 NotImplemented("llSetStatus - STATUS_BLOCK_GRAB");
717 } 707 }
718 708
719 if ((status & BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) 709 if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE)
720 { 710 {
721 if (value == 1) 711 if (value == 1)
722 m_host.SetDieAtEdge(true); 712 m_host.SetDieAtEdge(true);
@@ -724,12 +714,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
724 m_host.SetDieAtEdge(false); 714 m_host.SetDieAtEdge(false);
725 } 715 }
726 716
727 if ((status & BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) 717 if ((status & ScriptBaseClass.STATUS_RETURN_AT_EDGE) == ScriptBaseClass.STATUS_RETURN_AT_EDGE)
728 { 718 {
729 NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE"); 719 NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE");
730 } 720 }
731 721
732 if ((status & BuiltIn_Commands_BaseClass.STATUS_SANDBOX) == BuiltIn_Commands_BaseClass.STATUS_SANDBOX) 722 if ((status & ScriptBaseClass.STATUS_SANDBOX) == ScriptBaseClass.STATUS_SANDBOX)
733 { 723 {
734 NotImplemented("llSetStatus - STATUS_SANDBOX"); 724 NotImplemented("llSetStatus - STATUS_SANDBOX");
735 } 725 }
@@ -746,54 +736,54 @@ namespace OpenSim.Region.ScriptEngine.XEngine
746 // Console.WriteLine(m_host.UUID.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); 736 // Console.WriteLine(m_host.UUID.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString());
747 switch (status) 737 switch (status)
748 { 738 {
749 case BuiltIn_Commands_BaseClass.STATUS_PHYSICS: 739 case ScriptBaseClass.STATUS_PHYSICS:
750 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == (uint)LLObject.ObjectFlags.Physics) 740 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == (uint)LLObject.ObjectFlags.Physics)
751 { 741 {
752 return 1; 742 return 1;
753 } 743 }
754 return 0; 744 return 0;
755 745
756 case BuiltIn_Commands_BaseClass.STATUS_PHANTOM: 746 case ScriptBaseClass.STATUS_PHANTOM:
757 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom) 747 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom)
758 { 748 {
759 return 1; 749 return 1;
760 } 750 }
761 return 0; 751 return 0;
762 752
763 case BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS: 753 case ScriptBaseClass.STATUS_CAST_SHADOWS:
764 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows) 754 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows)
765 { 755 {
766 return 1; 756 return 1;
767 } 757 }
768 return 0; 758 return 0;
769 759
770 case BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB: 760 case ScriptBaseClass.STATUS_BLOCK_GRAB:
771 NotImplemented("llGetStatus - STATUS_BLOCK_GRAB"); 761 NotImplemented("llGetStatus - STATUS_BLOCK_GRAB");
772 return 0; 762 return 0;
773 763
774 case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE: 764 case ScriptBaseClass.STATUS_DIE_AT_EDGE:
775 if (m_host.GetDieAtEdge()) 765 if (m_host.GetDieAtEdge())
776 return 1; 766 return 1;
777 else 767 else
778 return 0; 768 return 0;
779 769
780 case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE: 770 case ScriptBaseClass.STATUS_RETURN_AT_EDGE:
781 NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); 771 NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE");
782 return 0; 772 return 0;
783 773
784 case BuiltIn_Commands_BaseClass.STATUS_ROTATE_X: 774 case ScriptBaseClass.STATUS_ROTATE_X:
785 NotImplemented("llGetStatus - STATUS_ROTATE_X"); 775 NotImplemented("llGetStatus - STATUS_ROTATE_X");
786 return 0; 776 return 0;
787 777
788 case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y: 778 case ScriptBaseClass.STATUS_ROTATE_Y:
789 NotImplemented("llGetStatus - STATUS_ROTATE_Y"); 779 NotImplemented("llGetStatus - STATUS_ROTATE_Y");
790 return 0; 780 return 0;
791 781
792 case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z: 782 case ScriptBaseClass.STATUS_ROTATE_Z:
793 NotImplemented("llGetStatus - STATUS_ROTATE_Z"); 783 NotImplemented("llGetStatus - STATUS_ROTATE_Z");
794 return 0; 784 return 0;
795 785
796 case BuiltIn_Commands_BaseClass.STATUS_SANDBOX: 786 case ScriptBaseClass.STATUS_SANDBOX:
797 NotImplemented("llGetStatus - STATUS_SANDBOX"); 787 NotImplemented("llGetStatus - STATUS_SANDBOX");
798 return 0; 788 return 0;
799 } 789 }
@@ -1743,7 +1733,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1743 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 1733 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
1744 return 0; 1734 return 0;
1745 1735
1746 if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_DEBIT) == 0) 1736 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0)
1747 { 1737 {
1748 LSLError("No permissions to give money"); 1738 LSLError("No permissions to give money");
1749 return 0; 1739 return 0;
@@ -1840,11 +1830,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1840 // objects rezzed with this method are die_at_edge by default. 1830 // objects rezzed with this method are die_at_edge by default.
1841 new_group.RootPart.SetDieAtEdge(true); 1831 new_group.RootPart.SetDieAtEdge(true);
1842 1832
1843 m_ScriptEngine.PostScriptEvent(m_itemID, new XEventParams( 1833 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
1844 "object_rez", new Object[] { 1834 "object_rez", new Object[] {
1845 new LSL_Types.LSLString( 1835 new LSL_Types.LSLString(
1846 new_group.RootPart.UUID.ToString()) }, 1836 new_group.RootPart.UUID.ToString()) },
1847 new XDetectParams[0])); 1837 new DetectParams[0]));
1848 1838
1849 float groupmass = new_group.GetMass(); 1839 float groupmass = new_group.GetMass();
1850 1840
@@ -1876,7 +1866,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1876 { 1866 {
1877 m_host.AddScriptLPS(1); 1867 m_host.AddScriptLPS(1);
1878 // Setting timer repeat 1868 // Setting timer repeat
1879 m_ScriptEngine.m_ASYNCLSLCommandManager.m_Timer.SetTimerEvent(m_localID, m_itemID, sec); 1869 AsyncCommands.TimerPlugin.SetTimerEvent(m_localID, m_itemID, sec);
1880 } 1870 }
1881 1871
1882 public void llSleep(double sec) 1872 public void llSleep(double sec)
@@ -1910,7 +1900,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1910 1900
1911 if (presence != null) 1901 if (presence != null)
1912 { 1902 {
1913 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) 1903 if ((m_host.TaskInventory[InventorySelf()].PermsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
1914 { 1904 {
1915 presence.RegisterControlEventsToScript(controls, accept, pass_on, m_localID, m_itemID); 1905 presence.RegisterControlEventsToScript(controls, accept, pass_on, m_localID, m_itemID);
1916 1906
@@ -1937,12 +1927,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1937 1927
1938 if (presence != null) 1928 if (presence != null)
1939 { 1929 {
1940 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) 1930 if ((m_host.TaskInventory[InventorySelf()].PermsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
1941 { 1931 {
1942 // Unregister controls from Presence 1932 // Unregister controls from Presence
1943 presence.UnRegisterControlEventsToScript(m_localID, m_itemID); 1933 presence.UnRegisterControlEventsToScript(m_localID, m_itemID);
1944 // Remove Take Control permission. 1934 // Remove Take Control permission.
1945 m_host.TaskInventory[InventorySelf()].PermsMask &= ~BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS; 1935 m_host.TaskInventory[InventorySelf()].PermsMask &= ~ScriptBaseClass.PERMISSION_TAKE_CONTROLS;
1946 } 1936 }
1947 } 1937 }
1948 } 1938 }
@@ -2110,7 +2100,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2110 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 2100 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
2111 return; 2101 return;
2112 2102
2113 if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) 2103 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
2114 { 2104 {
2115 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); 2105 ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter);
2116 2106
@@ -2137,7 +2127,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2137 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 2127 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
2138 return; 2128 return;
2139 2129
2140 if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) 2130 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
2141 { 2131 {
2142 LLUUID animID = new LLUUID(); 2132 LLUUID animID = new LLUUID();
2143 2133
@@ -2212,10 +2202,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2212 m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero; 2202 m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero;
2213 m_host.TaskInventory[invItemID].PermsMask=0; 2203 m_host.TaskInventory[invItemID].PermsMask=0;
2214 2204
2215 m_ScriptEngine.PostScriptEvent(m_itemID, new XEventParams( 2205 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
2216 "run_time_permissions", new Object[] { 2206 "run_time_permissions", new Object[] {
2217 new LSL_Types.LSLInteger(0) }, 2207 new LSL_Types.LSLInteger(0) },
2218 new XDetectParams[0])); 2208 new DetectParams[0]));
2219 2209
2220 return; 2210 return;
2221 } 2211 }
@@ -2225,19 +2215,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2225 if (m_host.ParentGroup.RootPart.m_IsAttachment && agent == m_host.ParentGroup.RootPart.m_attachedAvatar) 2215 if (m_host.ParentGroup.RootPart.m_IsAttachment && agent == m_host.ParentGroup.RootPart.m_attachedAvatar)
2226 { 2216 {
2227 // When attached, certain permissions are implicit if requested from owner 2217 // When attached, certain permissions are implicit if requested from owner
2228 int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS | 2218 int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS |
2229 BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION | 2219 ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION |
2230 BuiltIn_Commands_BaseClass.PERMISSION_ATTACH; 2220 ScriptBaseClass.PERMISSION_ATTACH;
2231 2221
2232 if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms 2222 if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms
2233 { 2223 {
2234 m_host.TaskInventory[invItemID].PermsGranter=agentID; 2224 m_host.TaskInventory[invItemID].PermsGranter=agentID;
2235 m_host.TaskInventory[invItemID].PermsMask=perm; 2225 m_host.TaskInventory[invItemID].PermsMask=perm;
2236 2226
2237 m_ScriptEngine.PostScriptEvent(m_itemID, new XEventParams( 2227 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
2238 "run_time_permissions", new Object[] { 2228 "run_time_permissions", new Object[] {
2239 new LSL_Types.LSLInteger(perm) }, 2229 new LSL_Types.LSLInteger(perm) },
2240 new XDetectParams[0])); 2230 new DetectParams[0]));
2241 2231
2242 return; 2232 return;
2243 } 2233 }
@@ -2245,18 +2235,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2245 else if (m_host.m_sitTargetAvatar == agentID) // Sitting avatar 2235 else if (m_host.m_sitTargetAvatar == agentID) // Sitting avatar
2246 { 2236 {
2247 // When agent is sitting, certain permissions are implicit if requested from sitting agent 2237 // When agent is sitting, certain permissions are implicit if requested from sitting agent
2248 int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION | 2238 int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION |
2249 BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA; 2239 ScriptBaseClass.PERMISSION_TRACK_CAMERA;
2250 2240
2251 if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms 2241 if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms
2252 { 2242 {
2253 m_host.TaskInventory[invItemID].PermsGranter=agentID; 2243 m_host.TaskInventory[invItemID].PermsGranter=agentID;
2254 m_host.TaskInventory[invItemID].PermsMask=perm; 2244 m_host.TaskInventory[invItemID].PermsMask=perm;
2255 2245
2256 m_ScriptEngine.PostScriptEvent(m_itemID, new XEventParams( 2246 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
2257 "run_time_permissions", new Object[] { 2247 "run_time_permissions", new Object[] {
2258 new LSL_Types.LSLInteger(perm) }, 2248 new LSL_Types.LSLInteger(perm) },
2259 new XDetectParams[0])); 2249 new DetectParams[0]));
2260 2250
2261 return; 2251 return;
2262 } 2252 }
@@ -2283,10 +2273,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2283 } 2273 }
2284 2274
2285 // Requested agent is not in range, refuse perms 2275 // Requested agent is not in range, refuse perms
2286 m_ScriptEngine.PostScriptEvent(m_itemID, new XEventParams( 2276 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
2287 "run_time_permissions", new Object[] { 2277 "run_time_permissions", new Object[] {
2288 new LSL_Types.LSLInteger(0) }, 2278 new LSL_Types.LSLInteger(0) },
2289 new XDetectParams[0])); 2279 new DetectParams[0]));
2290 } 2280 }
2291 2281
2292 void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer) 2282 void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer)
@@ -2303,10 +2293,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2303 m_waitingForScriptAnswer=false; 2293 m_waitingForScriptAnswer=false;
2304 2294
2305 m_host.TaskInventory[invItemID].PermsMask=answer; 2295 m_host.TaskInventory[invItemID].PermsMask=answer;
2306 m_ScriptEngine.PostScriptEvent(m_itemID, new XEventParams( 2296 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
2307 "run_time_permissions", new Object[] { 2297 "run_time_permissions", new Object[] {
2308 new LSL_Types.LSLInteger(answer) }, 2298 new LSL_Types.LSLInteger(answer) },
2309 new XDetectParams[0])); 2299 new DetectParams[0]));
2310 } 2300 }
2311 2301
2312 public string llGetPermissionsKey() 2302 public string llGetPermissionsKey()
@@ -2631,12 +2621,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2631 2621
2632 LLUUID rq = LLUUID.Random(); 2622 LLUUID rq = LLUUID.Random();
2633 2623
2634 LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. 2624 LLUUID tid = AsyncCommands.
2635 m_Dataserver.RegisterRequest(m_localID, 2625 DataserverPlugin.RegisterRequest(m_localID,
2636 m_itemID, rq.ToString()); 2626 m_itemID, rq.ToString());
2637 2627
2638 m_ScriptEngine.m_ASYNCLSLCommandManager. 2628 AsyncCommands.
2639 m_Dataserver.DataserverReply(rq.ToString(), reply); 2629 DataserverPlugin.DataserverReply(rq.ToString(), reply);
2640 2630
2641 return tid.ToString(); 2631 return tid.ToString();
2642 } 2632 }
@@ -2649,8 +2639,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2649 { 2639 {
2650 if (item.Type == 3 && item.Name == name) 2640 if (item.Type == 3 && item.Name == name)
2651 { 2641 {
2652 LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. 2642 LLUUID tid = AsyncCommands.
2653 m_Dataserver.RegisterRequest(m_localID, 2643 DataserverPlugin.RegisterRequest(m_localID,
2654 m_itemID, item.AssetID.ToString()); 2644 m_itemID, item.AssetID.ToString());
2655 2645
2656 LLVector3 region = new LLVector3( 2646 LLVector3 region = new LLVector3(
@@ -2667,8 +2657,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2667 2657
2668 string reply = region.ToString(); 2658 string reply = region.ToString();
2669 2659
2670 m_ScriptEngine.m_ASYNCLSLCommandManager. 2660 AsyncCommands.
2671 m_Dataserver.DataserverReply(i.ToString(), 2661 DataserverPlugin.DataserverReply(i.ToString(),
2672 reply); 2662 reply);
2673 }, false); 2663 }, false);
2674 2664
@@ -2733,7 +2723,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2733 switch ((int)linknum) 2723 switch ((int)linknum)
2734 { 2724 {
2735 2725
2736 case (int)BuiltIn_Commands_BaseClass.LINK_ROOT: 2726 case (int)ScriptBaseClass.LINK_ROOT:
2737 2727
2738 SceneObjectPart part = m_host.ParentGroup.RootPart; 2728 SceneObjectPart part = m_host.ParentGroup.RootPart;
2739 2729
@@ -2750,14 +2740,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2750 }; 2740 };
2751 2741
2752 m_ScriptEngine.PostScriptEvent(partItemID, 2742 m_ScriptEngine.PostScriptEvent(partItemID,
2753 new XEventParams("link_message", 2743 new EventParams("link_message",
2754 resobj, new XDetectParams[0])); 2744 resobj, new DetectParams[0]));
2755 } 2745 }
2756 } 2746 }
2757 2747
2758 break; 2748 break;
2759 2749
2760 case (int)BuiltIn_Commands_BaseClass.LINK_SET: 2750 case (int)ScriptBaseClass.LINK_SET:
2761 2751
2762 foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) 2752 foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts())
2763 { 2753 {
@@ -2774,15 +2764,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2774 }; 2764 };
2775 2765
2776 m_ScriptEngine.PostScriptEvent(partItemID, 2766 m_ScriptEngine.PostScriptEvent(partItemID,
2777 new XEventParams("link_message", 2767 new EventParams("link_message",
2778 resobj, new XDetectParams[0])); 2768 resobj, new DetectParams[0]));
2779 } 2769 }
2780 } 2770 }
2781 } 2771 }
2782 2772
2783 break; 2773 break;
2784 2774
2785 case (int)BuiltIn_Commands_BaseClass.LINK_ALL_OTHERS: 2775 case (int)ScriptBaseClass.LINK_ALL_OTHERS:
2786 2776
2787 foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) 2777 foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts())
2788 { 2778 {
@@ -2802,8 +2792,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2802 }; 2792 };
2803 2793
2804 m_ScriptEngine.PostScriptEvent(partItemID, 2794 m_ScriptEngine.PostScriptEvent(partItemID,
2805 new XEventParams("link_message", 2795 new EventParams("link_message",
2806 resobj, new XDetectParams[0])); 2796 resobj, new DetectParams[0]));
2807 } 2797 }
2808 } 2798 }
2809 2799
@@ -2812,7 +2802,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2812 2802
2813 break; 2803 break;
2814 2804
2815 case (int)BuiltIn_Commands_BaseClass.LINK_ALL_CHILDREN: 2805 case (int)ScriptBaseClass.LINK_ALL_CHILDREN:
2816 2806
2817 foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) 2807 foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts())
2818 { 2808 {
@@ -2832,8 +2822,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2832 }; 2822 };
2833 2823
2834 m_ScriptEngine.PostScriptEvent(partItemID, 2824 m_ScriptEngine.PostScriptEvent(partItemID,
2835 new XEventParams("link_message", 2825 new EventParams("link_message",
2836 resobj, new XDetectParams[0])); 2826 resobj, new DetectParams[0]));
2837 } 2827 }
2838 } 2828 }
2839 2829
@@ -2842,7 +2832,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2842 2832
2843 break; 2833 break;
2844 2834
2845 case (int)BuiltIn_Commands_BaseClass.LINK_THIS: 2835 case (int)ScriptBaseClass.LINK_THIS:
2846 2836
2847 foreach (TaskInventoryItem item in m_host.TaskInventory.Values) 2837 foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
2848 { 2838 {
@@ -2856,8 +2846,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2856 }; 2846 };
2857 2847
2858 m_ScriptEngine.PostScriptEvent(partItemID, 2848 m_ScriptEngine.PostScriptEvent(partItemID,
2859 new XEventParams("link_message", 2849 new EventParams("link_message",
2860 resobj, new XDetectParams[0])); 2850 resobj, new DetectParams[0]));
2861 } 2851 }
2862 } 2852 }
2863 2853
@@ -2883,8 +2873,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
2883 }; 2873 };
2884 2874
2885 m_ScriptEngine.PostScriptEvent(partItemID, 2875 m_ScriptEngine.PostScriptEvent(partItemID,
2886 new XEventParams("link_message", 2876 new EventParams("link_message",
2887 resObjDef, new XDetectParams[0])); 2877 resObjDef, new DetectParams[0]));
2888 } 2878 }
2889 } 2879 }
2890 2880
@@ -4061,23 +4051,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4061 { 4051 {
4062 switch ((int)rules.Data[i]) 4052 switch ((int)rules.Data[i])
4063 { 4053 {
4064 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_FLAGS: 4054 case (int)ScriptBaseClass.PSYS_PART_FLAGS:
4065 prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)((uint)Convert.ToInt32(rules.Data[i + 1].ToString())); 4055 prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)((uint)Convert.ToInt32(rules.Data[i + 1].ToString()));
4066 break; 4056 break;
4067 4057
4068 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_START_COLOR: 4058 case (int)ScriptBaseClass.PSYS_PART_START_COLOR:
4069 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 4059 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
4070 prules.PartStartColor.R = (float)tempv.x; 4060 prules.PartStartColor.R = (float)tempv.x;
4071 prules.PartStartColor.G = (float)tempv.y; 4061 prules.PartStartColor.G = (float)tempv.y;
4072 prules.PartStartColor.B = (float)tempv.z; 4062 prules.PartStartColor.B = (float)tempv.z;
4073 break; 4063 break;
4074 4064
4075 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_START_ALPHA: 4065 case (int)ScriptBaseClass.PSYS_PART_START_ALPHA:
4076 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4066 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4077 prules.PartStartColor.A = (float)tempf; 4067 prules.PartStartColor.A = (float)tempf;
4078 break; 4068 break;
4079 4069
4080 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_COLOR: 4070 case (int)ScriptBaseClass.PSYS_PART_END_COLOR:
4081 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 4071 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
4082 //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); 4072 //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1);
4083 4073
@@ -4086,36 +4076,36 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4086 prules.PartEndColor.B = (float)tempv.z; 4076 prules.PartEndColor.B = (float)tempv.z;
4087 break; 4077 break;
4088 4078
4089 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_ALPHA: 4079 case (int)ScriptBaseClass.PSYS_PART_END_ALPHA:
4090 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4080 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4091 prules.PartEndColor.A = (float)tempf; 4081 prules.PartEndColor.A = (float)tempf;
4092 break; 4082 break;
4093 4083
4094 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_START_SCALE: 4084 case (int)ScriptBaseClass.PSYS_PART_START_SCALE:
4095 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 4085 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
4096 prules.PartStartScaleX = (float)tempv.x; 4086 prules.PartStartScaleX = (float)tempv.x;
4097 prules.PartStartScaleY = (float)tempv.y; 4087 prules.PartStartScaleY = (float)tempv.y;
4098 break; 4088 break;
4099 4089
4100 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_SCALE: 4090 case (int)ScriptBaseClass.PSYS_PART_END_SCALE:
4101 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 4091 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
4102 prules.PartEndScaleX = (float)tempv.x; 4092 prules.PartEndScaleX = (float)tempv.x;
4103 prules.PartEndScaleY = (float)tempv.y; 4093 prules.PartEndScaleY = (float)tempv.y;
4104 break; 4094 break;
4105 4095
4106 case (int)BuiltIn_Commands_BaseClass.PSYS_PART_MAX_AGE: 4096 case (int)ScriptBaseClass.PSYS_PART_MAX_AGE:
4107 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4097 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4108 prules.PartMaxAge = (float)tempf; 4098 prules.PartMaxAge = (float)tempf;
4109 break; 4099 break;
4110 4100
4111 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_ACCEL: 4101 case (int)ScriptBaseClass.PSYS_SRC_ACCEL:
4112 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 4102 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
4113 prules.PartAcceleration.X = (float)tempv.x; 4103 prules.PartAcceleration.X = (float)tempv.x;
4114 prules.PartAcceleration.Y = (float)tempv.y; 4104 prules.PartAcceleration.Y = (float)tempv.y;
4115 prules.PartAcceleration.Z = (float)tempv.z; 4105 prules.PartAcceleration.Z = (float)tempv.z;
4116 break; 4106 break;
4117 4107
4118 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_PATTERN: 4108 case (int)ScriptBaseClass.PSYS_SRC_PATTERN:
4119 int tmpi = int.Parse(rules.Data[i + 1].ToString()); 4109 int tmpi = int.Parse(rules.Data[i + 1].ToString());
4120 prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; 4110 prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
4121 break; 4111 break;
@@ -4124,40 +4114,40 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4124 // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture 4114 // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture
4125 // "" = default texture. 4115 // "" = default texture.
4126 // 20080530 Updated to remove code duplication 4116 // 20080530 Updated to remove code duplication
4127 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TEXTURE: 4117 case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
4128 prules.Texture = KeyOrName(rules.Data[i + 1].ToString()); 4118 prules.Texture = KeyOrName(rules.Data[i + 1].ToString());
4129 break; 4119 break;
4130 4120
4131 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_RATE: 4121 case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE:
4132 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4122 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4133 prules.BurstRate = (float)tempf; 4123 prules.BurstRate = (float)tempf;
4134 break; 4124 break;
4135 4125
4136 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_PART_COUNT: 4126 case (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT:
4137 prules.BurstPartCount = (byte)Convert.ToByte(rules.Data[i + 1].ToString()); 4127 prules.BurstPartCount = (byte)Convert.ToByte(rules.Data[i + 1].ToString());
4138 break; 4128 break;
4139 4129
4140 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_RADIUS: 4130 case (int)ScriptBaseClass.PSYS_SRC_BURST_RADIUS:
4141 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4131 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4142 prules.BurstRadius = (float)tempf; 4132 prules.BurstRadius = (float)tempf;
4143 break; 4133 break;
4144 4134
4145 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_SPEED_MIN: 4135 case (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MIN:
4146 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4136 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4147 prules.BurstSpeedMin = (float)tempf; 4137 prules.BurstSpeedMin = (float)tempf;
4148 break; 4138 break;
4149 4139
4150 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_SPEED_MAX: 4140 case (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX:
4151 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4141 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4152 prules.BurstSpeedMax = (float)tempf; 4142 prules.BurstSpeedMax = (float)tempf;
4153 break; 4143 break;
4154 4144
4155 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_MAX_AGE: 4145 case (int)ScriptBaseClass.PSYS_SRC_MAX_AGE:
4156 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4146 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4157 prules.MaxAge = (float)tempf; 4147 prules.MaxAge = (float)tempf;
4158 break; 4148 break;
4159 4149
4160 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TARGET_KEY: 4150 case (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY:
4161 LLUUID key = LLUUID.Zero; 4151 LLUUID key = LLUUID.Zero;
4162 if (LLUUID.TryParse(rules.Data[i + 1].ToString(), out key)) 4152 if (LLUUID.TryParse(rules.Data[i + 1].ToString(), out key))
4163 { 4153 {
@@ -4169,7 +4159,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4169 } 4159 }
4170 break; 4160 break;
4171 4161
4172 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_OMEGA: 4162 case (int)ScriptBaseClass.PSYS_SRC_OMEGA:
4173 // AL: This is an assumption, since it is the only thing that would match. 4163 // AL: This is an assumption, since it is the only thing that would match.
4174 tempv = (LSL_Types.Vector3)rules.Data[i + 1]; 4164 tempv = (LSL_Types.Vector3)rules.Data[i + 1];
4175 prules.AngularVelocity.X = (float)tempv.x; 4165 prules.AngularVelocity.X = (float)tempv.x;
@@ -4178,12 +4168,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4178 //cast?? prules.MaxAge = (float)rules[i + 1]; 4168 //cast?? prules.MaxAge = (float)rules[i + 1];
4179 break; 4169 break;
4180 4170
4181 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_ANGLE_BEGIN: 4171 case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
4182 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4172 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4183 prules.InnerAngle = (float)tempf; 4173 prules.InnerAngle = (float)tempf;
4184 break; 4174 break;
4185 4175
4186 case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_ANGLE_END: 4176 case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
4187 tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); 4177 tempf = Convert.ToSingle(rules.Data[i + 1].ToString());
4188 prules.OuterAngle = (float)tempf; 4178 prules.OuterAngle = (float)tempf;
4189 break; 4179 break;
@@ -4444,9 +4434,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
4444 { 4434 {
4445 LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, LLUUID.Zero); 4435 LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, LLUUID.Zero);
4446 object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(LLUUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) }; 4436 object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(LLUUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) };
4447 m_ScriptEngine.PostScriptEvent(m_itemID, new XEventParams( 4437 m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
4448 "remote_data", resobj, 4438 "remote_data", resobj,
4449 new XDetectParams[0])); 4439 new DetectParams[0]));
4450 } 4440 }
4451 } 4441 }
4452 4442
@@ -5472,27 +5462,27 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5472 5462
5473 int permmask = 0; 5463 int permmask = 0;
5474 5464
5475 if (mask == BuiltIn_Commands_BaseClass.MASK_BASE)//0 5465 if (mask == ScriptBaseClass.MASK_BASE)//0
5476 { 5466 {
5477 permmask = (int)m_host.BaseMask; 5467 permmask = (int)m_host.BaseMask;
5478 } 5468 }
5479 5469
5480 else if (mask == BuiltIn_Commands_BaseClass.MASK_OWNER)//1 5470 else if (mask == ScriptBaseClass.MASK_OWNER)//1
5481 { 5471 {
5482 permmask = (int)m_host.OwnerMask; 5472 permmask = (int)m_host.OwnerMask;
5483 } 5473 }
5484 5474
5485 else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2 5475 else if (mask == ScriptBaseClass.MASK_GROUP)//2
5486 { 5476 {
5487 permmask = (int)m_host.GroupMask; 5477 permmask = (int)m_host.GroupMask;
5488 } 5478 }
5489 5479
5490 else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3 5480 else if (mask == ScriptBaseClass.MASK_EVERYONE)//3
5491 { 5481 {
5492 permmask = (int)m_host.EveryoneMask; 5482 permmask = (int)m_host.EveryoneMask;
5493 } 5483 }
5494 5484
5495 else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4 5485 else if (mask == ScriptBaseClass.MASK_NEXT)//4
5496 { 5486 {
5497 permmask = (int)m_host.NextOwnerMask; 5487 permmask = (int)m_host.NextOwnerMask;
5498 } 5488 }
@@ -5511,27 +5501,27 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5511 { 5501 {
5512 if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) 5502 if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID))
5513 { 5503 {
5514 if (mask == BuiltIn_Commands_BaseClass.MASK_BASE)//0 5504 if (mask == ScriptBaseClass.MASK_BASE)//0
5515 { 5505 {
5516 m_host.BaseMask = (uint)value; 5506 m_host.BaseMask = (uint)value;
5517 } 5507 }
5518 5508
5519 else if (mask == BuiltIn_Commands_BaseClass.MASK_OWNER)//1 5509 else if (mask == ScriptBaseClass.MASK_OWNER)//1
5520 { 5510 {
5521 m_host.OwnerMask = (uint)value; 5511 m_host.OwnerMask = (uint)value;
5522 } 5512 }
5523 5513
5524 else if (mask == BuiltIn_Commands_BaseClass.MASK_GROUP)//2 5514 else if (mask == ScriptBaseClass.MASK_GROUP)//2
5525 { 5515 {
5526 m_host.GroupMask = (uint)value; 5516 m_host.GroupMask = (uint)value;
5527 } 5517 }
5528 5518
5529 else if (mask == BuiltIn_Commands_BaseClass.MASK_EVERYONE)//3 5519 else if (mask == ScriptBaseClass.MASK_EVERYONE)//3
5530 { 5520 {
5531 m_host.EveryoneMask = (uint)value; 5521 m_host.EveryoneMask = (uint)value;
5532 } 5522 }
5533 5523
5534 else if (mask == BuiltIn_Commands_BaseClass.MASK_NEXT)//4 5524 else if (mask == ScriptBaseClass.MASK_NEXT)//4
5535 { 5525 {
5536 m_host.NextOwnerMask = (uint)value; 5526 m_host.NextOwnerMask = (uint)value;
5537 } 5527 }
@@ -5635,12 +5625,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5635 } 5625 }
5636 LLUUID rq = LLUUID.Random(); 5626 LLUUID rq = LLUUID.Random();
5637 5627
5638 LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. 5628 LLUUID tid = AsyncCommands.
5639 m_Dataserver.RegisterRequest(m_localID, 5629 DataserverPlugin.RegisterRequest(m_localID,
5640 m_itemID, rq.ToString()); 5630 m_itemID, rq.ToString());
5641 5631
5642 m_ScriptEngine.m_ASYNCLSLCommandManager. 5632 AsyncCommands.
5643 m_Dataserver.DataserverReply(rq.ToString(), reply); 5633 DataserverPlugin.DataserverReply(rq.ToString(), reply);
5644 5634
5645 return tid.ToString(); 5635 return tid.ToString();
5646 } 5636 }
@@ -5943,27 +5933,27 @@ namespace OpenSim.Region.ScriptEngine.XEngine
5943 LSL_Types.list nums = LSL_Types.list.ToDoubleList(src); 5933 LSL_Types.list nums = LSL_Types.list.ToDoubleList(src);
5944 switch (operation) 5934 switch (operation)
5945 { 5935 {
5946 case BuiltIn_Commands_BaseClass.LIST_STAT_RANGE: 5936 case ScriptBaseClass.LIST_STAT_RANGE:
5947 return nums.Range(); 5937 return nums.Range();
5948 case BuiltIn_Commands_BaseClass.LIST_STAT_MIN: 5938 case ScriptBaseClass.LIST_STAT_MIN:
5949 return nums.Min(); 5939 return nums.Min();
5950 case BuiltIn_Commands_BaseClass.LIST_STAT_MAX: 5940 case ScriptBaseClass.LIST_STAT_MAX:
5951 return nums.Max(); 5941 return nums.Max();
5952 case BuiltIn_Commands_BaseClass.LIST_STAT_MEAN: 5942 case ScriptBaseClass.LIST_STAT_MEAN:
5953 return nums.Mean(); 5943 return nums.Mean();
5954 case BuiltIn_Commands_BaseClass.LIST_STAT_MEDIAN: 5944 case ScriptBaseClass.LIST_STAT_MEDIAN:
5955 return nums.Median(); 5945 return nums.Median();
5956 case BuiltIn_Commands_BaseClass.LIST_STAT_NUM_COUNT: 5946 case ScriptBaseClass.LIST_STAT_NUM_COUNT:
5957 return nums.NumericLength(); 5947 return nums.NumericLength();
5958 case BuiltIn_Commands_BaseClass.LIST_STAT_STD_DEV: 5948 case ScriptBaseClass.LIST_STAT_STD_DEV:
5959 return nums.StdDev(); 5949 return nums.StdDev();
5960 case BuiltIn_Commands_BaseClass.LIST_STAT_SUM: 5950 case ScriptBaseClass.LIST_STAT_SUM:
5961 return nums.Sum(); 5951 return nums.Sum();
5962 case BuiltIn_Commands_BaseClass.LIST_STAT_SUM_SQUARES: 5952 case ScriptBaseClass.LIST_STAT_SUM_SQUARES:
5963 return nums.SumSqrs(); 5953 return nums.SumSqrs();
5964 case BuiltIn_Commands_BaseClass.LIST_STAT_GEOMETRIC_MEAN: 5954 case ScriptBaseClass.LIST_STAT_GEOMETRIC_MEAN:
5965 return nums.GeometricMean(); 5955 return nums.GeometricMean();
5966 case BuiltIn_Commands_BaseClass.LIST_STAT_HARMONIC_MEAN: 5956 case ScriptBaseClass.LIST_STAT_HARMONIC_MEAN:
5967 return nums.HarmonicMean(); 5957 return nums.HarmonicMean();
5968 default: 5958 default:
5969 return 0.0; 5959 return 0.0;
@@ -6230,9 +6220,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6230 public string llStringTrim(string src, int type) 6220 public string llStringTrim(string src, int type)
6231 { 6221 {
6232 m_host.AddScriptLPS(1); 6222 m_host.AddScriptLPS(1);
6233 if (type == (int)BuiltIn_Commands_BaseClass.STRING_TRIM_HEAD) { return src.TrimStart(); } 6223 if (type == (int)ScriptBaseClass.STRING_TRIM_HEAD) { return src.TrimStart(); }
6234 if (type == (int)BuiltIn_Commands_BaseClass.STRING_TRIM_TAIL) { return src.TrimEnd(); } 6224 if (type == (int)ScriptBaseClass.STRING_TRIM_TAIL) { return src.TrimEnd(); }
6235 if (type == (int)BuiltIn_Commands_BaseClass.STRING_TRIM) { return src.Trim(); } 6225 if (type == (int)ScriptBaseClass.STRING_TRIM) { return src.Trim(); }
6236 return src; 6226 return src;
6237 } 6227 }
6238 6228
@@ -6331,7 +6321,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6331 6321
6332 internal void ShoutError(string msg) 6322 internal void ShoutError(string msg)
6333 { 6323 {
6334 llShout(BuiltIn_Commands_BaseClass.DEBUG_CHANNEL, msg); 6324 llShout(ScriptBaseClass.DEBUG_CHANNEL, msg);
6335 } 6325 }
6336 6326
6337 6327
@@ -6366,13 +6356,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6366 { 6356 {
6367 if (item.Type == 7 && item.Name == name) 6357 if (item.Type == 7 && item.Name == name)
6368 { 6358 {
6369 LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. 6359 LLUUID tid = AsyncCommands.
6370 m_Dataserver.RegisterRequest(m_localID, 6360 DataserverPlugin.RegisterRequest(m_localID,
6371 m_itemID, item.AssetID.ToString()); 6361 m_itemID, item.AssetID.ToString());
6372 if (NotecardCache.IsCached(item.AssetID)) 6362 if (NotecardCache.IsCached(item.AssetID))
6373 { 6363 {
6374 m_ScriptEngine.m_ASYNCLSLCommandManager. 6364 AsyncCommands.
6375 m_Dataserver.DataserverReply(item.AssetID.ToString(), 6365 DataserverPlugin.DataserverReply(item.AssetID.ToString(),
6376 NotecardCache.GetLines(item.AssetID).ToString()); 6366 NotecardCache.GetLines(item.AssetID).ToString());
6377 return tid.ToString(); 6367 return tid.ToString();
6378 } 6368 }
@@ -6383,8 +6373,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6383 string data = enc.GetString(a.Data); 6373 string data = enc.GetString(a.Data);
6384 //Console.WriteLine(data); 6374 //Console.WriteLine(data);
6385 NotecardCache.Cache(id, data); 6375 NotecardCache.Cache(id, data);
6386 m_ScriptEngine.m_ASYNCLSLCommandManager. 6376 AsyncCommands.
6387 m_Dataserver.DataserverReply(id.ToString(), 6377 DataserverPlugin.DataserverReply(id.ToString(),
6388 NotecardCache.GetLines(id).ToString()); 6378 NotecardCache.GetLines(id).ToString());
6389 }); 6379 });
6390 6380
@@ -6402,13 +6392,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6402 { 6392 {
6403 if (item.Type == 7 && item.Name == name) 6393 if (item.Type == 7 && item.Name == name)
6404 { 6394 {
6405 LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. 6395 LLUUID tid = AsyncCommands.
6406 m_Dataserver.RegisterRequest(m_localID, 6396 DataserverPlugin.RegisterRequest(m_localID,
6407 m_itemID, item.AssetID.ToString()); 6397 m_itemID, item.AssetID.ToString());
6408 if (NotecardCache.IsCached(item.AssetID)) 6398 if (NotecardCache.IsCached(item.AssetID))
6409 { 6399 {
6410 m_ScriptEngine.m_ASYNCLSLCommandManager. 6400 AsyncCommands.
6411 m_Dataserver.DataserverReply(item.AssetID.ToString(), 6401 DataserverPlugin.DataserverReply(item.AssetID.ToString(),
6412 NotecardCache.GetLine(item.AssetID, line)); 6402 NotecardCache.GetLine(item.AssetID, line));
6413 return tid.ToString(); 6403 return tid.ToString();
6414 } 6404 }
@@ -6419,8 +6409,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
6419 string data = enc.GetString(a.Data); 6409 string data = enc.GetString(a.Data);
6420 //Console.WriteLine(data); 6410 //Console.WriteLine(data);
6421 NotecardCache.Cache(id, data); 6411 NotecardCache.Cache(id, data);
6422 m_ScriptEngine.m_ASYNCLSLCommandManager. 6412 AsyncCommands.
6423 m_Dataserver.DataserverReply(id.ToString(), 6413 DataserverPlugin.DataserverReply(id.ToString(),
6424 NotecardCache.GetLine(id, line)); 6414 NotecardCache.GetLine(id, line));
6425 }); 6415 });
6426 6416
diff --git a/OpenSim/Region/ScriptEngine/XEngine/OSSL_ScriptCommands.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index bc4e8ba..dbb78a4 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/OSSL_ScriptCommands.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -31,25 +31,25 @@ using Nini.Config;
31using OpenSim.Framework.Console; 31using OpenSim.Framework.Console;
32using OpenSim.Region.Environment.Interfaces; 32using OpenSim.Region.Environment.Interfaces;
33using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
34using OpenSim.Region.ScriptEngine.XEngine.Script; 34using OpenSim.Region.ScriptEngine.Shared;
35using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
36using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
37using OpenSim.Region.ScriptEngine.Interfaces;
38using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
35 39
36namespace OpenSim.Region.ScriptEngine.XEngine 40namespace OpenSim.Region.ScriptEngine.Shared.Api
37{ 41{
38 [Serializable] 42 [Serializable]
39 public class OSSL_ScriptCommands : MarshalByRefObject, IOSSL_ScriptCommands 43 public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi
40 { 44 {
41 internal XEngine m_ScriptEngine; 45 internal IScriptEngine m_ScriptEngine;
42 internal XScriptInstance m_Instance;
43 internal SceneObjectPart m_host; 46 internal SceneObjectPart m_host;
44 internal uint m_localID; 47 internal uint m_localID;
45 internal LLUUID m_itemID; 48 internal LLUUID m_itemID;
46 49
47 public OSSL_ScriptCommands(XEngine scriptEngine, 50 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID)
48 XScriptInstance instance, SceneObjectPart host,
49 uint localID, LLUUID itemID)
50 { 51 {
51 m_ScriptEngine = scriptEngine; 52 m_ScriptEngine = ScriptEngine;
52 m_Instance = instance;
53 m_host = host; 53 m_host = host;
54 m_localID = localID; 54 m_localID = localID;
55 m_itemID = itemID; 55 m_itemID = itemID;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
62 62
63 public int osTerrainSetHeight(int x, int y, double val) 63 public int osTerrainSetHeight(int x, int y, double val)
64 { 64 {
65 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 65 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
66 { 66 {
67 OSSLError("osTerrainSetHeight: permission denied"); 67 OSSLError("osTerrainSetHeight: permission denied");
68 return 0; 68 return 0;
@@ -85,7 +85,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
85 85
86 public double osTerrainGetHeight(int x, int y) 86 public double osTerrainGetHeight(int x, int y)
87 { 87 {
88 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 88 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
89 { 89 {
90 OSSLError("osTerrainGetHeight: permission denied"); 90 OSSLError("osTerrainGetHeight: permission denied");
91 return 0.0; 91 return 0.0;
@@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
100 100
101 public int osRegionRestart(double seconds) 101 public int osRegionRestart(double seconds)
102 { 102 {
103 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 103 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
104 { 104 {
105 OSSLError("osRegionRestart: permission denied"); 105 OSSLError("osRegionRestart: permission denied");
106 return 0; 106 return 0;
@@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
120 120
121 public void osRegionNotice(string msg) 121 public void osRegionNotice(string msg)
122 { 122 {
123 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 123 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
124 { 124 {
125 OSSLError("osRegionNotice: permission denied"); 125 OSSLError("osRegionNotice: permission denied");
126 return; 126 return;
@@ -132,7 +132,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
132 132
133 public void osSetRot(LLUUID target, Quaternion rotation) 133 public void osSetRot(LLUUID target, Quaternion rotation)
134 { 134 {
135 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 135 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
136 { 136 {
137 OSSLError("osSetRot: permission denied"); 137 OSSLError("osSetRot: permission denied");
138 return; 138 return;
@@ -152,7 +152,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
152 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, 152 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
153 int timer) 153 int timer)
154 { 154 {
155 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 155 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
156 { 156 {
157 OSSLError("osSetDynamicTextureURL: permission denied"); 157 OSSLError("osSetDynamicTextureURL: permission denied");
158 return String.Empty; 158 return String.Empty;
@@ -178,7 +178,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
178 public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, 178 public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
179 int timer, int alpha) 179 int timer, int alpha)
180 { 180 {
181 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 181 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
182 { 182 {
183 OSSLError("osSetDynamicTextureURLBlend: permission denied"); 183 OSSLError("osSetDynamicTextureURLBlend: permission denied");
184 return String.Empty; 184 return String.Empty;
@@ -204,7 +204,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
204 public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, 204 public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams,
205 int timer) 205 int timer)
206 { 206 {
207 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 207 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
208 { 208 {
209 OSSLError("osSetDynamicTextureData: permission denied"); 209 OSSLError("osSetDynamicTextureData: permission denied");
210 return String.Empty; 210 return String.Empty;
@@ -233,7 +233,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
233 public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, 233 public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
234 int timer, int alpha) 234 int timer, int alpha)
235 { 235 {
236 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 236 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
237 { 237 {
238 OSSLError("osSetDynamicTextureDataBlend: permission denied"); 238 OSSLError("osSetDynamicTextureDataBlend: permission denied");
239 return String.Empty; 239 return String.Empty;
@@ -262,7 +262,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
262 public bool osConsoleCommand(string command) 262 public bool osConsoleCommand(string command)
263 { 263 {
264 m_host.AddScriptLPS(1); 264 m_host.AddScriptLPS(1);
265 if (m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowosConsoleCommand", false)) 265 if (m_ScriptEngine.Config.GetBoolean("AllowosConsoleCommand", false))
266 { 266 {
267 if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) 267 if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID))
268 { 268 {
@@ -275,7 +275,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
275 } 275 }
276 public void osSetPrimFloatOnWater(int floatYN) 276 public void osSetPrimFloatOnWater(int floatYN)
277 { 277 {
278 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 278 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
279 { 279 {
280 OSSLError("osSetPrimFloatOnWater: permission denied"); 280 OSSLError("osSetPrimFloatOnWater: permission denied");
281 return; 281 return;
@@ -294,7 +294,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
294 // Adam's super super custom animation functions 294 // Adam's super super custom animation functions
295 public void osAvatarPlayAnimation(string avatar, string animation) 295 public void osAvatarPlayAnimation(string avatar, string animation)
296 { 296 {
297 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 297 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
298 { 298 {
299 OSSLError("osAvatarPlayAnimation: permission denied"); 299 OSSLError("osAvatarPlayAnimation: permission denied");
300 return; 300 return;
@@ -310,7 +310,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
310 310
311 public void osAvatarStopAnimation(string avatar, string animation) 311 public void osAvatarStopAnimation(string avatar, string animation)
312 { 312 {
313 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 313 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
314 { 314 {
315 OSSLError("osAvatarStopAnimation: permission denied"); 315 OSSLError("osAvatarStopAnimation: permission denied");
316 return; 316 return;
@@ -327,7 +327,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
327 //Texture draw functions 327 //Texture draw functions
328 public string osMovePen(string drawList, int x, int y) 328 public string osMovePen(string drawList, int x, int y)
329 { 329 {
330 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 330 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
331 { 331 {
332 OSSLError("osMovePen: permission denied"); 332 OSSLError("osMovePen: permission denied");
333 return String.Empty; 333 return String.Empty;
@@ -340,7 +340,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
340 340
341 public string osDrawLine(string drawList, int startX, int startY, int endX, int endY) 341 public string osDrawLine(string drawList, int startX, int startY, int endX, int endY)
342 { 342 {
343 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 343 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
344 { 344 {
345 OSSLError("osDrawLine: permission denied"); 345 OSSLError("osDrawLine: permission denied");
346 return String.Empty; 346 return String.Empty;
@@ -353,7 +353,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
353 353
354 public string osDrawLine(string drawList, int endX, int endY) 354 public string osDrawLine(string drawList, int endX, int endY)
355 { 355 {
356 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 356 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
357 { 357 {
358 OSSLError("osDrawLine: permission denied"); 358 OSSLError("osDrawLine: permission denied");
359 return String.Empty; 359 return String.Empty;
@@ -366,7 +366,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
366 366
367 public string osDrawText(string drawList, string text) 367 public string osDrawText(string drawList, string text)
368 { 368 {
369 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 369 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
370 { 370 {
371 OSSLError("osDrawText: permission denied"); 371 OSSLError("osDrawText: permission denied");
372 return String.Empty; 372 return String.Empty;
@@ -379,7 +379,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
379 379
380 public string osDrawEllipse(string drawList, int width, int height) 380 public string osDrawEllipse(string drawList, int width, int height)
381 { 381 {
382 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 382 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
383 { 383 {
384 OSSLError("osDrawEllipse: permission denied"); 384 OSSLError("osDrawEllipse: permission denied");
385 return String.Empty; 385 return String.Empty;
@@ -392,7 +392,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
392 392
393 public string osDrawRectangle(string drawList, int width, int height) 393 public string osDrawRectangle(string drawList, int width, int height)
394 { 394 {
395 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 395 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
396 { 396 {
397 OSSLError("osDrawRectangle: permission denied"); 397 OSSLError("osDrawRectangle: permission denied");
398 return String.Empty; 398 return String.Empty;
@@ -405,7 +405,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
405 405
406 public string osDrawFilledRectangle(string drawList, int width, int height) 406 public string osDrawFilledRectangle(string drawList, int width, int height)
407 { 407 {
408 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 408 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
409 { 409 {
410 OSSLError("osDrawFilledRectangle: permission denied"); 410 OSSLError("osDrawFilledRectangle: permission denied");
411 return String.Empty; 411 return String.Empty;
@@ -418,7 +418,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
418 418
419 public string osSetFontSize(string drawList, int fontSize) 419 public string osSetFontSize(string drawList, int fontSize)
420 { 420 {
421 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 421 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
422 { 422 {
423 OSSLError("osSetFontSize: permission denied"); 423 OSSLError("osSetFontSize: permission denied");
424 return String.Empty; 424 return String.Empty;
@@ -431,7 +431,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
431 431
432 public string osSetPenSize(string drawList, int penSize) 432 public string osSetPenSize(string drawList, int penSize)
433 { 433 {
434 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 434 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
435 { 435 {
436 OSSLError("osSetPenSize: permission denied"); 436 OSSLError("osSetPenSize: permission denied");
437 return String.Empty; 437 return String.Empty;
@@ -444,7 +444,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
444 444
445 public string osSetPenColour(string drawList, string colour) 445 public string osSetPenColour(string drawList, string colour)
446 { 446 {
447 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 447 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
448 { 448 {
449 OSSLError("osSetPenColour: permission denied"); 449 OSSLError("osSetPenColour: permission denied");
450 return String.Empty; 450 return String.Empty;
@@ -457,7 +457,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
457 457
458 public string osDrawImage(string drawList, int width, int height, string imageUrl) 458 public string osDrawImage(string drawList, int width, int height, string imageUrl)
459 { 459 {
460 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 460 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
461 { 461 {
462 OSSLError("osDrawImage: permission denied"); 462 OSSLError("osDrawImage: permission denied");
463 return String.Empty; 463 return String.Empty;
@@ -470,7 +470,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
470 470
471 public void osSetStateEvents(int events) 471 public void osSetStateEvents(int events)
472 { 472 {
473 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 473 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
474 { 474 {
475 OSSLError("osSetStateEvents: permission denied"); 475 OSSLError("osSetStateEvents: permission denied");
476 return; 476 return;
@@ -481,7 +481,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
481 481
482 public void osSetRegionWaterHeight(double height) 482 public void osSetRegionWaterHeight(double height)
483 { 483 {
484 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 484 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
485 { 485 {
486 OSSLError("osSetRegionWaterHeight: permission denied"); 486 OSSLError("osSetRegionWaterHeight: permission denied");
487 return; 487 return;
@@ -498,7 +498,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
498 498
499 public double osList2Double(LSL_Types.list src, int index) 499 public double osList2Double(LSL_Types.list src, int index)
500 { 500 {
501 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 501 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
502 { 502 {
503 OSSLError("osList2Double: permission denied"); 503 OSSLError("osList2Double: permission denied");
504 return 0.0; 504 return 0.0;
@@ -518,7 +518,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
518 518
519 public void osSetParcelMediaURL(string url) 519 public void osSetParcelMediaURL(string url)
520 { 520 {
521 if (!m_ScriptEngine.ScriptConfigSource.GetBoolean("AllowOSFunctions", false)) 521 if (!m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
522 { 522 {
523 OSSLError("osSetParcelMediaURL: permission denied"); 523 OSSLError("osSetParcelMediaURL: permission denied");
524 return; 524 return;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
index 47ab420..6c88ae86 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Dataserver.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs
@@ -29,9 +29,10 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using libsecondlife; 31using libsecondlife;
32using OpenSim.Region.ScriptEngine.XEngine.Script; 32using OpenSim.Region.ScriptEngine.Shared;
33using OpenSim.Region.ScriptEngine.Shared.Api;
33 34
34namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins 35namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
35{ 36{
36 public class Dataserver 37 public class Dataserver
37 { 38 {
@@ -94,10 +95,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
94 } 95 }
95 96
96 m_CmdManager.m_ScriptEngine.PostObjectEvent(ds.localID, 97 m_CmdManager.m_ScriptEngine.PostObjectEvent(ds.localID,
97 new XEventParams("dataserver", new Object[] 98 new EventParams("dataserver", new Object[]
98 { new LSL_Types.LSLString(ds.ID.ToString()), 99 { new LSL_Types.LSLString(ds.ID.ToString()),
99 new LSL_Types.LSLString(reply)}, 100 new LSL_Types.LSLString(reply)},
100 new XDetectParams[0])); 101 new DetectParams[0]));
101 } 102 }
102 103
103 public void RemoveEvents(uint localID, LLUUID itemID) 104 public void RemoveEvents(uint localID, LLUUID itemID)
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/HttpRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs
index 089e016..92f603d 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/HttpRequest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs
@@ -28,9 +28,11 @@
28using System; 28using System;
29using OpenSim.Region.Environment.Interfaces; 29using OpenSim.Region.Environment.Interfaces;
30using OpenSim.Region.Environment.Modules.Scripting.HttpRequest; 30using OpenSim.Region.Environment.Modules.Scripting.HttpRequest;
31using OpenSim.Region.ScriptEngine.XEngine.Script; 31using OpenSim.Region.ScriptEngine.Shared;
32using OpenSim.Region.ScriptEngine.Interfaces;
33using OpenSim.Region.ScriptEngine.Shared.Api;
32 34
33namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins 35namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
34{ 36{
35 public class HttpRequest 37 public class HttpRequest
36 { 38 {
@@ -75,11 +77,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
75 new LSL_Types.LSLString(httpInfo.response_body) 77 new LSL_Types.LSLString(httpInfo.response_body)
76 }; 78 };
77 79
78 foreach (XEngine xe in XEngine.ScriptEngines) 80 foreach (AsyncCommandManager m in m_CmdManager.Managers)
79 { 81 {
80 if (xe.PostObjectEvent(httpInfo.localID, 82 if (m.m_ScriptEngine.PostObjectEvent(httpInfo.localID,
81 new XEventParams("http_response", 83 new EventParams("http_response",
82 resobj, new XDetectParams[0]))) 84 resobj, new DetectParams[0])))
83 break; 85 break;
84 } 86 }
85 httpInfo = iHttpReq.GetNextCompletedRequest(); 87 httpInfo = iHttpReq.GetNextCompletedRequest();
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Listener.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
index 1144c00..11b45b1 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Listener.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs
@@ -29,9 +29,10 @@ using System;
29using libsecondlife; 29using libsecondlife;
30using OpenSim.Region.Environment.Interfaces; 30using OpenSim.Region.Environment.Interfaces;
31using OpenSim.Region.Environment.Modules.Scripting.WorldComm; 31using OpenSim.Region.Environment.Modules.Scripting.WorldComm;
32using OpenSim.Region.ScriptEngine.XEngine.Script; 32using OpenSim.Region.ScriptEngine.Shared;
33using OpenSim.Region.ScriptEngine.Shared.Api;
33 34
34namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins 35namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
35{ 36{
36 public class Listener 37 public class Listener
37 { 38 {
@@ -66,9 +67,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
66 }; 67 };
67 68
68 m_CmdManager.m_ScriptEngine.PostScriptEvent( 69 m_CmdManager.m_ScriptEngine.PostScriptEvent(
69 lInfo.GetItemID(), new XEventParams( 70 lInfo.GetItemID(), new EventParams(
70 "listen", resobj, 71 "listen", resobj,
71 new XDetectParams[0])); 72 new DetectParams[0]));
72 } 73 }
73 } 74 }
74 } 75 }
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 8a25098..5833512 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -30,9 +30,10 @@ using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Environment.Scenes; 32using OpenSim.Region.Environment.Scenes;
33using OpenSim.Region.ScriptEngine.XEngine.Script; 33using OpenSim.Region.ScriptEngine.Shared;
34using OpenSim.Region.ScriptEngine.Shared.Api;
34 35
35namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins 36namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
36{ 37{
37 public class SensorRepeat 38 public class SensorRepeat
38 { 39 {
@@ -72,8 +73,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
72 string name, LLUUID keyID, int type, double range, 73 string name, LLUUID keyID, int type, double range,
73 double arc, double sec, SceneObjectPart host) 74 double arc, double sec, SceneObjectPart host)
74 { 75 {
75 Console.WriteLine("SetSensorEvent");
76
77 // Always remove first, in case this is a re-set 76 // Always remove first, in case this is a re-set
78 UnSetSenseRepeaterEvents(m_localID, m_itemID); 77 UnSetSenseRepeaterEvents(m_localID, m_itemID);
79 if (sec == 0) // Disabling timer 78 if (sec == 0) // Disabling timer
@@ -163,7 +162,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
163 Dictionary<LLUUID, LSL_Types.list> Obj = null; 162 Dictionary<LLUUID, LSL_Types.list> Obj = null;
164 if (!SenseEvents.TryGetValue(m_localID, out Obj)) 163 if (!SenseEvents.TryGetValue(m_localID, out Obj))
165 { 164 {
166 m_CmdManager.m_ScriptEngine.Log.Info("[AsyncLSL]: GetSensorList missing localID: " + m_localID);
167 return null; 165 return null;
168 } 166 }
169 lock (Obj) 167 lock (Obj)
@@ -172,7 +170,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
172 LSL_Types.list SenseList = null; 170 LSL_Types.list SenseList = null;
173 if (!Obj.TryGetValue(m_itemID, out SenseList)) 171 if (!Obj.TryGetValue(m_itemID, out SenseList))
174 { 172 {
175 m_CmdManager.m_ScriptEngine.Log.Info("[AsyncLSL]: GetSensorList missing itemID: " + m_itemID);
176 return null; 173 return null;
177 } 174 }
178 return SenseList; 175 return SenseList;
@@ -182,15 +179,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
182 179
183 private void SensorSweep(SenseRepeatClass ts) 180 private void SensorSweep(SenseRepeatClass ts)
184 { 181 {
185 //m_ScriptEngine.Log.Info("[AsyncLSL]:Enter SensorSweep");
186 SceneObjectPart SensePoint = ts.host; 182 SceneObjectPart SensePoint = ts.host;
187 183
188 if (SensePoint == null) 184 if (SensePoint == null)
189 { 185 {
190 //m_ScriptEngine.Log.Info("[AsyncLSL]: Enter SensorSweep (SensePoint == null) for "+ts.itemID.ToString());
191 return; 186 return;
192 } 187 }
193 //m_ScriptEngine.Log.Info("[AsyncLSL]: Enter SensorSweep Scan");
194 188
195 LLVector3 sensorPos = SensePoint.AbsolutePosition; 189 LLVector3 sensorPos = SensePoint.AbsolutePosition;
196 LLVector3 regionPos = new LLVector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); 190 LLVector3 regionPos = new LLVector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0);
@@ -220,7 +214,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
220 objtype |= 0x04; // passive non-moving 214 objtype |= 0x04; // passive non-moving
221 else 215 else
222 objtype |= 0x02; // active moving 216 objtype |= 0x02; // active moving
223 if (ent is IScript) objtype |= 0x08; // Scripted. It COULD have one hidden ... 217
218 SceneObjectPart part = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID);
219
220 if (part != null && part.ContainsScripts()) objtype |= 0x08; // Scripted. It COULD have one hidden ...
224 221
225 if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type)) 222 if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type))
226 { 223 {
@@ -288,7 +285,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
288 } 285 }
289 } 286 }
290 } 287 }
291 //m_ScriptEngine.Log.Info("[AsyncLSL]: Enter SensorSweep SenseLock");
292 288
293 lock (SenseLock) 289 lock (SenseLock)
294 { 290 {
@@ -311,24 +307,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
311 // send a "no_sensor" 307 // send a "no_sensor"
312 // Add it to queue 308 // Add it to queue
313 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID, 309 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
314 new XEventParams("no_sensor", new Object[0], 310 new EventParams("no_sensor", new Object[0],
315 new XDetectParams[0])); 311 new DetectParams[0]));
316 } 312 }
317 else 313 else
318 { 314 {
319 XDetectParams[] detect = 315 DetectParams[] detect =
320 new XDetectParams[SensedObjects.Length]; 316 new DetectParams[SensedObjects.Length];
321 317
322 int idx; 318 int idx;
323 for (idx = 0; idx < SensedObjects.Length; idx++) 319 for (idx = 0; idx < SensedObjects.Length; idx++)
324 { 320 {
325 detect[idx] = new XDetectParams(); 321 detect[idx] = new DetectParams();
326 detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]); 322 detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]);
327 detect[idx].Populate(m_CmdManager.m_ScriptEngine.World); 323 detect[idx].Populate(m_CmdManager.m_ScriptEngine.World);
328 } 324 }
329 325
330 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID, 326 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
331 new XEventParams("sensor", 327 new EventParams("sensor",
332 new Object[] { 328 new Object[] {
333 new LSL_Types.LSLInteger(SensedObjects.Length) }, 329 new LSL_Types.LSLInteger(SensedObjects.Length) },
334 detect)); 330 detect));
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
index 3dd875a..36e992b 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/Timer.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
@@ -29,8 +29,9 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using libsecondlife; 31using libsecondlife;
32using OpenSim.Region.ScriptEngine.Shared.Api;
32 33
33namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins 34namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
34{ 35{
35 public class Timer 36 public class Timer
36 { 37 {
@@ -110,8 +111,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
110 // Console.WriteLine("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next); 111 // Console.WriteLine("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
111 // Add it to queue 112 // Add it to queue
112 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID, 113 m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
113 new XEventParams("timer", new Object[0], 114 new EventParams("timer", new Object[0],
114 new XDetectParams[0])); 115 new DetectParams[0]));
115 // set next interval 116 // set next interval
116 117
117 //ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); 118 //ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs
index 288349e..89bf51c 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandPlugins/XmlRequest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs
@@ -28,9 +28,11 @@
28using System; 28using System;
29using OpenSim.Region.Environment.Interfaces; 29using OpenSim.Region.Environment.Interfaces;
30using OpenSim.Region.Environment.Modules.Scripting.XMLRPC; 30using OpenSim.Region.Environment.Modules.Scripting.XMLRPC;
31using OpenSim.Region.ScriptEngine.XEngine.Script; 31using OpenSim.Region.ScriptEngine.Interfaces;
32using OpenSim.Region.ScriptEngine.Shared;
33using OpenSim.Region.ScriptEngine.Shared.Api;
32 34
33namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins 35namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
34{ 36{
35 public class XmlRequest 37 public class XmlRequest
36 { 38 {
@@ -69,12 +71,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
69 new LSL_Types.LSLString(rInfo.GetStrVal()) 71 new LSL_Types.LSLString(rInfo.GetStrVal())
70 }; 72 };
71 73
72 foreach (XEngine xe in XEngine.ScriptEngines) 74 foreach (AsyncCommandManager m in m_CmdManager.Managers)
73 { 75 {
74 if (xe.PostScriptEvent( 76 if (m.m_ScriptEngine.PostScriptEvent(
75 rInfo.GetItemID(), new XEventParams( 77 rInfo.GetItemID(), new EventParams(
76 "remote_data", resobj, 78 "remote_data", resobj,
77 new XDetectParams[0]))) 79 new DetectParams[0])))
78 break; 80 break;
79 } 81 }
80 82
@@ -98,12 +100,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
98 new LSL_Types.LSLString(srdInfo.sdata) 100 new LSL_Types.LSLString(srdInfo.sdata)
99 }; 101 };
100 102
101 foreach (XEngine xe in XEngine.ScriptEngines) 103 foreach (AsyncCommandManager m in m_CmdManager.Managers)
102 { 104 {
103 if (xe.PostScriptEvent( 105 if (m.m_ScriptEngine.PostScriptEvent(
104 srdInfo.m_itemID, new XEventParams( 106 srdInfo.m_itemID, new EventParams(
105 "remote_data", resobj, 107 "remote_data", resobj,
106 new XDetectParams[0]))) 108 new DetectParams[0])))
107 break; 109 break;
108 } 110 }
109 111