aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler
diff options
context:
space:
mode:
authorTedd Hansen2007-08-18 23:24:38 +0000
committerTedd Hansen2007-08-18 23:24:38 +0000
commit37446b0392ba423894952f81aa0f938d2bd2de22 (patch)
tree674be11acb7037c8d98fb6de34bd12e547a6c175 /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler
parentstarting to add bits and pieces to physics prims that we will eventually need... (diff)
downloadopensim-SC_OLD-37446b0392ba423894952f81aa0f938d2bd2de22.zip
opensim-SC_OLD-37446b0392ba423894952f81aa0f938d2bd2de22.tar.gz
opensim-SC_OLD-37446b0392ba423894952f81aa0f938d2bd2de22.tar.bz2
opensim-SC_OLD-37446b0392ba423894952f81aa0f938d2bd2de22.tar.xz
Moved in-AppDomain event execution from Script to OpenSim.Region.ScriptEngine.Executor. Script no longer responsible for handling event calls to itself (and we can create reference cache in Executor).
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs38
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs7
2 files changed, 14 insertions, 31 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
index 7334e6f..bfb8913 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs
@@ -9,8 +9,17 @@ using System.Reflection;
9 9
10namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL 10namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
11{ 11{
12 public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface 12 public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
13 { 13 {
14 private Executor m_Exec;
15 public Executor Exec {
16 get
17 {
18 if (m_Exec == null)
19 m_Exec = new Executor(this);
20 return m_Exec;
21 }
22 }
14 23
15 public LSL_BuiltIn_Commands_Interface m_LSL_Functions; 24 public LSL_BuiltIn_Commands_Interface m_LSL_Functions;
16 25
@@ -48,33 +57,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
48 return; 57 return;
49 } 58 }
50 59
51 public void ExecuteEvent(string FunctionName, object[] args)
52 {
53 //foreach (MemberInfo mi in this.GetType().GetMembers())
54 //{
55 //if (mi.ToString().ToLower().Contains("default"))
56 //{
57 // Console.WriteLine("Member found: " + mi.ToString());
58 //}
59 //}
60
61 Type type = this.GetType();
62
63 Console.WriteLine("ScriptEngine Invoke: \"" + this.State() + "_event_" + FunctionName + "\"");
64
65 try
66 {
67 type.InvokeMember(this.State() + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, this, args);
68 }
69 catch (Exception e)
70 {
71 // TODO: Send to correct place
72 Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString());
73 }
74
75
76 }
77
78 60
79 61
80 // 62 //
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
index 297a45c..8982bb6 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
@@ -16,6 +16,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
16 /// </summary> 16 /// </summary>
17 public class LSL_BuiltIn_Commands: MarshalByRefObject, LSL_BuiltIn_Commands_Interface 17 public class LSL_BuiltIn_Commands: MarshalByRefObject, LSL_BuiltIn_Commands_Interface
18 { 18 {
19
19 private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 20 private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
20 private ScriptManager m_manager; 21 private ScriptManager m_manager;
21 private IScriptHost m_host; 22 private IScriptHost m_host;
@@ -74,7 +75,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
74 public void llWhisper(int channelID, string text) 75 public void llWhisper(int channelID, string text)
75 { 76 {
76 //Common.SendToDebug("INTERNAL FUNCTION llWhisper(" + channelID + ", \"" + text + "\");"); 77 //Common.SendToDebug("INTERNAL FUNCTION llWhisper(" + channelID + ", \"" + text + "\");");
77 Console.WriteLine("llWhisper Channel " + channelID + ", Text: \"" + text + "\""); 78 //Console.WriteLine("llWhisper Channel " + channelID + ", Text: \"" + text + "\"");
78 //type for whisper is 0 79 //type for whisper is 0
79 World.SimChat(Helpers.StringToField(text), 80 World.SimChat(Helpers.StringToField(text),
80 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 81 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
@@ -86,7 +87,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
86 { 87 {
87 //TODO: DO SOMETHING USEFUL HERE 88 //TODO: DO SOMETHING USEFUL HERE
88 //Common.SendToDebug("INTERNAL FUNCTION llSay(" + (int)channelID + ", \"" + (string)text + "\");"); 89 //Common.SendToDebug("INTERNAL FUNCTION llSay(" + (int)channelID + ", \"" + (string)text + "\");");
89 Console.WriteLine("llSay Channel " + channelID + ", Text: \"" + text + "\""); 90 //Console.WriteLine("llSay Channel " + channelID + ", Text: \"" + text + "\"");
90 //type for say is 1 91 //type for say is 1
91 92
92 World.SimChat(Helpers.StringToField(text), 93 World.SimChat(Helpers.StringToField(text),
@@ -95,7 +96,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
95 96
96 public void llShout(int channelID, string text) 97 public void llShout(int channelID, string text)
97 { 98 {
98 Console.WriteLine("llShout Channel " + channelID + ", Text: \"" + text + "\""); 99 //Console.WriteLine("llShout Channel " + channelID + ", Text: \"" + text + "\"");
99 //type for shout is 2 100 //type for shout is 2
100 World.SimChat(Helpers.StringToField(text), 101 World.SimChat(Helpers.StringToField(text),
101 2, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 102 2, m_host.AbsolutePosition, m_host.Name, m_host.UUID);