aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/ScriptEngine/ComponentFactory.cs145
-rw-r--r--OpenSim/ApplicationPlugins/ScriptEngine/Properties/AssemblyInfo.cs62
-rw-r--r--OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs119
-rw-r--r--OpenSim/ApplicationPlugins/ScriptEngine/Resources/ScriptEnginePlugin.addin.xml11
-rw-r--r--OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs106
-rw-r--r--OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs39
-rw-r--r--OpenSim/ScriptEngine/Shared.Script/IScript.cs38
-rw-r--r--OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs63
-rw-r--r--OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs72
-rw-r--r--OpenSim/ScriptEngine/Shared/EventParams.cs82
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptCommandProvider.cs37
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptCompiler.cs40
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptEngine.cs49
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptEngineComponent.cs36
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptEngineRegionComponent.cs34
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptEventProvider.cs38
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptExecutor.cs39
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptLoader.cs36
-rw-r--r--OpenSim/ScriptEngine/Shared/IScriptScheduler.cs41
-rw-r--r--OpenSim/ScriptEngine/Shared/Properties/AssemblyInfo.cs63
-rw-r--r--OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs120
-rw-r--r--OpenSim/ScriptEngine/Shared/ScriptMetaData.cs95
-rw-r--r--OpenSim/ScriptEngine/Shared/ScriptStructure.cs137
-rw-r--r--prebuild.xml101
24 files changed, 0 insertions, 1603 deletions
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/ComponentFactory.cs b/OpenSim/ApplicationPlugins/ScriptEngine/ComponentFactory.cs
deleted file mode 100644
index c85634b..0000000
--- a/OpenSim/ApplicationPlugins/ScriptEngine/ComponentFactory.cs
+++ /dev/null
@@ -1,145 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Collections.Generic;
29using System.IO;
30using System.Reflection;
31using log4net;
32using OpenSim.ScriptEngine.Shared;
33
34namespace OpenSim.ApplicationPlugins.ScriptEngine
35{
36 public static class ComponentFactory
37 {
38 // Component providers are registered here wit a name (string)
39 // When a script engine is created the components are instanciated
40 public static Dictionary<string, Type> providers = new Dictionary<string, Type>();
41 public static Dictionary<string, Type> scriptEngines = new Dictionary<string, Type>();
42
43 internal static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 private readonly static string nameIScriptEngineComponent = typeof(IScriptEngineComponent).Name; // keep interface name in managed code
45 private readonly static string nameIScriptEngine = typeof(IScriptEngine).Name; // keep interface name in managed code
46
47 public static string Name
48 {
49 get { return "SECS.ComponentFactory"; }
50 }
51
52 /// <summary>
53 /// Load components from directory
54 /// </summary>
55 /// <param name="directory"></param>
56 internal static void Load(string directory, string filter)
57 {
58 // We may want to change how this functions as currently it required unique class names for each component
59
60 foreach (string file in Directory.GetFiles(directory, filter))
61 {
62 //m_log.DebugFormat("[ScriptEngine]: Loading: [{0}].", file);
63 Assembly componentAssembly = null;
64 try
65 {
66 componentAssembly = Assembly.LoadFrom(file);
67 }
68 catch
69 {
70 m_log.ErrorFormat("[{0}] Error loading: \"{1}\".", Name, file);
71 }
72
73 if (componentAssembly != null)
74 {
75 try
76 {
77 // Go through all types in the assembly
78 foreach (Type componentType in componentAssembly.GetTypes())
79 {
80 if (componentType.IsPublic
81 && !componentType.IsAbstract)
82 {
83 //if (componentType.IsSubclassOf(typeof(ComponentBase)))
84 if (componentType.GetInterface(nameIScriptEngineComponent) != null)
85 {
86 // We have found an type which is derived from ProdiverBase, add it to provider list
87 m_log.InfoFormat("[{0}] Adding component: {1}", Name, componentType.Name);
88 lock (providers)
89 {
90 providers.Add(componentType.Name, componentType);
91 }
92 }
93 //if (componentType.IsSubclassOf(typeof(ScriptEngineBase)))
94 if (componentType.GetInterface(nameIScriptEngine) != null)
95 {
96 // We have found an type which is derived from RegionScriptEngineBase, add it to engine list
97 m_log.InfoFormat("[{0}] Adding script engine: {1}", Name, componentType.Name);
98 lock (scriptEngines)
99 {
100 scriptEngines.Add(componentType.Name, componentType);
101 }
102 }
103 }
104 }
105 }
106 catch
107 (ReflectionTypeLoadException re)
108 {
109 m_log.ErrorFormat("[{0}] Could not load component \"{1}\": {2}", Name, componentAssembly.FullName, re.ToString());
110 int c = 0;
111 foreach (Exception e in re.LoaderExceptions)
112 {
113 c++;
114 m_log.ErrorFormat("[{0}] LoaderException {1}: {2}", Name, c, e.ToString());
115 }
116 }
117 } //if
118 } //foreach
119 }
120
121 public static IScriptEngineComponent GetComponentInstance(string name, params Object[] args)
122 {
123 lock (providers)
124 {
125 if (!providers.ContainsKey(name))
126 throw new Exception("ScriptEngine requested component named \"" + name +
127 "\" that does not exist.");
128 return Activator.CreateInstance(providers[name], args) as IScriptEngineComponent;
129 }
130 }
131
132 private readonly static string nameIScriptEngineRegionComponent = typeof(IScriptEngineRegionComponent).Name; // keep interface name in managed code
133 public static IScriptEngineComponent GetComponentInstance(RegionInfoStructure info, string name, params Object[] args)
134 {
135 IScriptEngineComponent c = GetComponentInstance(name, args);
136
137 // If module is IScriptEngineRegionComponent then it will have one instance per region and we will initialize it
138 if (c.GetType().GetInterface(nameIScriptEngineRegionComponent) != null)
139 ((IScriptEngineRegionComponent)c).Initialize(info);
140
141 return c;
142 }
143
144 }
145}
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/Properties/AssemblyInfo.cs b/OpenSim/ApplicationPlugins/ScriptEngine/Properties/AssemblyInfo.cs
deleted file mode 100644
index 890774d..0000000
--- a/OpenSim/ApplicationPlugins/ScriptEngine/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,62 +0,0 @@
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 OpenSimulator 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.Reflection;
29using System.Runtime.InteropServices;
30
31// General Information about an assembly is controlled through the following
32// set of attributes. Change these attribute values to modify the information
33// associated with an assembly.
34[assembly: AssemblyTitle("OpenSim.ApplicationPlugins.ScriptEngine")]
35[assembly: AssemblyDescription("")]
36[assembly: AssemblyConfiguration("")]
37[assembly: AssemblyCompany("http://opensimulator.org")]
38[assembly: AssemblyProduct("OpenSim.ApplicationPlugins.ScriptEngine")]
39[assembly: AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2009")]
40[assembly: AssemblyTrademark("")]
41[assembly: AssemblyCulture("")]
42
43// Setting ComVisible to false makes the types in this assembly not visible
44// to COM components. If you need to access a type in this assembly from
45// COM, set the ComVisible attribute to true on that type.
46[assembly: ComVisible(false)]
47
48// The following GUID is for the ID of the typelib if this project is exposed to COM
49[assembly: Guid("a234c402-3014-45de-9f6b-c024d9f71983")]
50
51// Version information for an assembly consists of the following four values:
52//
53// Major Version
54// Minor Version
55// Build Number
56// Revision
57//
58// You can specify all the values or you can default the Build and Revision Numbers
59// by using the '*' as shown below:
60// [assembly: AssemblyVersion("0.6.5.*")]
61[assembly: AssemblyVersion("0.6.5.*")]
62[assembly: AssemblyFileVersion("0.6.5.0")]
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs b/OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs
deleted file mode 100644
index 41a5278..0000000
--- a/OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs
+++ /dev/null
@@ -1,119 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Reflection;
29using log4net;
30using Nini.Config;
31using OpenSim.Region.Framework.Interfaces;
32using OpenSim.Region.Framework.Scenes;
33using OpenSim.ScriptEngine.Shared;
34
35namespace OpenSim.ApplicationPlugins.ScriptEngine
36{
37 public class RegionEngineLoader : IRegionModule
38 {
39 // This is a region module.
40 // This means: Every time a new region is created, a new instance of this module is also created.
41 // This module is responsible for starting the script engine for this region.
42 public string Name { get { return "SECS.DotNetEngine.Scheduler.RegionLoader"; } }
43 public bool IsSharedModule { get { return true; } }
44
45 internal static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 private string tempScriptEngineName = "DotNetEngine";
47 public IScriptEngine scriptEngine;
48 public IConfigSource ConfigSource;
49 public IConfig ScriptConfigSource;
50 public void Initialise(Scene scene, IConfigSource source)
51 {
52 // New region is being created
53 // Create a new script engine
54 // Make sure we have config
55 try
56 {
57 if (ConfigSource.Configs["SECS"] == null)
58 ConfigSource.AddConfig("SECS");
59 ScriptConfigSource = ConfigSource.Configs["SECS"];
60
61 // Is SECS enabled?
62 if (ScriptConfigSource.GetBoolean("Enabled", false))
63 {
64 LoadEngine();
65 if (scriptEngine != null)
66 scriptEngine.Initialise(scene, source);
67 }
68 }
69 catch (NullReferenceException)
70 {
71 }
72 }
73
74 public void PostInitialise()
75 {
76 if (scriptEngine != null)
77 scriptEngine.PostInitialise();
78 }
79
80 public void Close()
81 {
82 try
83 {
84 if (scriptEngine != null)
85 scriptEngine.Close();
86 }
87 catch (Exception ex)
88 {
89 m_log.ErrorFormat("[{0}] Unable to close engine \"{1}\": {2}", Name, tempScriptEngineName, ex.ToString());
90 }
91 }
92
93 private void LoadEngine()
94 {
95 m_log.DebugFormat("[{0}] Loading region script engine engine \"{1}\".", Name, tempScriptEngineName);
96 try
97 {
98 lock (ComponentFactory.scriptEngines)
99 {
100 if (!ComponentFactory.scriptEngines.ContainsKey(tempScriptEngineName))
101 {
102 m_log.ErrorFormat("[{0}] Unable to load region script engine: Script engine \"{1}\" does not exist.", Name, tempScriptEngineName);
103 }
104 else
105 {
106 scriptEngine =
107 Activator.CreateInstance(ComponentFactory.scriptEngines[tempScriptEngineName]) as
108 IScriptEngine;
109 }
110 }
111 }
112 catch (Exception ex)
113 {
114 m_log.ErrorFormat("[{0}] Internal error loading region script engine \"{1}\": {2}", Name, tempScriptEngineName, ex.ToString());
115 }
116 }
117
118 }
119}
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/Resources/ScriptEnginePlugin.addin.xml b/OpenSim/ApplicationPlugins/ScriptEngine/Resources/ScriptEnginePlugin.addin.xml
deleted file mode 100644
index f067bf4..0000000
--- a/OpenSim/ApplicationPlugins/ScriptEngine/Resources/ScriptEnginePlugin.addin.xml
+++ /dev/null
@@ -1,11 +0,0 @@
1<Addin id="OpenSim.ApplicationPlugins.ScriptEngine" version="0.1">
2 <Runtime>
3 <Import assembly="OpenSim.ApplicationPlugins.ScriptEngine.dll" />
4 </Runtime>
5 <Dependencies>
6 <Addin id="OpenSim" version="0.5" />
7 </Dependencies>
8 <Extension path = "/OpenSim/Startup">
9 <Plugin id="ScriptEnginePlugin" type="OpenSim.ApplicationPlugins.ScriptEngine.ScriptEnginePlugin" />
10 </Extension>
11</Addin>
diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs b/OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs
deleted file mode 100644
index cd34f70..0000000
--- a/OpenSim/ApplicationPlugins/ScriptEngine/ScriptEnginePlugin.cs
+++ /dev/null
@@ -1,106 +0,0 @@
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 OpenSimulator 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 */
27using System.Reflection;
28using log4net;
29
30namespace OpenSim.ApplicationPlugins.ScriptEngine
31{
32 /// <summary>
33 /// Loads all Script Engine Components
34 /// </summary>
35 public class ScriptEnginePlugin : IApplicationPlugin
36 {
37 internal static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
38 internal OpenSimBase m_OpenSim;
39
40
41
42 public ScriptEnginePlugin()
43 {
44 // Application startup
45#if DEBUG
46 m_log.InfoFormat("[{0}] ##################################", Name);
47 m_log.InfoFormat("[{0}] # Script Engine Component System #", Name);
48 m_log.InfoFormat("[{0}] ##################################", Name);
49#else
50 m_log.InfoFormat("[{0}] Script Engine Component System", Name);
51#endif
52
53 // Load all modules from current directory
54 // We only want files named OpenSim.ScriptEngine.*.dll
55 ComponentFactory.Load(".", "OpenSim.ScriptEngine.*.dll");
56 }
57
58 public void Initialise(OpenSimBase openSim)
59 {
60
61 // Our objective: Load component .dll's
62 m_OpenSim = openSim;
63 //m_OpenSim.Shutdown();
64 }
65
66 public void PostInitialise()
67 {
68 }
69
70
71 #region IApplicationPlugin stuff
72 /// <summary>
73 /// Returns the plugin version
74 /// </summary>
75 /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
76 public string Version
77 {
78 get { return "1.0.0.0"; }
79 }
80
81 /// <summary>
82 /// Returns the plugin name
83 /// </summary>
84 /// <returns>Plugin name, eg MySQL User Provider</returns>
85 public string Name
86 {
87 get { return "SECS"; }
88 }
89
90 /// <summary>
91 /// Default-initialises the plugin
92 /// </summary>
93 public void Initialise() { }
94
95 ///<summary>
96 ///Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
97 ///</summary>
98 ///<filterpriority>2</filterpriority>
99 public void Dispose()
100 {
101 //throw new NotImplementedException();
102 }
103 #endregion
104
105 }
106}
diff --git a/OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs b/OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs
deleted file mode 100644
index 6a02a4a..0000000
--- a/OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs
+++ /dev/null
@@ -1,39 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Text;
31
32namespace ScriptAssemblies
33{
34 public interface ICommandProvider
35 {
36 void ExecuteCommand(string functionName, params object[] args);
37 string Name { get; }
38 }
39}
diff --git a/OpenSim/ScriptEngine/Shared.Script/IScript.cs b/OpenSim/ScriptEngine/Shared.Script/IScript.cs
deleted file mode 100644
index 6afb4d5..0000000
--- a/OpenSim/ScriptEngine/Shared.Script/IScript.cs
+++ /dev/null
@@ -1,38 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Text;
31
32namespace ScriptAssemblies
33{
34 public interface IScript
35 {
36 void ExecuteFunction(string functionName, params object[] args);
37 }
38} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs b/OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs
deleted file mode 100644
index 090cb44..0000000
--- a/OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,63 +0,0 @@
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 OpenSimulator 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.Reflection;
29using System.Runtime.CompilerServices;
30using System.Runtime.InteropServices;
31
32// General Information about an assembly is controlled through the following
33// set of attributes. Change these attribute values to modify the information
34// associated with an assembly.
35[assembly: AssemblyTitle("OpenSim.ScriptEngine.Shared.Script")]
36[assembly: AssemblyDescription("")]
37[assembly: AssemblyConfiguration("")]
38[assembly: AssemblyCompany("http://opensimulator.org")]
39[assembly: AssemblyProduct("OpenSim.ScriptEngine.Shared.Script")]
40[assembly: AssemblyCopyright("Copyright © Microsoft 2008")]
41[assembly: AssemblyTrademark("")]
42[assembly: AssemblyCulture("")]
43
44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type.
47[assembly: ComVisible(false)]
48
49// The following GUID is for the ID of the typelib if this project is exposed to COM
50[assembly: Guid("ea77002b-c967-4368-ace9-6533f8147d4b")]
51
52// Version information for an assembly consists of the following four values:
53//
54// Major Version
55// Minor Version
56// Build Number
57// Revision
58//
59// You can specify all the values or you can default the Build and Revision Numbers
60// by using the '*' as shown below:
61// [assembly: AssemblyVersion("0.6.5.*")]
62[assembly: AssemblyVersion("0.6.5.*")]
63[assembly: AssemblyFileVersion("0.6.5.0")]
diff --git a/OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs b/OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs
deleted file mode 100644
index ab7835d..0000000
--- a/OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs
+++ /dev/null
@@ -1,72 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Reflection;
31using System.Runtime.Remoting.Lifetime;
32using System.Text;
33
34namespace ScriptAssemblies
35{
36 public class ScriptBase : MarshalByRefObject, IScript
37 {
38
39 #region AppDomain Serialization Keep-Alive
40 //
41 // Never expire this object
42 //
43 public override Object InitializeLifetimeService()
44 {
45 ILease lease = (ILease)base.InitializeLifetimeService();
46
47 if (lease.CurrentState == LeaseState.Initial)
48 {
49 lease.InitialLeaseTime = TimeSpan.Zero;
50 }
51 return lease;
52 }
53 #endregion
54
55 public delegate void ExecuteFunctionEventDelegate(string functionName, params object[] args);
56 public event ExecuteFunctionEventDelegate OnExecuteFunction;
57
58 //private List<ICommandProvider> CommandProviders = new List<ICommandProvider>();
59
60 public ScriptBase()
61 {
62 }
63
64 public void ExecuteFunction(string functionName, params object[] args)
65 {
66 // We got a new command, fire event
67 if (OnExecuteFunction != null)
68 OnExecuteFunction(functionName, args);
69
70 }
71 }
72}
diff --git a/OpenSim/ScriptEngine/Shared/EventParams.cs b/OpenSim/ScriptEngine/Shared/EventParams.cs
deleted file mode 100644
index 28eaa58..0000000
--- a/OpenSim/ScriptEngine/Shared/EventParams.cs
+++ /dev/null
@@ -1,82 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Text;
31using OpenMetaverse;
32using OpenSim.Region.ScriptEngine.Shared;
33using log4net;
34using System.Reflection;
35
36namespace OpenSim.ScriptEngine.Shared
37{
38 /// <summary>
39 /// Holds all the data required to execute a scripting event.
40 /// </summary>
41 public class EventParams
42 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 public string EventName;
45 public Object[] Params;
46 public Region.ScriptEngine.Shared.DetectParams[] DetectParams;
47 public uint LocalID;
48 public UUID ItemID;
49
50 public EventParams(uint localID, UUID itemID, string eventName, Object[] eventParams, DetectParams[] detectParams)
51 {
52 LocalID = localID;
53 ItemID = itemID;
54 EventName = eventName;
55 Params = eventParams;
56 DetectParams = detectParams;
57 }
58 public EventParams(uint localID, string eventName, Object[] eventParams, DetectParams[] detectParams)
59 {
60 LocalID = localID;
61 EventName = eventName;
62 Params = eventParams;
63 DetectParams = detectParams;
64 }
65 public void test(params object[] args)
66 {
67 string functionName = "test";
68 test2(functionName, args);
69 }
70 public void test2(string functionName, params object[] args)
71 {
72 String logMessage = functionName;
73 foreach (object arg in args)
74 {
75 logMessage +=", "+arg;
76 }
77 m_log.Debug(logMessage);
78 }
79
80
81 }
82}
diff --git a/OpenSim/ScriptEngine/Shared/IScriptCommandProvider.cs b/OpenSim/ScriptEngine/Shared/IScriptCommandProvider.cs
deleted file mode 100644
index b2498d6..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptCommandProvider.cs
+++ /dev/null
@@ -1,37 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Text;
31
32namespace OpenSim.ScriptEngine.Shared
33{
34 public interface IScriptCommandProvider : ScriptAssemblies.ICommandProvider
35 {
36 }
37}
diff --git a/OpenSim/ScriptEngine/Shared/IScriptCompiler.cs b/OpenSim/ScriptEngine/Shared/IScriptCompiler.cs
deleted file mode 100644
index 57249fd..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptCompiler.cs
+++ /dev/null
@@ -1,40 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Collections.Generic;
29using System.Reflection;
30using System.Text;
31using ScriptAssemblies;
32
33namespace OpenSim.ScriptEngine.Shared
34{
35 public interface IScriptCompiler : IScriptEngineComponent
36 {
37 string Compile(ScriptMetaData scriptMetaData, ref string script);
38 string PreProcessScript(ref string script);
39 }
40} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/IScriptEngine.cs b/OpenSim/ScriptEngine/Shared/IScriptEngine.cs
deleted file mode 100644
index 3acd1d5..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptEngine.cs
+++ /dev/null
@@ -1,49 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Collections.Generic;
29using System.Text;
30using Nini.Config;
31using OpenSim.Region.Framework.Interfaces;
32using OpenSim.Region.Framework.Scenes;
33
34namespace OpenSim.ScriptEngine.Shared
35{
36 public interface IScriptEngine
37 {
38 //string[] ComponentNames { get; }
39 //Dictionary<string, IScriptEngineComponent> Components { get; }
40 //void InitializeComponents();
41 void Initialise(Scene scene, IConfigSource source);
42 void PostInitialise();
43 void Close();
44 string Name { get; }
45 // string Name { get; }
46 //void Initialize();
47 //void Close();
48 }
49} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/IScriptEngineComponent.cs b/OpenSim/ScriptEngine/Shared/IScriptEngineComponent.cs
deleted file mode 100644
index 0959b53..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptEngineComponent.cs
+++ /dev/null
@@ -1,36 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Collections.Generic;
29using System.Text;
30
31namespace OpenSim.ScriptEngine.Shared
32{
33 public interface IScriptEngineComponent
34 {
35 }
36} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/IScriptEngineRegionComponent.cs b/OpenSim/ScriptEngine/Shared/IScriptEngineRegionComponent.cs
deleted file mode 100644
index eeb86c1..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptEngineRegionComponent.cs
+++ /dev/null
@@ -1,34 +0,0 @@
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 OpenSimulator 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
28namespace OpenSim.ScriptEngine.Shared
29{
30 public interface IScriptEngineRegionComponent
31 {
32 void Initialize(RegionInfoStructure currentRegion);
33 }
34}
diff --git a/OpenSim/ScriptEngine/Shared/IScriptEventProvider.cs b/OpenSim/ScriptEngine/Shared/IScriptEventProvider.cs
deleted file mode 100644
index b796a4b..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptEventProvider.cs
+++ /dev/null
@@ -1,38 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Text;
31
32namespace OpenSim.ScriptEngine.Shared
33{
34 public interface IScriptEventProvider : IScriptEngineComponent, IScriptEngineRegionComponent
35 {
36
37 }
38} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/IScriptExecutor.cs b/OpenSim/ScriptEngine/Shared/IScriptExecutor.cs
deleted file mode 100644
index a48c7e5..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptExecutor.cs
+++ /dev/null
@@ -1,39 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Collections.Generic;
29using System.Text;
30using OpenSim.ScriptEngine.Shared;
31
32namespace OpenSim.ScriptEngine.Shared
33{
34 public interface IScriptExecutor : IScriptEngineComponent, IScriptEngineRegionComponent
35 {
36 void ExecuteCommand(ref ScriptStructure scriptContainer, EventParams p);
37 void ExecuteCommand(EventParams p);
38 }
39} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/IScriptLoader.cs b/OpenSim/ScriptEngine/Shared/IScriptLoader.cs
deleted file mode 100644
index 6beea17..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptLoader.cs
+++ /dev/null
@@ -1,36 +0,0 @@
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 OpenSimulator 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 OpenSim.ScriptEngine.Shared;
29
30namespace OpenSim.ScriptEngine.Shared
31{
32 public interface IScriptLoader: IScriptEngineComponent
33 {
34 ScriptAssemblies.IScript LoadScript(ScriptStructure script);
35 }
36} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/IScriptScheduler.cs b/OpenSim/ScriptEngine/Shared/IScriptScheduler.cs
deleted file mode 100644
index cf1f1ab..0000000
--- a/OpenSim/ScriptEngine/Shared/IScriptScheduler.cs
+++ /dev/null
@@ -1,41 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Collections.Generic;
29using System.Text;
30using OpenMetaverse;
31using OpenSim.ScriptEngine.Shared;
32
33namespace OpenSim.ScriptEngine.Shared
34{
35 public interface IScriptScheduler : IScriptEngineComponent
36 {
37 void AddScript(ScriptStructure script);
38 void Removecript(uint id, UUID itemID);
39 void Close();
40 }
41} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/Properties/AssemblyInfo.cs b/OpenSim/ScriptEngine/Shared/Properties/AssemblyInfo.cs
deleted file mode 100644
index 4ce44ed..0000000
--- a/OpenSim/ScriptEngine/Shared/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,63 +0,0 @@
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 OpenSimulator 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.Reflection;
29using System.Runtime.CompilerServices;
30using System.Runtime.InteropServices;
31
32// General Information about an assembly is controlled through the following
33// set of attributes. Change these attribute values to modify the information
34// associated with an assembly.
35[assembly: AssemblyTitle("OpenSim.ScriptEngine.Shared")]
36[assembly: AssemblyDescription("")]
37[assembly: AssemblyConfiguration("")]
38[assembly: AssemblyCompany("http://opensimulator.org")]
39[assembly: AssemblyProduct("OpenSim.ScriptEngine.Shared")]
40[assembly: AssemblyCopyright("Copyright © Microsoft 2008")]
41[assembly: AssemblyTrademark("")]
42[assembly: AssemblyCulture("")]
43
44// Setting ComVisible to false makes the types in this assembly not visible
45// to COM components. If you need to access a type in this assembly from
46// COM, set the ComVisible attribute to true on that type.
47[assembly: ComVisible(false)]
48
49// The following GUID is for the ID of the typelib if this project is exposed to COM
50[assembly: Guid("ea77002b-c967-4368-ace9-6533f8147d4b")]
51
52// Version information for an assembly consists of the following four values:
53//
54// Major Version
55// Minor Version
56// Build Number
57// Revision
58//
59// You can specify all the values or you can default the Build and Revision Numbers
60// by using the '*' as shown below:
61// [assembly: AssemblyVersion("0.6.5.*")]
62[assembly: AssemblyVersion("0.6.5.*")]
63[assembly: AssemblyFileVersion("0.6.5.0")]
diff --git a/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs b/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
deleted file mode 100644
index 64b33d4..0000000
--- a/OpenSim/ScriptEngine/Shared/RegionInfoStructure.cs
+++ /dev/null
@@ -1,120 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Reflection;
31using log4net;
32using Nini.Config;
33using OpenSim.Region.Framework.Scenes;
34using OpenSim.Region.ScriptEngine.Shared;
35using OpenSim.ScriptEngine.Shared;
36using EventParams = OpenSim.ScriptEngine.Shared.EventParams;
37
38namespace OpenSim.ScriptEngine.Shared
39{
40 public struct RegionInfoStructure
41 {
42 public Scene Scene;
43 public IConfigSource ConfigSource;
44
45 public IScriptLoader ScriptLoader;
46 public Dictionary<string, IScriptEventProvider> EventProviders;
47 public Dictionary<string, IScriptExecutor> Executors;
48 public Dictionary<string, IScriptCompiler> Compilers;
49 public Dictionary<string, IScriptScheduler> Schedulers;
50 public Dictionary<string, IScriptCommandProvider> CommandProviders;
51
52 public void Executors_Execute(EventParams p)
53 {
54 // Execute a command on all executors
55 lock (Executors)
56 {
57 foreach (IScriptExecutor exec in Executors.Values)
58 {
59 exec.ExecuteCommand(p);
60 }
61 }
62 }
63 public void Executors_Execute(ScriptStructure scriptContainer, EventParams p)
64 {
65 // Execute a command on all executors
66 lock (Executors)
67 {
68 foreach (IScriptExecutor exec in Executors.Values)
69 {
70 exec.ExecuteCommand(ref scriptContainer, p);
71 }
72 }
73 }
74
75 public IScriptCompiler FindCompiler(ScriptMetaData scriptMetaData)
76 {
77 string compiler = "Compiler_LSL";
78 if (scriptMetaData.ContainsKey("Compiler"))
79 compiler = scriptMetaData["Compiler"];
80
81 lock (Compilers)
82 {
83 if (!Compilers.ContainsKey(compiler))
84 throw new Exception("Requested script compiler \"" + compiler + "\" does not exist.");
85
86 return Compilers[compiler];
87 }
88 }
89
90 public IScriptScheduler FindScheduler(ScriptMetaData scriptMetaData)
91 {
92 string scheduler = "Scheduler";
93 if (scriptMetaData.ContainsKey("Scheduler"))
94 scheduler = scriptMetaData["Scheduler"];
95
96 lock (Schedulers)
97 {
98 if (!Schedulers.ContainsKey(scheduler))
99 throw new Exception("Requested script scheduler \"" + scheduler + "\" does not exist.");
100
101 return Schedulers[scheduler];
102 }
103 }
104
105 //public Assembly[] GetCommandProviderAssemblies()
106 //{
107 // lock (CommandProviders)
108 // {
109 // Assembly[] ass = new Assembly[CommandProviders.Count];
110 // int i = 0;
111 // foreach (string key in CommandProviders.Keys)
112 // {
113 // ass[i] = CommandProviders[key].GetType().Assembly;
114 // i++;
115 // }
116 // return ass;
117 // }
118 //}
119 }
120} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/ScriptMetaData.cs b/OpenSim/ScriptEngine/Shared/ScriptMetaData.cs
deleted file mode 100644
index e351632..0000000
--- a/OpenSim/ScriptEngine/Shared/ScriptMetaData.cs
+++ /dev/null
@@ -1,95 +0,0 @@
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 OpenSimulator 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 */
27using System;
28using System.Collections.Generic;
29
30namespace OpenSim.ScriptEngine.Shared
31{
32 public class ScriptMetaData: Dictionary<string, string>
33 {
34 private static readonly char[] LineSeparator = "\r\n".ToCharArray();
35 private static readonly char[] Separator = { ':' };
36 public static ScriptMetaData Extract(ref string Script)
37 {
38 ScriptMetaData ret = new ScriptMetaData();
39 if (string.IsNullOrEmpty(Script))
40 return ret;
41
42 // Process it line by line
43 string Line = "";
44 for (int i = 0; i < Script.Length + 1; i++)
45 {
46 // Found a line separator?
47 if (i < Script.Length
48 && Script[i] != LineSeparator[0]
49 && Script[i] != LineSeparator[1])
50 {
51 // No, not end of line. Add to current line
52 Line += Script[i];
53 }
54 else
55 {
56 // Extract MetaData from this line. Returns False if not found.
57 if (!_GetMetaFromLine(ret, Line))
58 continue;
59 // Empty for next round
60 Line = "";
61 }
62 }
63 return ret;
64 }
65
66 private static bool _GetMetaFromLine(ScriptMetaData ret, string line)
67 {
68 line = line.Trim();
69
70 // Empty line? We may find more later
71 if (line == "")
72 return true;
73
74 // Is this a comment? If not, then return false
75 if (!line.StartsWith("//"))
76 return false;
77
78 // It is a comment
79 string[] keyval = line.Split(Separator, 2, StringSplitOptions.None);
80 keyval[0] = keyval[0].Substring(2, keyval[0].Length - 2).Trim();
81 keyval[1] = keyval[1].Trim();
82
83 // Add it
84 if (keyval[0] != "")
85 if (!ret.ContainsKey(keyval[0]))
86 {
87 //m_log.DebugFormat("[DotNetEngine] Script metadata: Key: \"{0}\", Value: \"{1}\".", keyval[0], keyval[1]);
88 ret.Add(keyval[0], keyval[1]);
89 }
90
91 return true;
92 }
93
94 }
95} \ No newline at end of file
diff --git a/OpenSim/ScriptEngine/Shared/ScriptStructure.cs b/OpenSim/ScriptEngine/Shared/ScriptStructure.cs
deleted file mode 100644
index 1095a8b..0000000
--- a/OpenSim/ScriptEngine/Shared/ScriptStructure.cs
+++ /dev/null
@@ -1,137 +0,0 @@
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 OpenSimulator 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.Generic;
30using System.Reflection;
31using System.Text;
32using log4net;
33using OpenMetaverse;
34using OpenSim.Region.ScriptEngine.Interfaces;
35using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
36using OpenSim.ScriptEngine.Shared;
37
38namespace OpenSim.ScriptEngine.Shared
39{
40 public struct ScriptStructure
41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43
44 public RegionInfoStructure RegionInfo;
45 public ScriptMetaData ScriptMetaData;
46
47 public ScriptAssemblies.IScript ScriptObject;
48 public string State;
49 public bool Running;
50 public bool Disabled;
51 public string Source;
52 public int StartParam;
53 public AppDomain AppDomain;
54 public Dictionary<string, IScriptApi> Apis;
55 public Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> LineMap;
56 public uint LocalID;
57 public UUID ItemID;
58 public string AssemblyFileName;
59
60 public string ScriptID { get { return LocalID.ToString() + "." + ItemID.ToString(); } }
61 public string Name { get { return "Script:" + ScriptID; } }
62 private bool Initialized;
63 private Dictionary<string, Delegate> InternalFunctions;
64 public string AssemblyName;
65
66 public void ExecuteEvent(EventParams p)
67 {
68 ExecuteMethod(p, true);
69 }
70
71 public void ExecuteMethod(EventParams p)
72 {
73 ExecuteMethod(p, false);
74 }
75 private void ExecuteMethod(EventParams p, bool isEvent)
76 {
77 // First time initialization?
78 if (!Initialized)
79 {
80 Initialized = true;
81 CacheInternalFunctions();
82 }
83
84 lock (InternalFunctions)
85 {
86 // Make function name
87 string FunctionName;
88 if (isEvent)
89 FunctionName = State + "_event_" + p.EventName;
90 else
91 FunctionName = p.EventName;
92
93 // Check if this function exist
94 if (!InternalFunctions.ContainsKey(FunctionName))
95 {
96 // TODO: Send message in-world
97 m_log.ErrorFormat("[{0}] Script function \"{1}\" was not found.", Name, FunctionName);
98 return;
99 }
100
101 // Execute script function
102 try
103 {
104 InternalFunctions[FunctionName].DynamicInvoke(p.Params);
105 }
106 catch (Exception e)
107 {
108 m_log.ErrorFormat("[{0}] Execute \"{1}\" failed: {2}", Name, FunctionName, e.ToString());
109 }
110 }
111 }
112
113 /// <summary>
114 /// Cache functions into a dictionary with delegates. Should be faster than reflection.
115 /// </summary>
116 private void CacheInternalFunctions()
117 {
118 Type scriptObjectType = ScriptObject.GetType();
119 InternalFunctions = new Dictionary<string, Delegate>();
120
121 MethodInfo[] methods = scriptObjectType.GetMethods();
122 lock (InternalFunctions)
123 {
124 // Read all methods into a dictionary
125 foreach (MethodInfo mi in methods)
126 {
127 // TODO: We don't support overloading
128 if (!InternalFunctions.ContainsKey(mi.Name))
129 InternalFunctions.Add(mi.Name, Delegate.CreateDelegate(scriptObjectType, ScriptObject, mi));
130 else
131 m_log.ErrorFormat("[{0}] Error: Script function \"{1}\" is already added. We do not support overloading.",
132 Name, mi.Name);
133 }
134 }
135 }
136 }
137}
diff --git a/prebuild.xml b/prebuild.xml
index 2d61b73..33cb647 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -2705,107 +2705,6 @@
2705 </Project> 2705 </Project>
2706 2706
2707 2707
2708 <Project frameworkVersion="v3_5" name="OpenSim.ScriptEngine.Shared.Script" path="OpenSim/ScriptEngine/Shared.Script" type="Library">
2709 <Configuration name="Debug">
2710 <Options>
2711 <OutputPath>../../../bin/</OutputPath>
2712 </Options>
2713 </Configuration>
2714 <Configuration name="Release">
2715 <Options>
2716 <OutputPath>../../../bin/</OutputPath>
2717 </Options>
2718 </Configuration>
2719
2720 <ReferencePath>../../../bin/</ReferencePath>
2721 <Reference name="System"/>
2722
2723 <Files>
2724 <Match pattern="*.cs" recurse="true" >
2725 <Exclude name="Tests" pattern="Tests" />
2726 </Match>
2727 </Files>
2728 </Project>
2729
2730 <Project frameworkVersion="v3_5" name="OpenSim.ScriptEngine.Shared" path="OpenSim/ScriptEngine/Shared" type="Library">
2731 <Configuration name="Debug">
2732 <Options>
2733 <OutputPath>../../../bin/</OutputPath>
2734 </Options>
2735 </Configuration>
2736 <Configuration name="Release">
2737 <Options>
2738 <OutputPath>../../../bin/</OutputPath>
2739 </Options>
2740 </Configuration>
2741
2742 <ReferencePath>../../../bin/</ReferencePath>
2743 <Reference name="System"/>
2744 <Reference name="System.Data"/>
2745 <Reference name="System.Web"/>
2746 <Reference name="System.Xml"/>
2747 <Reference name="OpenMetaverseTypes.dll"/>
2748 <Reference name="OpenMetaverse.dll"/>
2749 <Reference name="OpenSim" />
2750 <Reference name="OpenSim.Framework"/>
2751 <Reference name="OpenSim.Framework.Communications"/>
2752 <Reference name="OpenSim.Region.CoreModules" />
2753 <Reference name="OpenSim.Region.Framework" />
2754 <Reference name="OpenSim.Region.Physics.Manager" />
2755 <Reference name="OpenSim.Framework.Console"/>
2756 <Reference name="Nini.dll" />
2757 <Reference name="log4net.dll"/>
2758 <Reference name="OpenSim.Region.ScriptEngine.Shared"/>
2759 <Reference name="OpenSim.ScriptEngine.Shared.Script"/>
2760
2761 <Files>
2762 <Match pattern="*.cs" recurse="true" >
2763 <Exclude name="Tests" pattern="Tests" />
2764 </Match>
2765 </Files>
2766 </Project>
2767
2768 <Project frameworkVersion="v3_5" name="OpenSim.ApplicationPlugins.ScriptEngine" path="OpenSim/ApplicationPlugins/ScriptEngine" type="Library">
2769 <Configuration name="Debug">
2770 <Options>
2771 <OutputPath>../../../bin/</OutputPath>
2772 </Options>
2773 </Configuration>
2774 <Configuration name="Release">
2775 <Options>
2776 <OutputPath>../../../bin/</OutputPath>
2777 </Options>
2778 </Configuration>
2779
2780 <ReferencePath>../../../bin/</ReferencePath>
2781 <Reference name="System"/>
2782 <Reference name="System.Data"/>
2783 <Reference name="System.Web"/>
2784 <Reference name="System.Xml"/>
2785 <Reference name="OpenMetaverseTypes.dll"/>
2786 <Reference name="OpenMetaverse.dll"/>
2787 <Reference name="OpenSim" />
2788 <Reference name="OpenSim.Framework"/>
2789 <Reference name="OpenSim.Framework.Communications"/>
2790 <Reference name="OpenSim.Region.CoreModules" />
2791 <Reference name="OpenSim.Region.Framework" />
2792 <Reference name="OpenSim.Region.Physics.Manager" />
2793 <Reference name="OpenSim.Framework.Console"/>
2794 <Reference name="Nini.dll" />
2795 <Reference name="log4net.dll"/>
2796 <Reference name="OpenSim.ScriptEngine.Shared"/>
2797 <Reference name="OpenSim.ScriptEngine.Shared.Script"/>
2798 <Reference name="OpenSim.Region.ClientStack"/>
2799 <Reference name="OpenSim.Framework.Servers"/>
2800
2801 <Files>
2802 <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/>
2803 <Match pattern="*.cs" recurse="true" >
2804 <Exclude name="Tests" pattern="Tests" />
2805 </Match>
2806 </Files>
2807 </Project>
2808
2809 <Project frameworkVersion="v3_5" name="OpenSim.Region.UserStatistics" path="OpenSim/Region/UserStatistics" type="Library"> 2708 <Project frameworkVersion="v3_5" name="OpenSim.Region.UserStatistics" path="OpenSim/Region/UserStatistics" type="Library">
2810 <Configuration name="Debug"> 2709 <Configuration name="Debug">
2811 <Options> 2710 <Options>