aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorAdam Frisby2007-07-15 22:04:56 +0000
committerAdam Frisby2007-07-15 22:04:56 +0000
commitf2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9 (patch)
tree75400e1a09fc051352db022667d0718fa372b34e /OpenSim/Region/Environment/Scenes
parent*Fixed master avatar requesting when in grid mode. (diff)
downloadopensim-SC_OLD-f2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9.zip
opensim-SC_OLD-f2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9.tar.gz
opensim-SC_OLD-f2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9.tar.bz2
opensim-SC_OLD-f2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9.tar.xz
* Added new scripting related events, in particular a new event which is triggered by console commands so that the script can subscribe to console messages and operate when they occur.
* Added new example script (work in progress) * Fixed typo in Scripting engines for C# and JScript.NET
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneEvents.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/CSharpScriptEngine.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs32
-rw-r--r--OpenSim/Region/Environment/Scenes/scripting/Engines/JScriptEngine/JScriptEngine.cs2
5 files changed, 52 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index bb9fa61..aa08172 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -164,6 +164,15 @@ namespace OpenSim.Region.Environment.Scenes
164 } 164 }
165 #endregion 165 #endregion
166 166
167 #region Script Handling Methods
168
169 public void SendCommandToScripts(string[] args)
170 {
171 m_eventManager.TriggerOnScriptConsole(args);
172 }
173
174 #endregion
175
167 /// <summary> 176 /// <summary>
168 /// 177 ///
169 /// </summary> 178 /// </summary>
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index f8ebb2f..1e4b163 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -25,6 +25,15 @@ namespace OpenSim.Region.Environment.Scenes
25 public delegate void OnParcelPrimCountAddDelegate(SceneObject obj); 25 public delegate void OnParcelPrimCountAddDelegate(SceneObject obj);
26 public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd; 26 public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
27 27
28 public delegate void OnScriptConsoleDelegate(string[] args);
29 public event OnScriptConsoleDelegate OnScriptConsole;
30
31 public void TriggerOnScriptConsole(string[] args)
32 {
33 if (OnScriptConsole != null)
34 OnScriptConsole(args);
35 }
36
28 public void TriggerOnFrame() 37 public void TriggerOnFrame()
29 { 38 {
30 if (OnFrame != null) 39 if (OnFrame != null)
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/CSharpScriptEngine.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/CSharpScriptEngine.cs
index 9a3d229..1fc576e 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/CSharpScriptEngine.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/CSharpScriptEngine.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Scripting
48 compilerParams.GenerateInMemory = true; 48 compilerParams.GenerateInMemory = true;
49 compilerParams.IncludeDebugInformation = false; 49 compilerParams.IncludeDebugInformation = false;
50 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.dll"); 50 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.dll");
51 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.Enviroment.dll"); 51 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.Environment.dll");
52 compilerParams.ReferencedAssemblies.Add("OpenSim.Framework.dll"); 52 compilerParams.ReferencedAssemblies.Add("OpenSim.Framework.dll");
53 compilerParams.ReferencedAssemblies.Add("libsecondlife.dll"); 53 compilerParams.ReferencedAssemblies.Add("libsecondlife.dll");
54 compilerParams.ReferencedAssemblies.Add("System.dll"); 54 compilerParams.ReferencedAssemblies.Add("System.dll");
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs
new file mode 100644
index 0000000..4cc2c96
--- /dev/null
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs
@@ -0,0 +1,32 @@
1using OpenSim.Framework.Console;
2using OpenSim.Framework;
3using OpenSim.Region.Environment;
4using OpenSim.Region.Environment.Scenes;
5
6namespace OpenSim.Region.Scripting.Examples
7{
8 public class LSLExportScript : IScript
9 {
10 ScriptInfo script;
11
12 public string getName()
13 {
14 return "LSL Export Script 0.1";
15 }
16
17 public void Initialise(ScriptInfo scriptInfo)
18 {
19 script = scriptInfo;
20
21 script.events.OnScriptConsole += new EventManager.OnScriptConsoleDelegate(events_OnScriptConsole);
22 }
23
24 void events_OnScriptConsole(string[] args)
25 {
26 if (args[0].ToLower() == "lslexport")
27 {
28
29 }
30 }
31 }
32} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/JScriptEngine/JScriptEngine.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/JScriptEngine/JScriptEngine.cs
index 9145492..0833e7a 100644
--- a/OpenSim/Region/Environment/Scenes/scripting/Engines/JScriptEngine/JScriptEngine.cs
+++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/JScriptEngine/JScriptEngine.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Scripting
48 compilerParams.GenerateInMemory = true; 48 compilerParams.GenerateInMemory = true;
49 compilerParams.IncludeDebugInformation = false; 49 compilerParams.IncludeDebugInformation = false;
50 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.dll"); 50 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.dll");
51 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.Enviroment.dll"); 51 compilerParams.ReferencedAssemblies.Add("OpenSim.Region.Environment.dll");
52 compilerParams.ReferencedAssemblies.Add("OpenSim.Framework.dll"); 52 compilerParams.ReferencedAssemblies.Add("OpenSim.Framework.dll");
53 compilerParams.ReferencedAssemblies.Add("libsecondlife.dll"); 53 compilerParams.ReferencedAssemblies.Add("libsecondlife.dll");
54 compilerParams.ReferencedAssemblies.Add("System.dll"); 54 compilerParams.ReferencedAssemblies.Add("System.dll");