aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
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
parent*Fixed master avatar requesting when in grid mode. (diff)
downloadopensim-SC-f2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9.zip
opensim-SC-f2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9.tar.gz
opensim-SC-f2c449f10e7c6b7dc3468ecdaea9e97039e1e0a9.tar.bz2
opensim-SC-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')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs8
-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
6 files changed, 59 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index ab03ed1..6968c41 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -422,7 +422,7 @@ namespace OpenSim
422 { 422 {
423 case "help": 423 case "help":
424 m_log.Error("show users - show info about connected users"); 424 m_log.Error("show users - show info about connected users");
425 m_log.Error("shutdown - disconnect all clients and shutdown"); 425 m_log.Error("quit - disconnect all clients and shutdown");
426 break; 426 break;
427 427
428 case "show": 428 case "show":
@@ -442,6 +442,12 @@ namespace OpenSim
442 } 442 }
443 } 443 }
444 break; 444 break;
445 case "script":
446 for (int i = 0; i < m_localWorld.Count; i++)
447 {
448 ((Scene)m_localWorld[i]).SendCommandToScripts(cmdparams);
449 }
450 break;
445 451
446 case "quit": 452 case "quit":
447 case "shutdown": 453 case "shutdown":
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");