diff options
author | lbsa71 | 2008-06-24 21:09:49 +0000 |
---|---|---|
committer | lbsa71 | 2008-06-24 21:09:49 +0000 |
commit | 6b7930104bdb845d3b9c085dc04f52b6446f23b1 (patch) | |
tree | 05ee45781a455817fa400bb99f30f4d19d4eb1f8 /OpenSim/Region/ScriptEngine/XEngine/Executor.cs | |
parent | based on positive feedback on performance of making keys fixed length (diff) | |
download | opensim-SC_OLD-6b7930104bdb845d3b9c085dc04f52b6446f23b1.zip opensim-SC_OLD-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.gz opensim-SC_OLD-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.bz2 opensim-SC_OLD-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.xz |
* Applied patch from Melanie, mantis issue #1581 - "Refactor LSL language, api and compiler out of XEngine"
"First stage in a major Script Engine refactor, that will result in the LSL implementaions ebing reconverged. Not there yet, but one major part is done."
Thank you, Melanie!
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/Executor.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/Executor.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Executor.cs b/OpenSim/Region/ScriptEngine/XEngine/Executor.cs index 29336ac..e12f2bf 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Executor.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Executor.cs | |||
@@ -28,7 +28,8 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using OpenSim.Region.ScriptEngine.XEngine.Script; | 31 | using OpenSim.Region.ScriptEngine.Shared; |
32 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | ||
32 | 33 | ||
33 | namespace OpenSim.Region.ScriptEngine.XEngine | 34 | namespace OpenSim.Region.ScriptEngine.XEngine |
34 | { | 35 | { |
@@ -44,15 +45,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
44 | } | 45 | } |
45 | 46 | ||
46 | 47 | ||
47 | protected override scriptEvents DoGetStateEventFlags() | 48 | protected override scriptEvents DoGetStateEventFlags(string state) |
48 | { | 49 | { |
49 | //Console.WriteLine("Get event flags for " + m_Script.State); | 50 | //Console.WriteLine("Get event flags for " + state); |
50 | 51 | ||
51 | // Check to see if we've already computed the flags for this state | 52 | // Check to see if we've already computed the flags for this state |
52 | scriptEvents eventFlags = scriptEvents.None; | 53 | scriptEvents eventFlags = scriptEvents.None; |
53 | if (m_stateEvents.ContainsKey(m_Script.State)) | 54 | if (m_stateEvents.ContainsKey(state)) |
54 | { | 55 | { |
55 | m_stateEvents.TryGetValue(m_Script.State, out eventFlags); | 56 | m_stateEvents.TryGetValue(state, out eventFlags); |
56 | return eventFlags; | 57 | return eventFlags; |
57 | } | 58 | } |
58 | 59 | ||
@@ -61,7 +62,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
61 | // Fill in the events for this state, cache the results in the map | 62 | // Fill in the events for this state, cache the results in the map |
62 | foreach (KeyValuePair<string, scriptEvents> kvp in m_eventFlagsMap) | 63 | foreach (KeyValuePair<string, scriptEvents> kvp in m_eventFlagsMap) |
63 | { | 64 | { |
64 | string evname = m_Script.State + "_event_" + kvp.Key; | 65 | string evname = state + "_event_" + kvp.Key; |
65 | //Console.WriteLine("Trying event "+evname); | 66 | //Console.WriteLine("Trying event "+evname); |
66 | try | 67 | try |
67 | { | 68 | { |
@@ -80,18 +81,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
80 | 81 | ||
81 | // Save the flags we just computed and return the result | 82 | // Save the flags we just computed and return the result |
82 | if (eventFlags != 0) | 83 | if (eventFlags != 0) |
83 | m_stateEvents.Add(m_Script.State, eventFlags); | 84 | m_stateEvents.Add(state, eventFlags); |
84 | 85 | ||
85 | //Console.WriteLine("Returning {0:x}", eventFlags); | 86 | //Console.WriteLine("Returning {0:x}", eventFlags); |
86 | return (eventFlags); | 87 | return (eventFlags); |
87 | } | 88 | } |
88 | 89 | ||
89 | protected override void DoExecuteEvent(string FunctionName, object[] args) | 90 | protected override void DoExecuteEvent(string state, string FunctionName, object[] args) |
90 | { | 91 | { |
91 | // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. | 92 | // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. |
92 | // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! | 93 | // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! |
93 | 94 | ||
94 | string EventName = m_Script.State + "_event_" + FunctionName; | 95 | string EventName = state + "_event_" + FunctionName; |
95 | 96 | ||
96 | //#if DEBUG | 97 | //#if DEBUG |
97 | // Console.WriteLine("ScriptEngine: Script event function name: " + EventName); | 98 | // Console.WriteLine("ScriptEngine: Script event function name: " + EventName); |