diff options
author | Sean Dague | 2007-09-13 11:41:42 +0000 |
---|---|---|
committer | Sean Dague | 2007-09-13 11:41:42 +0000 |
commit | afea5f22055fd645e95c4e1dcad01e68716fa049 (patch) | |
tree | 73dbc6fff4cba36c559234b66d24c84e00f3f162 /OpenSim/Region/ScriptEngine/DotNetEngine | |
parent | adding eol-style attributes on new files (diff) | |
download | opensim-SC-afea5f22055fd645e95c4e1dcad01e68716fa049.zip opensim-SC-afea5f22055fd645e95c4e1dcad01e68716fa049.tar.gz opensim-SC-afea5f22055fd645e95c4e1dcad01e68716fa049.tar.bz2 opensim-SC-afea5f22055fd645e95c4e1dcad01e68716fa049.tar.xz |
remove ^M, as native storage should be UNIX format, and ^M in/out mashing
will happen on the windows side now that eol-style is correct
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
24 files changed, 6559 insertions, 6559 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs index 96670f1..b0b4662 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs | |||
@@ -1,197 +1,197 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.Reflection; | 4 | using System.Reflection; |
5 | using System.Threading; | 5 | using System.Threading; |
6 | using System.Runtime.Remoting; | 6 | using System.Runtime.Remoting; |
7 | using System.IO; | 7 | using System.IO; |
8 | using OpenSim.Region.Environment.Scenes; | 8 | using OpenSim.Region.Environment.Scenes; |
9 | using OpenSim.Region.Environment.Scenes.Scripting; | 9 | using OpenSim.Region.Environment.Scenes.Scripting; |
10 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 10 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
11 | using OpenSim.Region.ScriptEngine.Common; | 11 | using OpenSim.Region.ScriptEngine.Common; |
12 | using libsecondlife; | 12 | using libsecondlife; |
13 | 13 | ||
14 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 14 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
15 | { | 15 | { |
16 | public class AppDomainManager | 16 | public class AppDomainManager |
17 | { | 17 | { |
18 | private int maxScriptsPerAppDomain = 1; | 18 | private int maxScriptsPerAppDomain = 1; |
19 | /// <summary> | 19 | /// <summary> |
20 | /// Internal list of all AppDomains | 20 | /// Internal list of all AppDomains |
21 | /// </summary> | 21 | /// </summary> |
22 | private List<AppDomainStructure> appDomains = new List<AppDomainStructure>(); | 22 | private List<AppDomainStructure> appDomains = new List<AppDomainStructure>(); |
23 | /// <summary> | 23 | /// <summary> |
24 | /// Structure to keep track of data around AppDomain | 24 | /// Structure to keep track of data around AppDomain |
25 | /// </summary> | 25 | /// </summary> |
26 | private class AppDomainStructure | 26 | private class AppDomainStructure |
27 | { | 27 | { |
28 | /// <summary> | 28 | /// <summary> |
29 | /// The AppDomain itself | 29 | /// The AppDomain itself |
30 | /// </summary> | 30 | /// </summary> |
31 | public AppDomain CurrentAppDomain; | 31 | public AppDomain CurrentAppDomain; |
32 | /// <summary> | 32 | /// <summary> |
33 | /// Number of scripts loaded into AppDomain | 33 | /// Number of scripts loaded into AppDomain |
34 | /// </summary> | 34 | /// </summary> |
35 | public int ScriptsLoaded; | 35 | public int ScriptsLoaded; |
36 | /// <summary> | 36 | /// <summary> |
37 | /// Number of dead scripts | 37 | /// Number of dead scripts |
38 | /// </summary> | 38 | /// </summary> |
39 | public int ScriptsWaitingUnload; | 39 | public int ScriptsWaitingUnload; |
40 | } | 40 | } |
41 | /// <summary> | 41 | /// <summary> |
42 | /// Current AppDomain | 42 | /// Current AppDomain |
43 | /// </summary> | 43 | /// </summary> |
44 | private AppDomainStructure currentAD; | 44 | private AppDomainStructure currentAD; |
45 | private object getLock = new object(); // Mutex | 45 | private object getLock = new object(); // Mutex |
46 | private object freeLock = new object(); // Mutex | 46 | private object freeLock = new object(); // Mutex |
47 | 47 | ||
48 | //private ScriptEngine m_scriptEngine; | 48 | //private ScriptEngine m_scriptEngine; |
49 | //public AppDomainManager(ScriptEngine scriptEngine) | 49 | //public AppDomainManager(ScriptEngine scriptEngine) |
50 | public AppDomainManager() | 50 | public AppDomainManager() |
51 | { | 51 | { |
52 | //m_scriptEngine = scriptEngine; | 52 | //m_scriptEngine = scriptEngine; |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Find a free AppDomain, creating one if necessary | 56 | /// Find a free AppDomain, creating one if necessary |
57 | /// </summary> | 57 | /// </summary> |
58 | /// <returns>Free AppDomain</returns> | 58 | /// <returns>Free AppDomain</returns> |
59 | private AppDomainStructure GetFreeAppDomain() | 59 | private AppDomainStructure GetFreeAppDomain() |
60 | { | 60 | { |
61 | Console.WriteLine("Finding free AppDomain"); | 61 | Console.WriteLine("Finding free AppDomain"); |
62 | lock (getLock) | 62 | lock (getLock) |
63 | { | 63 | { |
64 | // Current full? | 64 | // Current full? |
65 | if (currentAD != null && currentAD.ScriptsLoaded >= maxScriptsPerAppDomain) | 65 | if (currentAD != null && currentAD.ScriptsLoaded >= maxScriptsPerAppDomain) |
66 | { | 66 | { |
67 | // Add it to AppDomains list and empty current | 67 | // Add it to AppDomains list and empty current |
68 | appDomains.Add(currentAD); | 68 | appDomains.Add(currentAD); |
69 | currentAD = null; | 69 | currentAD = null; |
70 | } | 70 | } |
71 | // No current | 71 | // No current |
72 | if (currentAD == null) | 72 | if (currentAD == null) |
73 | { | 73 | { |
74 | // Create a new current AppDomain | 74 | // Create a new current AppDomain |
75 | currentAD = new AppDomainStructure(); | 75 | currentAD = new AppDomainStructure(); |
76 | currentAD.CurrentAppDomain = PrepareNewAppDomain(); | 76 | currentAD.CurrentAppDomain = PrepareNewAppDomain(); |
77 | } | 77 | } |
78 | 78 | ||
79 | Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded); | 79 | Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded); |
80 | return currentAD; | 80 | return currentAD; |
81 | } // lock | 81 | } // lock |
82 | } | 82 | } |
83 | 83 | ||
84 | private int AppDomainNameCount; | 84 | private int AppDomainNameCount; |
85 | /// <summary> | 85 | /// <summary> |
86 | /// Create and prepare a new AppDomain for scripts | 86 | /// Create and prepare a new AppDomain for scripts |
87 | /// </summary> | 87 | /// </summary> |
88 | /// <returns>The new AppDomain</returns> | 88 | /// <returns>The new AppDomain</returns> |
89 | private AppDomain PrepareNewAppDomain() | 89 | private AppDomain PrepareNewAppDomain() |
90 | { | 90 | { |
91 | // Create and prepare a new AppDomain | 91 | // Create and prepare a new AppDomain |
92 | AppDomainNameCount++; | 92 | AppDomainNameCount++; |
93 | // TODO: Currently security match current appdomain | 93 | // TODO: Currently security match current appdomain |
94 | 94 | ||
95 | // Construct and initialize settings for a second AppDomain. | 95 | // Construct and initialize settings for a second AppDomain. |
96 | AppDomainSetup ads = new AppDomainSetup(); | 96 | AppDomainSetup ads = new AppDomainSetup(); |
97 | ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; | 97 | ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; |
98 | ads.DisallowBindingRedirects = false; | 98 | ads.DisallowBindingRedirects = false; |
99 | ads.DisallowCodeDownload = true; | 99 | ads.DisallowCodeDownload = true; |
100 | ads.ShadowCopyFiles = "true"; // Enabled shadowing | 100 | ads.ShadowCopyFiles = "true"; // Enabled shadowing |
101 | ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; | 101 | ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; |
102 | 102 | ||
103 | AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads); | 103 | AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads); |
104 | 104 | ||
105 | // Return the new AppDomain | 105 | // Return the new AppDomain |
106 | return AD; | 106 | return AD; |
107 | 107 | ||
108 | } | 108 | } |
109 | 109 | ||
110 | /// <summary> | 110 | /// <summary> |
111 | /// Unload appdomains that are full and have only dead scripts | 111 | /// Unload appdomains that are full and have only dead scripts |
112 | /// </summary> | 112 | /// </summary> |
113 | private void UnloadAppDomains() | 113 | private void UnloadAppDomains() |
114 | { | 114 | { |
115 | lock (freeLock) | 115 | lock (freeLock) |
116 | { | 116 | { |
117 | // Go through all | 117 | // Go through all |
118 | foreach (AppDomainStructure ads in new System.Collections.ArrayList(appDomains)) | 118 | foreach (AppDomainStructure ads in new System.Collections.ArrayList(appDomains)) |
119 | { | 119 | { |
120 | // Don't process current AppDomain | 120 | // Don't process current AppDomain |
121 | if (ads.CurrentAppDomain != currentAD.CurrentAppDomain) | 121 | if (ads.CurrentAppDomain != currentAD.CurrentAppDomain) |
122 | { | 122 | { |
123 | // Not current AppDomain | 123 | // Not current AppDomain |
124 | // Is number of unloaded bigger or equal to number of loaded? | 124 | // Is number of unloaded bigger or equal to number of loaded? |
125 | if (ads.ScriptsLoaded <= ads.ScriptsWaitingUnload) | 125 | if (ads.ScriptsLoaded <= ads.ScriptsWaitingUnload) |
126 | { | 126 | { |
127 | Console.WriteLine("Found empty AppDomain, unloading"); | 127 | Console.WriteLine("Found empty AppDomain, unloading"); |
128 | // Remove from internal list | 128 | // Remove from internal list |
129 | appDomains.Remove(ads); | 129 | appDomains.Remove(ads); |
130 | #if DEBUG | 130 | #if DEBUG |
131 | long m = GC.GetTotalMemory(true); | 131 | long m = GC.GetTotalMemory(true); |
132 | #endif | 132 | #endif |
133 | // Unload | 133 | // Unload |
134 | AppDomain.Unload(ads.CurrentAppDomain); | 134 | AppDomain.Unload(ads.CurrentAppDomain); |
135 | #if DEBUG | 135 | #if DEBUG |
136 | Console.WriteLine("AppDomain unload freed " + (m - GC.GetTotalMemory(true)) + " bytes of memory"); | 136 | Console.WriteLine("AppDomain unload freed " + (m - GC.GetTotalMemory(true)) + " bytes of memory"); |
137 | #endif | 137 | #endif |
138 | } | 138 | } |
139 | } | 139 | } |
140 | } // foreach | 140 | } // foreach |
141 | } // lock | 141 | } // lock |
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
145 | 145 | ||
146 | public OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadScript(string FileName) | 146 | public OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadScript(string FileName) |
147 | { | 147 | { |
148 | // Find next available AppDomain to put it in | 148 | // Find next available AppDomain to put it in |
149 | AppDomainStructure FreeAppDomain = GetFreeAppDomain(); | 149 | AppDomainStructure FreeAppDomain = GetFreeAppDomain(); |
150 | 150 | ||
151 | Console.WriteLine("Loading into AppDomain: " + FileName); | 151 | Console.WriteLine("Loading into AppDomain: " + FileName); |
152 | LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script"); | 152 | LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script"); |
153 | //Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt)); | 153 | //Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt)); |
154 | FreeAppDomain.ScriptsLoaded++; | 154 | FreeAppDomain.ScriptsLoaded++; |
155 | 155 | ||
156 | return mbrt; | 156 | return mbrt; |
157 | } | 157 | } |
158 | 158 | ||
159 | 159 | ||
160 | /// <summary> | 160 | /// <summary> |
161 | /// Increase "dead script" counter for an AppDomain | 161 | /// Increase "dead script" counter for an AppDomain |
162 | /// </summary> | 162 | /// </summary> |
163 | /// <param name="ad"></param> | 163 | /// <param name="ad"></param> |
164 | //[Obsolete("Needs fixing, needs a real purpose in life!!!")] | 164 | //[Obsolete("Needs fixing, needs a real purpose in life!!!")] |
165 | public void StopScript(AppDomain ad) | 165 | public void StopScript(AppDomain ad) |
166 | { | 166 | { |
167 | lock (freeLock) | 167 | lock (freeLock) |
168 | { | 168 | { |
169 | Console.WriteLine("Stopping script in AppDomain"); | 169 | Console.WriteLine("Stopping script in AppDomain"); |
170 | // Check if it is current AppDomain | 170 | // Check if it is current AppDomain |
171 | if (currentAD.CurrentAppDomain == ad) | 171 | if (currentAD.CurrentAppDomain == ad) |
172 | { | 172 | { |
173 | // Yes - increase | 173 | // Yes - increase |
174 | currentAD.ScriptsWaitingUnload++; | 174 | currentAD.ScriptsWaitingUnload++; |
175 | return; | 175 | return; |
176 | } | 176 | } |
177 | 177 | ||
178 | // Lopp through all AppDomains | 178 | // Lopp through all AppDomains |
179 | foreach (AppDomainStructure ads in new System.Collections.ArrayList(appDomains)) | 179 | foreach (AppDomainStructure ads in new System.Collections.ArrayList(appDomains)) |
180 | { | 180 | { |
181 | if (ads.CurrentAppDomain == ad) | 181 | if (ads.CurrentAppDomain == ad) |
182 | { | 182 | { |
183 | // Found it | 183 | // Found it |
184 | ads.ScriptsWaitingUnload++; | 184 | ads.ScriptsWaitingUnload++; |
185 | break; | 185 | break; |
186 | } | 186 | } |
187 | } // foreach | 187 | } // foreach |
188 | } // lock | 188 | } // lock |
189 | 189 | ||
190 | UnloadAppDomains(); // Outsite lock, has its own GetLock | 190 | UnloadAppDomains(); // Outsite lock, has its own GetLock |
191 | 191 | ||
192 | 192 | ||
193 | } | 193 | } |
194 | 194 | ||
195 | 195 | ||
196 | } | 196 | } |
197 | } | 197 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs index 5722d62..49ce8b8 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Common.cs | |||
@@ -1,59 +1,59 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
34 | { | 34 | { |
35 | public static class Common | 35 | public static class Common |
36 | { | 36 | { |
37 | static public bool debug = true; | 37 | static public bool debug = true; |
38 | static public ScriptEngine mySE; | 38 | static public ScriptEngine mySE; |
39 | 39 | ||
40 | //public delegate void SendToDebugEventDelegate(string Message); | 40 | //public delegate void SendToDebugEventDelegate(string Message); |
41 | //public delegate void SendToLogEventDelegate(string Message); | 41 | //public delegate void SendToLogEventDelegate(string Message); |
42 | //static public event SendToDebugEventDelegate SendToDebugEvent; | 42 | //static public event SendToDebugEventDelegate SendToDebugEvent; |
43 | //static public event SendToLogEventDelegate SendToLogEvent; | 43 | //static public event SendToLogEventDelegate SendToLogEvent; |
44 | 44 | ||
45 | static public void SendToDebug(string Message) | 45 | static public void SendToDebug(string Message) |
46 | { | 46 | { |
47 | //if (Debug == true) | 47 | //if (Debug == true) |
48 | mySE.Log.Verbose("ScriptEngine", "Debug: " + Message); | 48 | mySE.Log.Verbose("ScriptEngine", "Debug: " + Message); |
49 | //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | 49 | //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); |
50 | } | 50 | } |
51 | static public void SendToLog(string Message) | 51 | static public void SendToLog(string Message) |
52 | { | 52 | { |
53 | //if (Debug == true) | 53 | //if (Debug == true) |
54 | mySE.Log.Verbose("ScriptEngine", "LOG: " + Message); | 54 | mySE.Log.Verbose("ScriptEngine", "LOG: " + Message); |
55 | //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | 55 | //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | } | 59 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index a488b91..b63a6ce 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | |||
@@ -1,113 +1,113 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.IO; | 4 | using System.IO; |
5 | using Microsoft.CSharp; | 5 | using Microsoft.CSharp; |
6 | using System.CodeDom.Compiler; | 6 | using System.CodeDom.Compiler; |
7 | using System.Reflection; | 7 | using System.Reflection; |
8 | 8 | ||
9 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 9 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
10 | { | 10 | { |
11 | 11 | ||
12 | public class Compiler | 12 | public class Compiler |
13 | { | 13 | { |
14 | private LSL2CSConverter LSL_Converter = new LSL2CSConverter(); | 14 | private LSL2CSConverter LSL_Converter = new LSL2CSConverter(); |
15 | private CSharpCodeProvider codeProvider = new CSharpCodeProvider(); | 15 | private CSharpCodeProvider codeProvider = new CSharpCodeProvider(); |
16 | private static UInt64 scriptCompileCounter = 0; | 16 | private static UInt64 scriptCompileCounter = 0; |
17 | //private ICodeCompiler icc = codeProvider.CreateCompiler(); | 17 | //private ICodeCompiler icc = codeProvider.CreateCompiler(); |
18 | public string CompileFromFile(string LSOFileName) | 18 | public string CompileFromFile(string LSOFileName) |
19 | { | 19 | { |
20 | switch (System.IO.Path.GetExtension(LSOFileName).ToLower()) | 20 | switch (System.IO.Path.GetExtension(LSOFileName).ToLower()) |
21 | { | 21 | { |
22 | case ".txt": | 22 | case ".txt": |
23 | case ".lsl": | 23 | case ".lsl": |
24 | Common.SendToDebug("Source code is LSL, converting to CS"); | 24 | Common.SendToDebug("Source code is LSL, converting to CS"); |
25 | return CompileFromLSLText(File.ReadAllText(LSOFileName)); | 25 | return CompileFromLSLText(File.ReadAllText(LSOFileName)); |
26 | case ".cs": | 26 | case ".cs": |
27 | Common.SendToDebug("Source code is CS"); | 27 | Common.SendToDebug("Source code is CS"); |
28 | return CompileFromCSText(File.ReadAllText(LSOFileName)); | 28 | return CompileFromCSText(File.ReadAllText(LSOFileName)); |
29 | default: | 29 | default: |
30 | throw new Exception("Unknown script type."); | 30 | throw new Exception("Unknown script type."); |
31 | } | 31 | } |
32 | } | 32 | } |
33 | /// <summary> | 33 | /// <summary> |
34 | /// Converts script from LSL to CS and calls CompileFromCSText | 34 | /// Converts script from LSL to CS and calls CompileFromCSText |
35 | /// </summary> | 35 | /// </summary> |
36 | /// <param name="Script">LSL script</param> | 36 | /// <param name="Script">LSL script</param> |
37 | /// <returns>Filename to .dll assembly</returns> | 37 | /// <returns>Filename to .dll assembly</returns> |
38 | public string CompileFromLSLText(string Script) | 38 | public string CompileFromLSLText(string Script) |
39 | { | 39 | { |
40 | return CompileFromCSText(LSL_Converter.Convert(Script)); | 40 | return CompileFromCSText(LSL_Converter.Convert(Script)); |
41 | } | 41 | } |
42 | /// <summary> | 42 | /// <summary> |
43 | /// Compile CS script to .Net assembly (.dll) | 43 | /// Compile CS script to .Net assembly (.dll) |
44 | /// </summary> | 44 | /// </summary> |
45 | /// <param name="Script">CS script</param> | 45 | /// <param name="Script">CS script</param> |
46 | /// <returns>Filename to .dll assembly</returns> | 46 | /// <returns>Filename to .dll assembly</returns> |
47 | public string CompileFromCSText(string Script) | 47 | public string CompileFromCSText(string Script) |
48 | { | 48 | { |
49 | 49 | ||
50 | 50 | ||
51 | // Output assembly name | 51 | // Output assembly name |
52 | scriptCompileCounter++; | 52 | scriptCompileCounter++; |
53 | string OutFile = Path.Combine("ScriptEngines", "Script_" + scriptCompileCounter + ".dll"); | 53 | string OutFile = Path.Combine("ScriptEngines", "Script_" + scriptCompileCounter + ".dll"); |
54 | try | 54 | try |
55 | { | 55 | { |
56 | System.IO.File.Delete(OutFile); | 56 | System.IO.File.Delete(OutFile); |
57 | } | 57 | } |
58 | catch (Exception e) | 58 | catch (Exception e) |
59 | { | 59 | { |
60 | Console.WriteLine("Exception attempting to delete old compiled script: " + e.ToString()); | 60 | Console.WriteLine("Exception attempting to delete old compiled script: " + e.ToString()); |
61 | } | 61 | } |
62 | //string OutFile = Path.Combine("ScriptEngines", "SecondLife.Script.dll"); | 62 | //string OutFile = Path.Combine("ScriptEngines", "SecondLife.Script.dll"); |
63 | 63 | ||
64 | // DEBUG - write source to disk | 64 | // DEBUG - write source to disk |
65 | try | 65 | try |
66 | { | 66 | { |
67 | File.WriteAllText(Path.Combine("ScriptEngines", "debug_" + Path.GetFileNameWithoutExtension(OutFile) + ".cs"), Script); | 67 | File.WriteAllText(Path.Combine("ScriptEngines", "debug_" + Path.GetFileNameWithoutExtension(OutFile) + ".cs"), Script); |
68 | } | 68 | } |
69 | catch { } | 69 | catch { } |
70 | 70 | ||
71 | // Do actual compile | 71 | // Do actual compile |
72 | System.CodeDom.Compiler.CompilerParameters parameters = new CompilerParameters(); | 72 | System.CodeDom.Compiler.CompilerParameters parameters = new CompilerParameters(); |
73 | parameters.IncludeDebugInformation = true; | 73 | parameters.IncludeDebugInformation = true; |
74 | // Add all available assemblies | 74 | // Add all available assemblies |
75 | foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) | 75 | foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) |
76 | { | 76 | { |
77 | //Console.WriteLine("Adding assembly: " + asm.Location); | 77 | //Console.WriteLine("Adding assembly: " + asm.Location); |
78 | //parameters.ReferencedAssemblies.Add(asm.Location); | 78 | //parameters.ReferencedAssemblies.Add(asm.Location); |
79 | } | 79 | } |
80 | 80 | ||
81 | string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); | 81 | string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); |
82 | string rootPathSE = Path.GetDirectoryName(this.GetType().Assembly.Location); | 82 | string rootPathSE = Path.GetDirectoryName(this.GetType().Assembly.Location); |
83 | //Console.WriteLine("Assembly location: " + rootPath); | 83 | //Console.WriteLine("Assembly location: " + rootPath); |
84 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Common.dll")); | 84 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Common.dll")); |
85 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPathSE, "OpenSim.Region.ScriptEngine.DotNetEngine.dll")); | 85 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPathSE, "OpenSim.Region.ScriptEngine.DotNetEngine.dll")); |
86 | 86 | ||
87 | //parameters.ReferencedAssemblies.Add("OpenSim.Region.Environment"); | 87 | //parameters.ReferencedAssemblies.Add("OpenSim.Region.Environment"); |
88 | parameters.GenerateExecutable = false; | 88 | parameters.GenerateExecutable = false; |
89 | parameters.OutputAssembly = OutFile; | 89 | parameters.OutputAssembly = OutFile; |
90 | parameters.IncludeDebugInformation = false; | 90 | parameters.IncludeDebugInformation = false; |
91 | CompilerResults results = codeProvider.CompileAssemblyFromSource(parameters, Script); | 91 | CompilerResults results = codeProvider.CompileAssemblyFromSource(parameters, Script); |
92 | 92 | ||
93 | // Go through errors | 93 | // Go through errors |
94 | // TODO: Return errors to user somehow | 94 | // TODO: Return errors to user somehow |
95 | if (results.Errors.Count > 0) | 95 | if (results.Errors.Count > 0) |
96 | { | 96 | { |
97 | 97 | ||
98 | string errtext = ""; | 98 | string errtext = ""; |
99 | foreach (CompilerError CompErr in results.Errors) | 99 | foreach (CompilerError CompErr in results.Errors) |
100 | { | 100 | { |
101 | errtext += "Line number " + (CompErr.Line - 1) + | 101 | errtext += "Line number " + (CompErr.Line - 1) + |
102 | ", Error Number: " + CompErr.ErrorNumber + | 102 | ", Error Number: " + CompErr.ErrorNumber + |
103 | ", '" + CompErr.ErrorText + "'\r\n"; | 103 | ", '" + CompErr.ErrorText + "'\r\n"; |
104 | } | 104 | } |
105 | throw new Exception(errtext); | 105 | throw new Exception(errtext); |
106 | } | 106 | } |
107 | 107 | ||
108 | 108 | ||
109 | return OutFile; | 109 | return OutFile; |
110 | } | 110 | } |
111 | 111 | ||
112 | } | 112 | } |
113 | } | 113 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 3adb7e2..c70448b 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -1,265 +1,265 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.Text.RegularExpressions; | 4 | using System.Text.RegularExpressions; |
5 | 5 | ||
6 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 6 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
7 | { | 7 | { |
8 | public class LSL2CSConverter | 8 | public class LSL2CSConverter |
9 | { | 9 | { |
10 | //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); | 10 | //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); |
11 | private Dictionary<string, string> dataTypes = new Dictionary<string, string>(); | 11 | private Dictionary<string, string> dataTypes = new Dictionary<string, string>(); |
12 | private Dictionary<string, string> quotes = new Dictionary<string, string>(); | 12 | private Dictionary<string, string> quotes = new Dictionary<string, string>(); |
13 | 13 | ||
14 | public LSL2CSConverter() | 14 | public LSL2CSConverter() |
15 | { | 15 | { |
16 | // Only the types we need to convert | 16 | // Only the types we need to convert |
17 | dataTypes.Add("void", "void"); | 17 | dataTypes.Add("void", "void"); |
18 | dataTypes.Add("integer", "int"); | 18 | dataTypes.Add("integer", "int"); |
19 | dataTypes.Add("float", "double"); | 19 | dataTypes.Add("float", "double"); |
20 | dataTypes.Add("string", "string"); | 20 | dataTypes.Add("string", "string"); |
21 | dataTypes.Add("key", "string"); | 21 | dataTypes.Add("key", "string"); |
22 | dataTypes.Add("vector", "LSL_Types.Vector3"); | 22 | dataTypes.Add("vector", "LSL_Types.Vector3"); |
23 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); | 23 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); |
24 | dataTypes.Add("list", "list"); | 24 | dataTypes.Add("list", "list"); |
25 | dataTypes.Add("null", "null"); | 25 | dataTypes.Add("null", "null"); |
26 | 26 | ||
27 | } | 27 | } |
28 | 28 | ||
29 | public string Convert(string Script) | 29 | public string Convert(string Script) |
30 | { | 30 | { |
31 | string Return = ""; | 31 | string Return = ""; |
32 | Script = " \r\n" + Script; | 32 | Script = " \r\n" + Script; |
33 | 33 | ||
34 | // | 34 | // |
35 | // Prepare script for processing | 35 | // Prepare script for processing |
36 | // | 36 | // |
37 | 37 | ||
38 | // Clean up linebreaks | 38 | // Clean up linebreaks |
39 | Script = Regex.Replace(Script, @"\r\n", "\n"); | 39 | Script = Regex.Replace(Script, @"\r\n", "\n"); |
40 | Script = Regex.Replace(Script, @"\n", "\r\n"); | 40 | Script = Regex.Replace(Script, @"\n", "\r\n"); |
41 | 41 | ||
42 | 42 | ||
43 | // QUOTE REPLACEMENT | 43 | // QUOTE REPLACEMENT |
44 | // temporarily replace quotes so we can work our magic on the script without | 44 | // temporarily replace quotes so we can work our magic on the script without |
45 | // always considering if we are inside our outside ""'s | 45 | // always considering if we are inside our outside ""'s |
46 | string _Script = ""; | 46 | string _Script = ""; |
47 | string C; | 47 | string C; |
48 | bool in_quote = false; | 48 | bool in_quote = false; |
49 | bool quote_replaced = false; | 49 | bool quote_replaced = false; |
50 | string quote_replacement_string = "Q_U_O_T_E_REPLACEMENT_"; | 50 | string quote_replacement_string = "Q_U_O_T_E_REPLACEMENT_"; |
51 | string quote = ""; | 51 | string quote = ""; |
52 | bool last_was_escape = false; | 52 | bool last_was_escape = false; |
53 | int quote_replaced_count = 0; | 53 | int quote_replaced_count = 0; |
54 | for (int p = 0; p < Script.Length; p++) | 54 | for (int p = 0; p < Script.Length; p++) |
55 | { | 55 | { |
56 | 56 | ||
57 | C = Script.Substring(p, 1); | 57 | C = Script.Substring(p, 1); |
58 | while (true) | 58 | while (true) |
59 | { | 59 | { |
60 | // found " and last was not \ so this is not an escaped \" | 60 | // found " and last was not \ so this is not an escaped \" |
61 | if (C == "\"" && last_was_escape == false) | 61 | if (C == "\"" && last_was_escape == false) |
62 | { | 62 | { |
63 | // Toggle inside/outside quote | 63 | // Toggle inside/outside quote |
64 | in_quote = !in_quote; | 64 | in_quote = !in_quote; |
65 | if (in_quote) | 65 | if (in_quote) |
66 | { | 66 | { |
67 | quote_replaced_count++; | 67 | quote_replaced_count++; |
68 | } | 68 | } |
69 | else | 69 | else |
70 | { | 70 | { |
71 | if (quote == "") | 71 | if (quote == "") |
72 | { | 72 | { |
73 | // We didn't replace quote, probably because of empty string? | 73 | // We didn't replace quote, probably because of empty string? |
74 | _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]); | 74 | _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]); |
75 | } | 75 | } |
76 | // We just left a quote | 76 | // We just left a quote |
77 | quotes.Add(quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote); | 77 | quotes.Add(quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote); |
78 | quote = ""; | 78 | quote = ""; |
79 | } | 79 | } |
80 | break; | 80 | break; |
81 | } | 81 | } |
82 | 82 | ||
83 | if (!in_quote) | 83 | if (!in_quote) |
84 | { | 84 | { |
85 | // We are not inside a quote | 85 | // We are not inside a quote |
86 | quote_replaced = false; | 86 | quote_replaced = false; |
87 | 87 | ||
88 | } | 88 | } |
89 | else | 89 | else |
90 | { | 90 | { |
91 | // We are inside a quote | 91 | // We are inside a quote |
92 | if (!quote_replaced) | 92 | if (!quote_replaced) |
93 | { | 93 | { |
94 | // Replace quote | 94 | // Replace quote |
95 | _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]); | 95 | _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]); |
96 | quote_replaced = true; | 96 | quote_replaced = true; |
97 | } | 97 | } |
98 | quote += C; | 98 | quote += C; |
99 | break; | 99 | break; |
100 | } | 100 | } |
101 | _Script += C; | 101 | _Script += C; |
102 | break; | 102 | break; |
103 | } | 103 | } |
104 | last_was_escape = false; | 104 | last_was_escape = false; |
105 | if (C == @"\") | 105 | if (C == @"\") |
106 | { | 106 | { |
107 | last_was_escape = true; | 107 | last_was_escape = true; |
108 | } | 108 | } |
109 | } | 109 | } |
110 | Script = _Script; | 110 | Script = _Script; |
111 | // | 111 | // |
112 | // END OF QUOTE REPLACEMENT | 112 | // END OF QUOTE REPLACEMENT |
113 | // | 113 | // |
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | // | 117 | // |
118 | // PROCESS STATES | 118 | // PROCESS STATES |
119 | // Remove state definitions and add state names to start of each event within state | 119 | // Remove state definitions and add state names to start of each event within state |
120 | // | 120 | // |
121 | int ilevel = 0; | 121 | int ilevel = 0; |
122 | int lastlevel = 0; | 122 | int lastlevel = 0; |
123 | string ret = ""; | 123 | string ret = ""; |
124 | string cache = ""; | 124 | string cache = ""; |
125 | bool in_state = false; | 125 | bool in_state = false; |
126 | string current_statename = ""; | 126 | string current_statename = ""; |
127 | for (int p = 0; p < Script.Length; p++) | 127 | for (int p = 0; p < Script.Length; p++) |
128 | { | 128 | { |
129 | C = Script.Substring(p, 1); | 129 | C = Script.Substring(p, 1); |
130 | while (true) | 130 | while (true) |
131 | { | 131 | { |
132 | // inc / dec level | 132 | // inc / dec level |
133 | if (C == @"{") | 133 | if (C == @"{") |
134 | ilevel++; | 134 | ilevel++; |
135 | if (C == @"}") | 135 | if (C == @"}") |
136 | ilevel--; | 136 | ilevel--; |
137 | if (ilevel < 0) | 137 | if (ilevel < 0) |
138 | ilevel = 0; | 138 | ilevel = 0; |
139 | cache += C; | 139 | cache += C; |
140 | 140 | ||
141 | // if level == 0, add to return | 141 | // if level == 0, add to return |
142 | if (ilevel == 1 && lastlevel == 0) | 142 | if (ilevel == 1 && lastlevel == 0) |
143 | { | 143 | { |
144 | // 0 => 1: Get last | 144 | // 0 => 1: Get last |
145 | Match m = Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 145 | Match m = Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
146 | 146 | ||
147 | in_state = false; | 147 | in_state = false; |
148 | if (m.Success) | 148 | if (m.Success) |
149 | { | 149 | { |
150 | // Go back to level 0, this is not a state | 150 | // Go back to level 0, this is not a state |
151 | in_state = true; | 151 | in_state = true; |
152 | current_statename = m.Groups[1].Captures[0].Value; | 152 | current_statename = m.Groups[1].Captures[0].Value; |
153 | //Console.WriteLine("Current statename: " + current_statename); | 153 | //Console.WriteLine("Current statename: " + current_statename); |
154 | cache = Regex.Replace(cache, @"(?<s1>(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?<s2>[^a-zA-Z_\(\)]*){", "${s1}${s2}", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 154 | cache = Regex.Replace(cache, @"(?<s1>(?![a-zA-Z_]+)\s*)" + @"([a-zA-Z_]+)(?<s2>[^a-zA-Z_\(\)]*){", "${s1}${s2}", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
155 | } | 155 | } |
156 | ret += cache; | 156 | ret += cache; |
157 | cache = ""; | 157 | cache = ""; |
158 | } | 158 | } |
159 | if (ilevel == 0 && lastlevel == 1) | 159 | if (ilevel == 0 && lastlevel == 1) |
160 | { | 160 | { |
161 | // 1 => 0: Remove last } | 161 | // 1 => 0: Remove last } |
162 | if (in_state == true) | 162 | if (in_state == true) |
163 | { | 163 | { |
164 | cache = cache.Remove(cache.Length - 1, 1); | 164 | cache = cache.Remove(cache.Length - 1, 1); |
165 | //cache = Regex.Replace(cache, "}$", "", RegexOptions.Multiline | RegexOptions.Singleline); | 165 | //cache = Regex.Replace(cache, "}$", "", RegexOptions.Multiline | RegexOptions.Singleline); |
166 | 166 | ||
167 | //Replace function names | 167 | //Replace function names |
168 | // void dataserver(key query_id, string data) { | 168 | // void dataserver(key query_id, string data) { |
169 | //cache = Regex.Replace(cache, @"([^a-zA-Z_]\s*)((?!if|switch|for)[a-zA-Z_]+\s*\([^\)]*\)[^{]*{)", "$1" + "<STATE>" + "$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 169 | //cache = Regex.Replace(cache, @"([^a-zA-Z_]\s*)((?!if|switch|for)[a-zA-Z_]+\s*\([^\)]*\)[^{]*{)", "$1" + "<STATE>" + "$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
170 | //Console.WriteLine("Replacing using statename: " + current_statename); | 170 | //Console.WriteLine("Replacing using statename: " + current_statename); |
171 | cache = Regex.Replace(cache, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1public " + current_statename + "_event_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 171 | cache = Regex.Replace(cache, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1public " + current_statename + "_event_$2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
172 | } | 172 | } |
173 | 173 | ||
174 | ret += cache; | 174 | ret += cache; |
175 | cache = ""; | 175 | cache = ""; |
176 | in_state = true; | 176 | in_state = true; |
177 | current_statename = ""; | 177 | current_statename = ""; |
178 | } | 178 | } |
179 | 179 | ||
180 | break; | 180 | break; |
181 | } | 181 | } |
182 | lastlevel = ilevel; | 182 | lastlevel = ilevel; |
183 | } | 183 | } |
184 | ret += cache; | 184 | ret += cache; |
185 | cache = ""; | 185 | cache = ""; |
186 | 186 | ||
187 | Script = ret; | 187 | Script = ret; |
188 | ret = ""; | 188 | ret = ""; |
189 | 189 | ||
190 | 190 | ||
191 | 191 | ||
192 | foreach (string key in dataTypes.Keys) | 192 | foreach (string key in dataTypes.Keys) |
193 | { | 193 | { |
194 | string val; | 194 | string val; |
195 | dataTypes.TryGetValue(key, out val); | 195 | dataTypes.TryGetValue(key, out val); |
196 | 196 | ||
197 | // Replace CAST - (integer) with (int) | 197 | // Replace CAST - (integer) with (int) |
198 | Script = Regex.Replace(Script, @"\(" + key + @"\)", @"(" + val + ")", RegexOptions.Compiled | RegexOptions.Multiline); | 198 | Script = Regex.Replace(Script, @"\(" + key + @"\)", @"(" + val + ")", RegexOptions.Compiled | RegexOptions.Multiline); |
199 | // Replace return types and function variables - integer a() and f(integer a, integer a) | 199 | // Replace return types and function variables - integer a() and f(integer a, integer a) |
200 | Script = Regex.Replace(Script, @"(^|;|}|[\(,])(\s*)" + key + @"(\s*)", @"$1$2" + val + "$3", RegexOptions.Compiled | RegexOptions.Multiline); | 200 | Script = Regex.Replace(Script, @"(^|;|}|[\(,])(\s*)" + key + @"(\s*)", @"$1$2" + val + "$3", RegexOptions.Compiled | RegexOptions.Multiline); |
201 | } | 201 | } |
202 | 202 | ||
203 | // Add "void" in front of functions that needs it | 203 | // Add "void" in front of functions that needs it |
204 | Script = Regex.Replace(Script, @"^(\s*public\s+)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 204 | Script = Regex.Replace(Script, @"^(\s*public\s+)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
205 | 205 | ||
206 | // Replace <x,y,z> and <x,y,z,r> | 206 | // Replace <x,y,z> and <x,y,z,r> |
207 | Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 207 | Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
208 | Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Vector3($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 208 | Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Vector3($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
209 | 209 | ||
210 | // Replace List []'s | 210 | // Replace List []'s |
211 | Script = Regex.Replace(Script, @"\[([^\]]*)\]", @"List.Parse($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 211 | Script = Regex.Replace(Script, @"\[([^\]]*)\]", @"List.Parse($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
212 | 212 | ||
213 | 213 | ||
214 | // Replace (string) to .ToString() // | 214 | // Replace (string) to .ToString() // |
215 | Script = Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.ToString()", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 215 | Script = Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.ToString()", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
216 | Script = Regex.Replace(Script, @"\((float|int)\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.Parse($2)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 216 | Script = Regex.Replace(Script, @"\((float|int)\)\s*([a-zA-Z0-9_]+(\s*\([^\)]*\))?)", @"$1.Parse($2)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
217 | 217 | ||
218 | 218 | ||
219 | // REPLACE BACK QUOTES | 219 | // REPLACE BACK QUOTES |
220 | foreach (string key in quotes.Keys) | 220 | foreach (string key in quotes.Keys) |
221 | { | 221 | { |
222 | string val; | 222 | string val; |
223 | quotes.TryGetValue(key, out val); | 223 | quotes.TryGetValue(key, out val); |
224 | Script = Script.Replace(key, "\"" + val + "\""); | 224 | Script = Script.Replace(key, "\"" + val + "\""); |
225 | } | 225 | } |
226 | 226 | ||
227 | 227 | ||
228 | // Add namespace, class name and inheritance | 228 | // Add namespace, class name and inheritance |
229 | 229 | ||
230 | Return = "";// + | 230 | Return = "";// + |
231 | //"using System; " + | 231 | //"using System; " + |
232 | //"using System.Collections.Generic; " + | 232 | //"using System.Collections.Generic; " + |
233 | //"using System.Text; " + | 233 | //"using System.Text; " + |
234 | //"using OpenSim.Region.ScriptEngine.Common; " + | 234 | //"using OpenSim.Region.ScriptEngine.Common; " + |
235 | //"using integer = System.Int32; " + | 235 | //"using integer = System.Int32; " + |
236 | //"using key = System.String; "; | 236 | //"using key = System.String; "; |
237 | 237 | ||
238 | //// Make a Using out of DataTypes | 238 | //// Make a Using out of DataTypes |
239 | //// Using integer = System.Int32; | 239 | //// Using integer = System.Int32; |
240 | //string _val; | 240 | //string _val; |
241 | //foreach (string key in DataTypes.Keys) | 241 | //foreach (string key in DataTypes.Keys) |
242 | //{ | 242 | //{ |
243 | // DataTypes.TryGetValue(key, out _val); | 243 | // DataTypes.TryGetValue(key, out _val); |
244 | // if (key != _val) | 244 | // if (key != _val) |
245 | // { | 245 | // { |
246 | // Return += "using " + key + " = " + _val + "; "; | 246 | // Return += "using " + key + " = " + _val + "; "; |
247 | // } | 247 | // } |
248 | //} | 248 | //} |
249 | 249 | ||
250 | 250 | ||
251 | Return += "" + | 251 | Return += "" + |
252 | "namespace SecondLife { "; | 252 | "namespace SecondLife { "; |
253 | Return += "" + | 253 | Return += "" + |
254 | //"[Serializable] " + | 254 | //"[Serializable] " + |
255 | "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass { "; | 255 | "public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass { "; |
256 | Return += @"public Script() { } "; | 256 | Return += @"public Script() { } "; |
257 | Return += Script; | 257 | Return += Script; |
258 | Return += "} }\r\n"; | 258 | Return += "} }\r\n"; |
259 | 259 | ||
260 | return Return; | 260 | return Return; |
261 | } | 261 | } |
262 | 262 | ||
263 | 263 | ||
264 | } | 264 | } |
265 | } | 265 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index 63f7260..5f92e96 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | |||
@@ -1,783 +1,783 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | 4 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; |
5 | using OpenSim.Region.ScriptEngine.Common; | 5 | using OpenSim.Region.ScriptEngine.Common; |
6 | using System.Threading; | 6 | using System.Threading; |
7 | using System.Reflection; | 7 | using System.Reflection; |
8 | using System.Runtime.Remoting.Lifetime; | 8 | using System.Runtime.Remoting.Lifetime; |
9 | using integer = System.Int32; | 9 | using integer = System.Int32; |
10 | using key = System.String; | 10 | using key = System.String; |
11 | using vector = OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3; | 11 | using vector = OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3; |
12 | using rotation = OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion; | 12 | using rotation = OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion; |
13 | 13 | ||
14 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 14 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
15 | { | 15 | { |
16 | //[Serializable] | 16 | //[Serializable] |
17 | public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript | 17 | public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript |
18 | { | 18 | { |
19 | 19 | ||
20 | // Object never expires | 20 | // Object never expires |
21 | public override Object InitializeLifetimeService() | 21 | public override Object InitializeLifetimeService() |
22 | { | 22 | { |
23 | //Console.WriteLine("LSL_BaseClass: InitializeLifetimeService()"); | 23 | //Console.WriteLine("LSL_BaseClass: InitializeLifetimeService()"); |
24 | // return null; | 24 | // return null; |
25 | ILease lease = (ILease)base.InitializeLifetimeService(); | 25 | ILease lease = (ILease)base.InitializeLifetimeService(); |
26 | 26 | ||
27 | if (lease.CurrentState == LeaseState.Initial) | 27 | if (lease.CurrentState == LeaseState.Initial) |
28 | { | 28 | { |
29 | lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); | 29 | lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); |
30 | //lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); | 30 | //lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); |
31 | //lease.RenewOnCallTime = TimeSpan.FromSeconds(2); | 31 | //lease.RenewOnCallTime = TimeSpan.FromSeconds(2); |
32 | } | 32 | } |
33 | return lease; | 33 | return lease; |
34 | } | 34 | } |
35 | 35 | ||
36 | 36 | ||
37 | private Executor m_Exec; | 37 | private Executor m_Exec; |
38 | public Executor Exec | 38 | public Executor Exec |
39 | { | 39 | { |
40 | get | 40 | get |
41 | { | 41 | { |
42 | if (m_Exec == null) | 42 | if (m_Exec == null) |
43 | m_Exec = new Executor(this); | 43 | m_Exec = new Executor(this); |
44 | return m_Exec; | 44 | return m_Exec; |
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | public LSL_BuiltIn_Commands_Interface m_LSL_Functions; | 48 | public LSL_BuiltIn_Commands_Interface m_LSL_Functions; |
49 | 49 | ||
50 | public LSL_BaseClass() | 50 | public LSL_BaseClass() |
51 | { | 51 | { |
52 | } | 52 | } |
53 | public string State() | 53 | public string State() |
54 | { | 54 | { |
55 | return m_LSL_Functions.State(); | 55 | return m_LSL_Functions.State(); |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
59 | public void Start(LSL_BuiltIn_Commands_Interface LSL_Functions) | 59 | public void Start(LSL_BuiltIn_Commands_Interface LSL_Functions) |
60 | { | 60 | { |
61 | m_LSL_Functions = LSL_Functions; | 61 | m_LSL_Functions = LSL_Functions; |
62 | 62 | ||
63 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called."); | 63 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called."); |
64 | 64 | ||
65 | // Get this AppDomain's settings and display some of them. | 65 | // Get this AppDomain's settings and display some of them. |
66 | AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; | 66 | AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; |
67 | Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}", | 67 | Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}", |
68 | ads.ApplicationName, | 68 | ads.ApplicationName, |
69 | ads.ApplicationBase, | 69 | ads.ApplicationBase, |
70 | ads.ConfigurationFile | 70 | ads.ConfigurationFile |
71 | ); | 71 | ); |
72 | 72 | ||
73 | // Display the name of the calling AppDomain and the name | 73 | // Display the name of the calling AppDomain and the name |
74 | // of the second domain. | 74 | // of the second domain. |
75 | // NOTE: The application's thread has transitioned between | 75 | // NOTE: The application's thread has transitioned between |
76 | // AppDomains. | 76 | // AppDomains. |
77 | Console.WriteLine("Calling to '{0}'.", | 77 | Console.WriteLine("Calling to '{0}'.", |
78 | Thread.GetDomain().FriendlyName | 78 | Thread.GetDomain().FriendlyName |
79 | ); | 79 | ); |
80 | 80 | ||
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | // | 86 | // |
87 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 87 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
88 | // | 88 | // |
89 | // They are only forwarders to LSL_BuiltIn_Commands.cs | 89 | // They are only forwarders to LSL_BuiltIn_Commands.cs |
90 | // | 90 | // |
91 | public double llSin(double f) { return m_LSL_Functions.llSin(f); } | 91 | public double llSin(double f) { return m_LSL_Functions.llSin(f); } |
92 | public double llCos(double f) { return m_LSL_Functions.llCos(f); } | 92 | public double llCos(double f) { return m_LSL_Functions.llCos(f); } |
93 | public double llTan(double f) { return m_LSL_Functions.llTan(f); } | 93 | public double llTan(double f) { return m_LSL_Functions.llTan(f); } |
94 | public double llAtan2(double x, double y) { return m_LSL_Functions.llAtan2(x, y); } | 94 | public double llAtan2(double x, double y) { return m_LSL_Functions.llAtan2(x, y); } |
95 | public double llSqrt(double f) { return m_LSL_Functions.llSqrt(f); } | 95 | public double llSqrt(double f) { return m_LSL_Functions.llSqrt(f); } |
96 | public double llPow(double fbase, double fexponent) { return m_LSL_Functions.llPow(fbase, fexponent); } | 96 | public double llPow(double fbase, double fexponent) { return m_LSL_Functions.llPow(fbase, fexponent); } |
97 | public int llAbs(int i) { return m_LSL_Functions.llAbs(i); } | 97 | public int llAbs(int i) { return m_LSL_Functions.llAbs(i); } |
98 | public double llFabs(double f) { return m_LSL_Functions.llFabs(f); } | 98 | public double llFabs(double f) { return m_LSL_Functions.llFabs(f); } |
99 | public double llFrand(double mag) { return m_LSL_Functions.llFrand(mag); } | 99 | public double llFrand(double mag) { return m_LSL_Functions.llFrand(mag); } |
100 | public int llFloor(double f) { return m_LSL_Functions.llFloor(f); } | 100 | public int llFloor(double f) { return m_LSL_Functions.llFloor(f); } |
101 | public int llCeil(double f) { return m_LSL_Functions.llCeil(f); } | 101 | public int llCeil(double f) { return m_LSL_Functions.llCeil(f); } |
102 | public int llRound(double f) { return m_LSL_Functions.llRound(f); } | 102 | public int llRound(double f) { return m_LSL_Functions.llRound(f); } |
103 | public double llVecMag(LSL_Types.Vector3 v) { return m_LSL_Functions.llVecMag(v); } | 103 | public double llVecMag(LSL_Types.Vector3 v) { return m_LSL_Functions.llVecMag(v); } |
104 | public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) { return m_LSL_Functions.llVecNorm(v); } | 104 | public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) { return m_LSL_Functions.llVecNorm(v); } |
105 | public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b) { return m_LSL_Functions.llVecDist(a, b); } | 105 | public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b) { return m_LSL_Functions.llVecDist(a, b); } |
106 | public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Euler(r); } | 106 | public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Euler(r); } |
107 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { return m_LSL_Functions.llEuler2Rot(v); } | 107 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { return m_LSL_Functions.llEuler2Rot(v); } |
108 | public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) { return m_LSL_Functions.llAxes2Rot(fwd, left, up); } | 108 | public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) { return m_LSL_Functions.llAxes2Rot(fwd, left, up); } |
109 | public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Fwd(r); } | 109 | public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Fwd(r); } |
110 | public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Left(r); } | 110 | public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Left(r); } |
111 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Up(r); } | 111 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) { return m_LSL_Functions.llRot2Up(r); } |
112 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 start, LSL_Types.Vector3 end) { return m_LSL_Functions.llRotBetween(start, end); } | 112 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 start, LSL_Types.Vector3 end) { return m_LSL_Functions.llRotBetween(start, end); } |
113 | public void llWhisper(int channelID, string text) { m_LSL_Functions.llWhisper(channelID, text); } | 113 | public void llWhisper(int channelID, string text) { m_LSL_Functions.llWhisper(channelID, text); } |
114 | public void llSay(int channelID, string text) { m_LSL_Functions.llSay(channelID, text); } | 114 | public void llSay(int channelID, string text) { m_LSL_Functions.llSay(channelID, text); } |
115 | // | 115 | // |
116 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 116 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
117 | // | 117 | // |
118 | public void llShout(int channelID, string text) { m_LSL_Functions.llShout(channelID, text); } | 118 | public void llShout(int channelID, string text) { m_LSL_Functions.llShout(channelID, text); } |
119 | public int llListen(int channelID, string name, string ID, string msg) { return m_LSL_Functions.llListen(channelID, name, ID, msg); } | 119 | public int llListen(int channelID, string name, string ID, string msg) { return m_LSL_Functions.llListen(channelID, name, ID, msg); } |
120 | public void llListenControl(int number, int active) { m_LSL_Functions.llListenControl(number, active); } | 120 | public void llListenControl(int number, int active) { m_LSL_Functions.llListenControl(number, active); } |
121 | public void llListenRemove(int number) { m_LSL_Functions.llListenRemove(number); } | 121 | public void llListenRemove(int number) { m_LSL_Functions.llListenRemove(number); } |
122 | public void llSensor(string name, string id, int type, double range, double arc) { m_LSL_Functions.llSensor(name, id, type, range, arc); } | 122 | public void llSensor(string name, string id, int type, double range, double arc) { m_LSL_Functions.llSensor(name, id, type, range, arc); } |
123 | public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { m_LSL_Functions.llSensorRepeat(name, id, type, range, arc, rate); } | 123 | public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { m_LSL_Functions.llSensorRepeat(name, id, type, range, arc, rate); } |
124 | public void llSensorRemove() { m_LSL_Functions.llSensorRemove(); } | 124 | public void llSensorRemove() { m_LSL_Functions.llSensorRemove(); } |
125 | public string llDetectedName(int number) { return m_LSL_Functions.llDetectedName(number); } | 125 | public string llDetectedName(int number) { return m_LSL_Functions.llDetectedName(number); } |
126 | public string llDetectedKey(int number) { return m_LSL_Functions.llDetectedKey(number); } | 126 | public string llDetectedKey(int number) { return m_LSL_Functions.llDetectedKey(number); } |
127 | public string llDetectedOwner(int number) { return m_LSL_Functions.llDetectedOwner(number); } | 127 | public string llDetectedOwner(int number) { return m_LSL_Functions.llDetectedOwner(number); } |
128 | public int llDetectedType(int number) { return m_LSL_Functions.llDetectedType(number); } | 128 | public int llDetectedType(int number) { return m_LSL_Functions.llDetectedType(number); } |
129 | public LSL_Types.Vector3 llDetectedPos(int number) { return m_LSL_Functions.llDetectedPos(number); } | 129 | public LSL_Types.Vector3 llDetectedPos(int number) { return m_LSL_Functions.llDetectedPos(number); } |
130 | public LSL_Types.Vector3 llDetectedVel(int number) { return m_LSL_Functions.llDetectedVel(number); } | 130 | public LSL_Types.Vector3 llDetectedVel(int number) { return m_LSL_Functions.llDetectedVel(number); } |
131 | public LSL_Types.Vector3 llDetectedGrab(int number) { return m_LSL_Functions.llDetectedGrab(number); } | 131 | public LSL_Types.Vector3 llDetectedGrab(int number) { return m_LSL_Functions.llDetectedGrab(number); } |
132 | public LSL_Types.Quaternion llDetectedRot(int number) { return m_LSL_Functions.llDetectedRot(number); } | 132 | public LSL_Types.Quaternion llDetectedRot(int number) { return m_LSL_Functions.llDetectedRot(number); } |
133 | public int llDetectedGroup(int number) { return m_LSL_Functions.llDetectedGroup(number); } | 133 | public int llDetectedGroup(int number) { return m_LSL_Functions.llDetectedGroup(number); } |
134 | public int llDetectedLinkNumber(int number) { return m_LSL_Functions.llDetectedLinkNumber(number); } | 134 | public int llDetectedLinkNumber(int number) { return m_LSL_Functions.llDetectedLinkNumber(number); } |
135 | // | 135 | // |
136 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 136 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
137 | // | 137 | // |
138 | public void llDie() { m_LSL_Functions.llDie(); } | 138 | public void llDie() { m_LSL_Functions.llDie(); } |
139 | public double llGround(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGround(offset); } | 139 | public double llGround(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGround(offset); } |
140 | public double llCloud(LSL_Types.Vector3 offset) { return m_LSL_Functions.llCloud(offset); } | 140 | public double llCloud(LSL_Types.Vector3 offset) { return m_LSL_Functions.llCloud(offset); } |
141 | public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) { return m_LSL_Functions.llWind(offset); } | 141 | public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) { return m_LSL_Functions.llWind(offset); } |
142 | public void llSetStatus(int status, int value) { m_LSL_Functions.llSetStatus(status, value); } | 142 | public void llSetStatus(int status, int value) { m_LSL_Functions.llSetStatus(status, value); } |
143 | public int llGetStatus(int status) { return m_LSL_Functions.llGetStatus(status); } | 143 | public int llGetStatus(int status) { return m_LSL_Functions.llGetStatus(status); } |
144 | public void llSetScale(LSL_Types.Vector3 scale) { m_LSL_Functions.llSetScale(scale); } | 144 | public void llSetScale(LSL_Types.Vector3 scale) { m_LSL_Functions.llSetScale(scale); } |
145 | public LSL_Types.Vector3 llGetScale() { return m_LSL_Functions.llGetScale(); } | 145 | public LSL_Types.Vector3 llGetScale() { return m_LSL_Functions.llGetScale(); } |
146 | public void llSetColor(LSL_Types.Vector3 color, int face) { m_LSL_Functions.llSetColor(color, face); } | 146 | public void llSetColor(LSL_Types.Vector3 color, int face) { m_LSL_Functions.llSetColor(color, face); } |
147 | public double llGetAlpha(int face) { return m_LSL_Functions.llGetAlpha(face); } | 147 | public double llGetAlpha(int face) { return m_LSL_Functions.llGetAlpha(face); } |
148 | public void llSetAlpha(double alpha, int face) { m_LSL_Functions.llSetAlpha(alpha, face); } | 148 | public void llSetAlpha(double alpha, int face) { m_LSL_Functions.llSetAlpha(alpha, face); } |
149 | public LSL_Types.Vector3 llGetColor(int face) { return m_LSL_Functions.llGetColor(face); } | 149 | public LSL_Types.Vector3 llGetColor(int face) { return m_LSL_Functions.llGetColor(face); } |
150 | public void llSetTexture(string texture, int face) { m_LSL_Functions.llSetTexture(texture, face); } | 150 | public void llSetTexture(string texture, int face) { m_LSL_Functions.llSetTexture(texture, face); } |
151 | public void llScaleTexture(double u, double v, int face) { m_LSL_Functions.llScaleTexture(u, v, face); } | 151 | public void llScaleTexture(double u, double v, int face) { m_LSL_Functions.llScaleTexture(u, v, face); } |
152 | public void llOffsetTexture(double u, double v, int face) { m_LSL_Functions.llOffsetTexture(u, v, face); } | 152 | public void llOffsetTexture(double u, double v, int face) { m_LSL_Functions.llOffsetTexture(u, v, face); } |
153 | public void llRotateTexture(double rotation, int face) { m_LSL_Functions.llRotateTexture(rotation, face); } | 153 | public void llRotateTexture(double rotation, int face) { m_LSL_Functions.llRotateTexture(rotation, face); } |
154 | public string llGetTexture(int face) { return m_LSL_Functions.llGetTexture(face); } | 154 | public string llGetTexture(int face) { return m_LSL_Functions.llGetTexture(face); } |
155 | // | 155 | // |
156 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 156 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
157 | // | 157 | // |
158 | public void llSetPos(LSL_Types.Vector3 pos) { m_LSL_Functions.llSetPos(pos); } | 158 | public void llSetPos(LSL_Types.Vector3 pos) { m_LSL_Functions.llSetPos(pos); } |
159 | public LSL_Types.Vector3 llGetPos() { return m_LSL_Functions.llGetPos(); } | 159 | public LSL_Types.Vector3 llGetPos() { return m_LSL_Functions.llGetPos(); } |
160 | public LSL_Types.Vector3 llGetLocalPos() { return m_LSL_Functions.llGetLocalPos(); } | 160 | public LSL_Types.Vector3 llGetLocalPos() { return m_LSL_Functions.llGetLocalPos(); } |
161 | public void llSetRot(LSL_Types.Quaternion rot) { m_LSL_Functions.llSetRot(rot); } | 161 | public void llSetRot(LSL_Types.Quaternion rot) { m_LSL_Functions.llSetRot(rot); } |
162 | public LSL_Types.Quaternion llGetRot() { return m_LSL_Functions.llGetRot(); } | 162 | public LSL_Types.Quaternion llGetRot() { return m_LSL_Functions.llGetRot(); } |
163 | public LSL_Types.Quaternion llGetLocalRot() { return m_LSL_Functions.llGetLocalRot(); } | 163 | public LSL_Types.Quaternion llGetLocalRot() { return m_LSL_Functions.llGetLocalRot(); } |
164 | public void llSetForce(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llSetForce(force, local); } | 164 | public void llSetForce(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llSetForce(force, local); } |
165 | public LSL_Types.Vector3 llGetForce() { return m_LSL_Functions.llGetForce(); } | 165 | public LSL_Types.Vector3 llGetForce() { return m_LSL_Functions.llGetForce(); } |
166 | public int llTarget(LSL_Types.Vector3 position, double range) { return m_LSL_Functions.llTarget(position, range); } | 166 | public int llTarget(LSL_Types.Vector3 position, double range) { return m_LSL_Functions.llTarget(position, range); } |
167 | public void llTargetRemove(int number) { m_LSL_Functions.llTargetRemove(number); } | 167 | public void llTargetRemove(int number) { m_LSL_Functions.llTargetRemove(number); } |
168 | public int llRotTarget(LSL_Types.Quaternion rot, double error) { return m_LSL_Functions.llRotTarget(rot, error); } | 168 | public int llRotTarget(LSL_Types.Quaternion rot, double error) { return m_LSL_Functions.llRotTarget(rot, error); } |
169 | public void llRotTargetRemove(int number) { m_LSL_Functions.llRotTargetRemove(number); } | 169 | public void llRotTargetRemove(int number) { m_LSL_Functions.llRotTargetRemove(number); } |
170 | public void llMoveToTarget(LSL_Types.Vector3 target, double tau) { m_LSL_Functions.llMoveToTarget(target, tau); } | 170 | public void llMoveToTarget(LSL_Types.Vector3 target, double tau) { m_LSL_Functions.llMoveToTarget(target, tau); } |
171 | public void llStopMoveToTarget() { m_LSL_Functions.llStopMoveToTarget(); } | 171 | public void llStopMoveToTarget() { m_LSL_Functions.llStopMoveToTarget(); } |
172 | public void llApplyImpulse(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llApplyImpulse(force, local); } | 172 | public void llApplyImpulse(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llApplyImpulse(force, local); } |
173 | // | 173 | // |
174 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 174 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
175 | // | 175 | // |
176 | public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llApplyRotationalImpulse(force, local); } | 176 | public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) { m_LSL_Functions.llApplyRotationalImpulse(force, local); } |
177 | public void llSetTorque(LSL_Types.Vector3 torque, int local) { m_LSL_Functions.llSetTorque(torque, local); } | 177 | public void llSetTorque(LSL_Types.Vector3 torque, int local) { m_LSL_Functions.llSetTorque(torque, local); } |
178 | public LSL_Types.Vector3 llGetTorque() { return m_LSL_Functions.llGetTorque(); } | 178 | public LSL_Types.Vector3 llGetTorque() { return m_LSL_Functions.llGetTorque(); } |
179 | public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local) { m_LSL_Functions.llSetForceAndTorque(force, torque, local); } | 179 | public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local) { m_LSL_Functions.llSetForceAndTorque(force, torque, local); } |
180 | public LSL_Types.Vector3 llGetVel() { return m_LSL_Functions.llGetVel(); } | 180 | public LSL_Types.Vector3 llGetVel() { return m_LSL_Functions.llGetVel(); } |
181 | public LSL_Types.Vector3 llGetAccel() { return m_LSL_Functions.llGetAccel(); } | 181 | public LSL_Types.Vector3 llGetAccel() { return m_LSL_Functions.llGetAccel(); } |
182 | public LSL_Types.Vector3 llGetOmega() { return m_LSL_Functions.llGetOmega(); } | 182 | public LSL_Types.Vector3 llGetOmega() { return m_LSL_Functions.llGetOmega(); } |
183 | public double llGetTimeOfDay() { return m_LSL_Functions.llGetTimeOfDay(); } | 183 | public double llGetTimeOfDay() { return m_LSL_Functions.llGetTimeOfDay(); } |
184 | public double llGetWallclock() { return m_LSL_Functions.llGetWallclock(); } | 184 | public double llGetWallclock() { return m_LSL_Functions.llGetWallclock(); } |
185 | public double llGetTime() { return m_LSL_Functions.llGetTime(); } | 185 | public double llGetTime() { return m_LSL_Functions.llGetTime(); } |
186 | public void llResetTime() { m_LSL_Functions.llResetTime(); } | 186 | public void llResetTime() { m_LSL_Functions.llResetTime(); } |
187 | public double llGetAndResetTime() { return m_LSL_Functions.llGetAndResetTime(); } | 187 | public double llGetAndResetTime() { return m_LSL_Functions.llGetAndResetTime(); } |
188 | public void llSound() { m_LSL_Functions.llSound(); } | 188 | public void llSound() { m_LSL_Functions.llSound(); } |
189 | public void llPlaySound(string sound, double volume) { m_LSL_Functions.llPlaySound(sound, volume); } | 189 | public void llPlaySound(string sound, double volume) { m_LSL_Functions.llPlaySound(sound, volume); } |
190 | public void llLoopSound(string sound, double volume) { m_LSL_Functions.llLoopSound(sound, volume); } | 190 | public void llLoopSound(string sound, double volume) { m_LSL_Functions.llLoopSound(sound, volume); } |
191 | public void llLoopSoundMaster(string sound, double volume) { m_LSL_Functions.llLoopSoundMaster(sound, volume); } | 191 | public void llLoopSoundMaster(string sound, double volume) { m_LSL_Functions.llLoopSoundMaster(sound, volume); } |
192 | public void llLoopSoundSlave(string sound, double volume) { m_LSL_Functions.llLoopSoundSlave(sound, volume); } | 192 | public void llLoopSoundSlave(string sound, double volume) { m_LSL_Functions.llLoopSoundSlave(sound, volume); } |
193 | public void llPlaySoundSlave(string sound, double volume) { m_LSL_Functions.llPlaySoundSlave(sound, volume); } | 193 | public void llPlaySoundSlave(string sound, double volume) { m_LSL_Functions.llPlaySoundSlave(sound, volume); } |
194 | // | 194 | // |
195 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 195 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
196 | // | 196 | // |
197 | public void llTriggerSound(string sound, double volume) { m_LSL_Functions.llTriggerSound(sound, volume); } | 197 | public void llTriggerSound(string sound, double volume) { m_LSL_Functions.llTriggerSound(sound, volume); } |
198 | public void llStopSound() { m_LSL_Functions.llStopSound(); } | 198 | public void llStopSound() { m_LSL_Functions.llStopSound(); } |
199 | public void llPreloadSound(string sound) { m_LSL_Functions.llPreloadSound(sound); } | 199 | public void llPreloadSound(string sound) { m_LSL_Functions.llPreloadSound(sound); } |
200 | public string llGetSubString(string src, int start, int end) { return m_LSL_Functions.llGetSubString(src, start, end); } | 200 | public string llGetSubString(string src, int start, int end) { return m_LSL_Functions.llGetSubString(src, start, end); } |
201 | public string llDeleteSubString(string src, int start, int end) { return m_LSL_Functions.llDeleteSubString(src, start, end); } | 201 | public string llDeleteSubString(string src, int start, int end) { return m_LSL_Functions.llDeleteSubString(src, start, end); } |
202 | public string llInsertString(string dst, int position, string src) { return m_LSL_Functions.llInsertString(dst, position, src); } | 202 | public string llInsertString(string dst, int position, string src) { return m_LSL_Functions.llInsertString(dst, position, src); } |
203 | public string llToUpper(string source) { return m_LSL_Functions.llToUpper(source); } | 203 | public string llToUpper(string source) { return m_LSL_Functions.llToUpper(source); } |
204 | public string llToLower(string source) { return m_LSL_Functions.llToLower(source); } | 204 | public string llToLower(string source) { return m_LSL_Functions.llToLower(source); } |
205 | public int llGiveMoney(string destination, int amount) { return m_LSL_Functions.llGiveMoney(destination, amount); } | 205 | public int llGiveMoney(string destination, int amount) { return m_LSL_Functions.llGiveMoney(destination, amount); } |
206 | public void llMakeExplosion() { m_LSL_Functions.llMakeExplosion(); } | 206 | public void llMakeExplosion() { m_LSL_Functions.llMakeExplosion(); } |
207 | public void llMakeFountain() { m_LSL_Functions.llMakeFountain(); } | 207 | public void llMakeFountain() { m_LSL_Functions.llMakeFountain(); } |
208 | public void llMakeSmoke() { m_LSL_Functions.llMakeSmoke(); } | 208 | public void llMakeSmoke() { m_LSL_Functions.llMakeSmoke(); } |
209 | public void llMakeFire() { m_LSL_Functions.llMakeFire(); } | 209 | public void llMakeFire() { m_LSL_Functions.llMakeFire(); } |
210 | public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { m_LSL_Functions.llRezObject(inventory, pos, rot, param); } | 210 | public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { m_LSL_Functions.llRezObject(inventory, pos, rot, param); } |
211 | public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { m_LSL_Functions.llLookAt(target, strength, damping); } | 211 | public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { m_LSL_Functions.llLookAt(target, strength, damping); } |
212 | public void llStopLookAt() { m_LSL_Functions.llStopLookAt(); } | 212 | public void llStopLookAt() { m_LSL_Functions.llStopLookAt(); } |
213 | public void llSetTimerEvent(double sec) { m_LSL_Functions.llSetTimerEvent(sec); } | 213 | public void llSetTimerEvent(double sec) { m_LSL_Functions.llSetTimerEvent(sec); } |
214 | public void llSleep(double sec) { m_LSL_Functions.llSleep(sec); } | 214 | public void llSleep(double sec) { m_LSL_Functions.llSleep(sec); } |
215 | // | 215 | // |
216 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 216 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
217 | // | 217 | // |
218 | public double llGetMass() { return m_LSL_Functions.llGetMass(); } | 218 | public double llGetMass() { return m_LSL_Functions.llGetMass(); } |
219 | public void llCollisionFilter(string name, string id, int accept) { m_LSL_Functions.llCollisionFilter(name, id, accept); } | 219 | public void llCollisionFilter(string name, string id, int accept) { m_LSL_Functions.llCollisionFilter(name, id, accept); } |
220 | public void llTakeControls(int controls, int accept, int pass_on) { m_LSL_Functions.llTakeControls(controls, accept, pass_on); } | 220 | public void llTakeControls(int controls, int accept, int pass_on) { m_LSL_Functions.llTakeControls(controls, accept, pass_on); } |
221 | public void llReleaseControls() { m_LSL_Functions.llReleaseControls(); } | 221 | public void llReleaseControls() { m_LSL_Functions.llReleaseControls(); } |
222 | public void llAttachToAvatar(int attachment) { m_LSL_Functions.llAttachToAvatar(attachment); } | 222 | public void llAttachToAvatar(int attachment) { m_LSL_Functions.llAttachToAvatar(attachment); } |
223 | public void llDetachFromAvatar() { m_LSL_Functions.llDetachFromAvatar(); } | 223 | public void llDetachFromAvatar() { m_LSL_Functions.llDetachFromAvatar(); } |
224 | public void llTakeCamera() { m_LSL_Functions.llTakeCamera(); } | 224 | public void llTakeCamera() { m_LSL_Functions.llTakeCamera(); } |
225 | public void llReleaseCamera() { m_LSL_Functions.llReleaseCamera(); } | 225 | public void llReleaseCamera() { m_LSL_Functions.llReleaseCamera(); } |
226 | public string llGetOwner() { return m_LSL_Functions.llGetOwner(); } | 226 | public string llGetOwner() { return m_LSL_Functions.llGetOwner(); } |
227 | public void llInstantMessage(string user, string message) { m_LSL_Functions.llInstantMessage(user, message); } | 227 | public void llInstantMessage(string user, string message) { m_LSL_Functions.llInstantMessage(user, message); } |
228 | public void llEmail(string address, string subject, string message) { m_LSL_Functions.llEmail(address, subject, message); } | 228 | public void llEmail(string address, string subject, string message) { m_LSL_Functions.llEmail(address, subject, message); } |
229 | public void llGetNextEmail(string address, string subject) { m_LSL_Functions.llGetNextEmail(address, subject); } | 229 | public void llGetNextEmail(string address, string subject) { m_LSL_Functions.llGetNextEmail(address, subject); } |
230 | public string llGetKey() { return m_LSL_Functions.llGetKey(); } | 230 | public string llGetKey() { return m_LSL_Functions.llGetKey(); } |
231 | public void llSetBuoyancy(double buoyancy) { m_LSL_Functions.llSetBuoyancy(buoyancy); } | 231 | public void llSetBuoyancy(double buoyancy) { m_LSL_Functions.llSetBuoyancy(buoyancy); } |
232 | public void llSetHoverHeight(double height, int water, double tau) { m_LSL_Functions.llSetHoverHeight(height, water, tau); } | 232 | public void llSetHoverHeight(double height, int water, double tau) { m_LSL_Functions.llSetHoverHeight(height, water, tau); } |
233 | public void llStopHover() { m_LSL_Functions.llStopHover(); } | 233 | public void llStopHover() { m_LSL_Functions.llStopHover(); } |
234 | public void llMinEventDelay(double delay) { m_LSL_Functions.llMinEventDelay(delay); } | 234 | public void llMinEventDelay(double delay) { m_LSL_Functions.llMinEventDelay(delay); } |
235 | public void llSoundPreload() { m_LSL_Functions.llSoundPreload(); } | 235 | public void llSoundPreload() { m_LSL_Functions.llSoundPreload(); } |
236 | public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping) { m_LSL_Functions.llRotLookAt(target, strength, damping); } | 236 | public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping) { m_LSL_Functions.llRotLookAt(target, strength, damping); } |
237 | // | 237 | // |
238 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 238 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
239 | // | 239 | // |
240 | public int llStringLength(string str) { return m_LSL_Functions.llStringLength(str); } | 240 | public int llStringLength(string str) { return m_LSL_Functions.llStringLength(str); } |
241 | public void llStartAnimation(string anim) { m_LSL_Functions.llStartAnimation(anim); } | 241 | public void llStartAnimation(string anim) { m_LSL_Functions.llStartAnimation(anim); } |
242 | public void llStopAnimation(string anim) { m_LSL_Functions.llStopAnimation(anim); } | 242 | public void llStopAnimation(string anim) { m_LSL_Functions.llStopAnimation(anim); } |
243 | public void llPointAt() { m_LSL_Functions.llPointAt(); } | 243 | public void llPointAt() { m_LSL_Functions.llPointAt(); } |
244 | public void llStopPointAt() { m_LSL_Functions.llStopPointAt(); } | 244 | public void llStopPointAt() { m_LSL_Functions.llStopPointAt(); } |
245 | public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) { m_LSL_Functions.llTargetOmega(axis, spinrate, gain); } | 245 | public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) { m_LSL_Functions.llTargetOmega(axis, spinrate, gain); } |
246 | public int llGetStartParameter() { return m_LSL_Functions.llGetStartParameter(); } | 246 | public int llGetStartParameter() { return m_LSL_Functions.llGetStartParameter(); } |
247 | public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos) { m_LSL_Functions.llGodLikeRezObject(inventory, pos); } | 247 | public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos) { m_LSL_Functions.llGodLikeRezObject(inventory, pos); } |
248 | public void llRequestPermissions(string agent, int perm) { m_LSL_Functions.llRequestPermissions(agent, perm); } | 248 | public void llRequestPermissions(string agent, int perm) { m_LSL_Functions.llRequestPermissions(agent, perm); } |
249 | public string llGetPermissionsKey() { return m_LSL_Functions.llGetPermissionsKey(); } | 249 | public string llGetPermissionsKey() { return m_LSL_Functions.llGetPermissionsKey(); } |
250 | public int llGetPermissions() { return m_LSL_Functions.llGetPermissions(); } | 250 | public int llGetPermissions() { return m_LSL_Functions.llGetPermissions(); } |
251 | public int llGetLinkNumber() { return m_LSL_Functions.llGetLinkNumber(); } | 251 | public int llGetLinkNumber() { return m_LSL_Functions.llGetLinkNumber(); } |
252 | public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) { m_LSL_Functions.llSetLinkColor(linknumber, color, face); } | 252 | public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) { m_LSL_Functions.llSetLinkColor(linknumber, color, face); } |
253 | public void llCreateLink(string target, int parent) { m_LSL_Functions.llCreateLink(target, parent); } | 253 | public void llCreateLink(string target, int parent) { m_LSL_Functions.llCreateLink(target, parent); } |
254 | public void llBreakLink(int linknum) { m_LSL_Functions.llBreakLink(linknum); } | 254 | public void llBreakLink(int linknum) { m_LSL_Functions.llBreakLink(linknum); } |
255 | public void llBreakAllLinks() { m_LSL_Functions.llBreakAllLinks(); } | 255 | public void llBreakAllLinks() { m_LSL_Functions.llBreakAllLinks(); } |
256 | public string llGetLinkKey(int linknum) { return m_LSL_Functions.llGetLinkKey(linknum); } | 256 | public string llGetLinkKey(int linknum) { return m_LSL_Functions.llGetLinkKey(linknum); } |
257 | public void llGetLinkName(int linknum) { m_LSL_Functions.llGetLinkName(linknum); } | 257 | public void llGetLinkName(int linknum) { m_LSL_Functions.llGetLinkName(linknum); } |
258 | public int llGetInventoryNumber(int type) { return m_LSL_Functions.llGetInventoryNumber(type); } | 258 | public int llGetInventoryNumber(int type) { return m_LSL_Functions.llGetInventoryNumber(type); } |
259 | public string llGetInventoryName(int type, int number) { return m_LSL_Functions.llGetInventoryName(type, number); } | 259 | public string llGetInventoryName(int type, int number) { return m_LSL_Functions.llGetInventoryName(type, number); } |
260 | // | 260 | // |
261 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 261 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
262 | // | 262 | // |
263 | public void llSetScriptState(string name, int run) { m_LSL_Functions.llSetScriptState(name, run); } | 263 | public void llSetScriptState(string name, int run) { m_LSL_Functions.llSetScriptState(name, run); } |
264 | public double llGetEnergy() { return m_LSL_Functions.llGetEnergy(); } | 264 | public double llGetEnergy() { return m_LSL_Functions.llGetEnergy(); } |
265 | public void llGiveInventory(string destination, string inventory) { m_LSL_Functions.llGiveInventory(destination, inventory); } | 265 | public void llGiveInventory(string destination, string inventory) { m_LSL_Functions.llGiveInventory(destination, inventory); } |
266 | public void llRemoveInventory(string item) { m_LSL_Functions.llRemoveInventory(item); } | 266 | public void llRemoveInventory(string item) { m_LSL_Functions.llRemoveInventory(item); } |
267 | public void llSetText(string text, LSL_Types.Vector3 color, double alpha) { m_LSL_Functions.llSetText(text, color, alpha); } | 267 | public void llSetText(string text, LSL_Types.Vector3 color, double alpha) { m_LSL_Functions.llSetText(text, color, alpha); } |
268 | public double llWater(LSL_Types.Vector3 offset) { return m_LSL_Functions.llWater(offset); } | 268 | public double llWater(LSL_Types.Vector3 offset) { return m_LSL_Functions.llWater(offset); } |
269 | public void llPassTouches(int pass) { m_LSL_Functions.llPassTouches(pass); } | 269 | public void llPassTouches(int pass) { m_LSL_Functions.llPassTouches(pass); } |
270 | public string llRequestAgentData(string id, int data) { return m_LSL_Functions.llRequestAgentData(id, data); } | 270 | public string llRequestAgentData(string id, int data) { return m_LSL_Functions.llRequestAgentData(id, data); } |
271 | public string llRequestInventoryData(string name) { return m_LSL_Functions.llRequestInventoryData(name); } | 271 | public string llRequestInventoryData(string name) { return m_LSL_Functions.llRequestInventoryData(name); } |
272 | public void llSetDamage(double damage) { m_LSL_Functions.llSetDamage(damage); } | 272 | public void llSetDamage(double damage) { m_LSL_Functions.llSetDamage(damage); } |
273 | public void llTeleportAgentHome(string agent) { m_LSL_Functions.llTeleportAgentHome(agent); } | 273 | public void llTeleportAgentHome(string agent) { m_LSL_Functions.llTeleportAgentHome(agent); } |
274 | public void llModifyLand(int action, int brush) { m_LSL_Functions.llModifyLand(action, brush); } | 274 | public void llModifyLand(int action, int brush) { m_LSL_Functions.llModifyLand(action, brush); } |
275 | public void llCollisionSound(string impact_sound, double impact_volume) { m_LSL_Functions.llCollisionSound(impact_sound, impact_volume); } | 275 | public void llCollisionSound(string impact_sound, double impact_volume) { m_LSL_Functions.llCollisionSound(impact_sound, impact_volume); } |
276 | public void llCollisionSprite(string impact_sprite) { m_LSL_Functions.llCollisionSprite(impact_sprite); } | 276 | public void llCollisionSprite(string impact_sprite) { m_LSL_Functions.llCollisionSprite(impact_sprite); } |
277 | public string llGetAnimation(string id) { return m_LSL_Functions.llGetAnimation(id); } | 277 | public string llGetAnimation(string id) { return m_LSL_Functions.llGetAnimation(id); } |
278 | public void llResetScript() { m_LSL_Functions.llResetScript(); } | 278 | public void llResetScript() { m_LSL_Functions.llResetScript(); } |
279 | public void llMessageLinked(int linknum, int num, string str, string id) { m_LSL_Functions.llMessageLinked(linknum, num, str, id); } | 279 | public void llMessageLinked(int linknum, int num, string str, string id) { m_LSL_Functions.llMessageLinked(linknum, num, str, id); } |
280 | public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) { m_LSL_Functions.llPushObject(target, impulse, ang_impulse, local); } | 280 | public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) { m_LSL_Functions.llPushObject(target, impulse, ang_impulse, local); } |
281 | public void llPassCollisions(int pass) { m_LSL_Functions.llPassCollisions(pass); } | 281 | public void llPassCollisions(int pass) { m_LSL_Functions.llPassCollisions(pass); } |
282 | public string llGetScriptName() { return m_LSL_Functions.llGetScriptName(); } | 282 | public string llGetScriptName() { return m_LSL_Functions.llGetScriptName(); } |
283 | public int llGetNumberOfSides() { return m_LSL_Functions.llGetNumberOfSides(); } | 283 | public int llGetNumberOfSides() { return m_LSL_Functions.llGetNumberOfSides(); } |
284 | // | 284 | // |
285 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 285 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
286 | // | 286 | // |
287 | public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) { return m_LSL_Functions.llAxisAngle2Rot(axis, angle); } | 287 | public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) { return m_LSL_Functions.llAxisAngle2Rot(axis, angle); } |
288 | public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) { return m_LSL_Functions.llRot2Axis(rot); } | 288 | public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) { return m_LSL_Functions.llRot2Axis(rot); } |
289 | public void llRot2Angle() { m_LSL_Functions.llRot2Angle(); } | 289 | public void llRot2Angle() { m_LSL_Functions.llRot2Angle(); } |
290 | public double llAcos(double val) { return m_LSL_Functions.llAcos(val); } | 290 | public double llAcos(double val) { return m_LSL_Functions.llAcos(val); } |
291 | public double llAsin(double val) { return m_LSL_Functions.llAsin(val); } | 291 | public double llAsin(double val) { return m_LSL_Functions.llAsin(val); } |
292 | public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) { return m_LSL_Functions.llAngleBetween(a, b); } | 292 | public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) { return m_LSL_Functions.llAngleBetween(a, b); } |
293 | public string llGetInventoryKey(string name) { return m_LSL_Functions.llGetInventoryKey(name); } | 293 | public string llGetInventoryKey(string name) { return m_LSL_Functions.llGetInventoryKey(name); } |
294 | public void llAllowInventoryDrop(int add) { m_LSL_Functions.llAllowInventoryDrop(add); } | 294 | public void llAllowInventoryDrop(int add) { m_LSL_Functions.llAllowInventoryDrop(add); } |
295 | public LSL_Types.Vector3 llGetSunDirection() { return m_LSL_Functions.llGetSunDirection(); } | 295 | public LSL_Types.Vector3 llGetSunDirection() { return m_LSL_Functions.llGetSunDirection(); } |
296 | public LSL_Types.Vector3 llGetTextureOffset(int face) { return m_LSL_Functions.llGetTextureOffset(face); } | 296 | public LSL_Types.Vector3 llGetTextureOffset(int face) { return m_LSL_Functions.llGetTextureOffset(face); } |
297 | public LSL_Types.Vector3 llGetTextureScale(int side) { return m_LSL_Functions.llGetTextureScale(side); } | 297 | public LSL_Types.Vector3 llGetTextureScale(int side) { return m_LSL_Functions.llGetTextureScale(side); } |
298 | public double llGetTextureRot(int side) { return m_LSL_Functions.llGetTextureRot(side); } | 298 | public double llGetTextureRot(int side) { return m_LSL_Functions.llGetTextureRot(side); } |
299 | public int llSubStringIndex(string source, string pattern) { return m_LSL_Functions.llSubStringIndex(source, pattern); } | 299 | public int llSubStringIndex(string source, string pattern) { return m_LSL_Functions.llSubStringIndex(source, pattern); } |
300 | public string llGetOwnerKey(string id) { return m_LSL_Functions.llGetOwnerKey(id); } | 300 | public string llGetOwnerKey(string id) { return m_LSL_Functions.llGetOwnerKey(id); } |
301 | public LSL_Types.Vector3 llGetCenterOfMass() { return m_LSL_Functions.llGetCenterOfMass(); } | 301 | public LSL_Types.Vector3 llGetCenterOfMass() { return m_LSL_Functions.llGetCenterOfMass(); } |
302 | public List<string> llListSort(List<string> src, int stride, int ascending) { return m_LSL_Functions.llListSort(src, stride, ascending); } | 302 | public List<string> llListSort(List<string> src, int stride, int ascending) { return m_LSL_Functions.llListSort(src, stride, ascending); } |
303 | public int llGetListLength(List<string> src) { return m_LSL_Functions.llGetListLength(src); } | 303 | public int llGetListLength(List<string> src) { return m_LSL_Functions.llGetListLength(src); } |
304 | // | 304 | // |
305 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 305 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
306 | // | 306 | // |
307 | public int llList2Integer(List<string> src, int index) { return m_LSL_Functions.llList2Integer(src, index); } | 307 | public int llList2Integer(List<string> src, int index) { return m_LSL_Functions.llList2Integer(src, index); } |
308 | public double llList2double(List<string> src, int index) { return m_LSL_Functions.llList2double(src, index); } | 308 | public double llList2double(List<string> src, int index) { return m_LSL_Functions.llList2double(src, index); } |
309 | public string llList2String(List<string> src, int index) { return m_LSL_Functions.llList2String(src, index); } | 309 | public string llList2String(List<string> src, int index) { return m_LSL_Functions.llList2String(src, index); } |
310 | public string llList2Key(List<string> src, int index) { return m_LSL_Functions.llList2Key(src, index); } | 310 | public string llList2Key(List<string> src, int index) { return m_LSL_Functions.llList2Key(src, index); } |
311 | public LSL_Types.Vector3 llList2Vector(List<string> src, int index) { return m_LSL_Functions.llList2Vector(src, index); } | 311 | public LSL_Types.Vector3 llList2Vector(List<string> src, int index) { return m_LSL_Functions.llList2Vector(src, index); } |
312 | public LSL_Types.Quaternion llList2Rot(List<string> src, int index) { return m_LSL_Functions.llList2Rot(src, index); } | 312 | public LSL_Types.Quaternion llList2Rot(List<string> src, int index) { return m_LSL_Functions.llList2Rot(src, index); } |
313 | public List<string> llList2List(List<string> src, int start, int end) { return m_LSL_Functions.llList2List(src, start, end); } | 313 | public List<string> llList2List(List<string> src, int start, int end) { return m_LSL_Functions.llList2List(src, start, end); } |
314 | public List<string> llDeleteSubList(List<string> src, int start, int end) { return m_LSL_Functions.llDeleteSubList(src, start, end); } | 314 | public List<string> llDeleteSubList(List<string> src, int start, int end) { return m_LSL_Functions.llDeleteSubList(src, start, end); } |
315 | public int llGetListEntryType(List<string> src, int index) { return m_LSL_Functions.llGetListEntryType(src, index); } | 315 | public int llGetListEntryType(List<string> src, int index) { return m_LSL_Functions.llGetListEntryType(src, index); } |
316 | public string llList2CSV(List<string> src) { return m_LSL_Functions.llList2CSV(src); } | 316 | public string llList2CSV(List<string> src) { return m_LSL_Functions.llList2CSV(src); } |
317 | public List<string> llCSV2List(string src) { return m_LSL_Functions.llCSV2List(src); } | 317 | public List<string> llCSV2List(string src) { return m_LSL_Functions.llCSV2List(src); } |
318 | public List<string> llListRandomize(List<string> src, int stride) { return m_LSL_Functions.llListRandomize(src, stride); } | 318 | public List<string> llListRandomize(List<string> src, int stride) { return m_LSL_Functions.llListRandomize(src, stride); } |
319 | public List<string> llList2ListStrided(List<string> src, int start, int end, int stride) { return m_LSL_Functions.llList2ListStrided(src, start, end, stride); } | 319 | public List<string> llList2ListStrided(List<string> src, int start, int end, int stride) { return m_LSL_Functions.llList2ListStrided(src, start, end, stride); } |
320 | public LSL_Types.Vector3 llGetRegionCorner() { return m_LSL_Functions.llGetRegionCorner(); } | 320 | public LSL_Types.Vector3 llGetRegionCorner() { return m_LSL_Functions.llGetRegionCorner(); } |
321 | public List<string> llListInsertList(List<string> dest, List<string> src, int start) { return m_LSL_Functions.llListInsertList(dest, src, start); } | 321 | public List<string> llListInsertList(List<string> dest, List<string> src, int start) { return m_LSL_Functions.llListInsertList(dest, src, start); } |
322 | public int llListFindList(List<string> src, List<string> test) { return m_LSL_Functions.llListFindList(src, test); } | 322 | public int llListFindList(List<string> src, List<string> test) { return m_LSL_Functions.llListFindList(src, test); } |
323 | public string llGetObjectName() { return m_LSL_Functions.llGetObjectName(); } | 323 | public string llGetObjectName() { return m_LSL_Functions.llGetObjectName(); } |
324 | public void llSetObjectName(string name) { m_LSL_Functions.llSetObjectName(name); } | 324 | public void llSetObjectName(string name) { m_LSL_Functions.llSetObjectName(name); } |
325 | public string llGetDate() { return m_LSL_Functions.llGetDate(); } | 325 | public string llGetDate() { return m_LSL_Functions.llGetDate(); } |
326 | public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) { return m_LSL_Functions.llEdgeOfWorld(pos, dir); } | 326 | public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) { return m_LSL_Functions.llEdgeOfWorld(pos, dir); } |
327 | public int llGetAgentInfo(string id) { return m_LSL_Functions.llGetAgentInfo(id); } | 327 | public int llGetAgentInfo(string id) { return m_LSL_Functions.llGetAgentInfo(id); } |
328 | // | 328 | // |
329 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 329 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
330 | // | 330 | // |
331 | public void llAdjustSoundVolume(double volume) { m_LSL_Functions.llAdjustSoundVolume(volume); } | 331 | public void llAdjustSoundVolume(double volume) { m_LSL_Functions.llAdjustSoundVolume(volume); } |
332 | public void llSetSoundQueueing(int queue) { m_LSL_Functions.llSetSoundQueueing(queue); } | 332 | public void llSetSoundQueueing(int queue) { m_LSL_Functions.llSetSoundQueueing(queue); } |
333 | public void llSetSoundRadius(double radius) { m_LSL_Functions.llSetSoundRadius(radius); } | 333 | public void llSetSoundRadius(double radius) { m_LSL_Functions.llSetSoundRadius(radius); } |
334 | public string llKey2Name(string id) { return m_LSL_Functions.llKey2Name(id); } | 334 | public string llKey2Name(string id) { return m_LSL_Functions.llKey2Name(id); } |
335 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) { m_LSL_Functions.llSetTextureAnim(mode, face, sizex, sizey, start, length, rate); } | 335 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) { m_LSL_Functions.llSetTextureAnim(mode, face, sizex, sizey, start, length, rate); } |
336 | public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west) { m_LSL_Functions.llTriggerSoundLimited(sound, volume, top_north_east, bottom_south_west); } | 336 | public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west) { m_LSL_Functions.llTriggerSoundLimited(sound, volume, top_north_east, bottom_south_west); } |
337 | public void llEjectFromLand(string pest) { m_LSL_Functions.llEjectFromLand(pest); } | 337 | public void llEjectFromLand(string pest) { m_LSL_Functions.llEjectFromLand(pest); } |
338 | public void llParseString2List() { m_LSL_Functions.llParseString2List(); } | 338 | public void llParseString2List() { m_LSL_Functions.llParseString2List(); } |
339 | public int llOverMyLand(string id) { return m_LSL_Functions.llOverMyLand(id); } | 339 | public int llOverMyLand(string id) { return m_LSL_Functions.llOverMyLand(id); } |
340 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetLandOwnerAt(pos); } | 340 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetLandOwnerAt(pos); } |
341 | public string llGetNotecardLine(string name, int line) { return m_LSL_Functions.llGetNotecardLine(name, line); } | 341 | public string llGetNotecardLine(string name, int line) { return m_LSL_Functions.llGetNotecardLine(name, line); } |
342 | public LSL_Types.Vector3 llGetAgentSize(string id) { return m_LSL_Functions.llGetAgentSize(id); } | 342 | public LSL_Types.Vector3 llGetAgentSize(string id) { return m_LSL_Functions.llGetAgentSize(id); } |
343 | public int llSameGroup(string agent) { return m_LSL_Functions.llSameGroup(agent); } | 343 | public int llSameGroup(string agent) { return m_LSL_Functions.llSameGroup(agent); } |
344 | public void llUnSit(string id) { m_LSL_Functions.llUnSit(id); } | 344 | public void llUnSit(string id) { m_LSL_Functions.llUnSit(id); } |
345 | public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundSlope(offset); } | 345 | public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundSlope(offset); } |
346 | public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundNormal(offset); } | 346 | public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundNormal(offset); } |
347 | public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundContour(offset); } | 347 | public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) { return m_LSL_Functions.llGroundContour(offset); } |
348 | public int llGetAttached() { return m_LSL_Functions.llGetAttached(); } | 348 | public int llGetAttached() { return m_LSL_Functions.llGetAttached(); } |
349 | public int llGetFreeMemory() { return m_LSL_Functions.llGetFreeMemory(); } | 349 | public int llGetFreeMemory() { return m_LSL_Functions.llGetFreeMemory(); } |
350 | public string llGetRegionName() { return m_LSL_Functions.llGetRegionName(); } | 350 | public string llGetRegionName() { return m_LSL_Functions.llGetRegionName(); } |
351 | public double llGetRegionTimeDilation() { return m_LSL_Functions.llGetRegionTimeDilation(); } | 351 | public double llGetRegionTimeDilation() { return m_LSL_Functions.llGetRegionTimeDilation(); } |
352 | public double llGetRegionFPS() { return m_LSL_Functions.llGetRegionFPS(); } | 352 | public double llGetRegionFPS() { return m_LSL_Functions.llGetRegionFPS(); } |
353 | // | 353 | // |
354 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 354 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
355 | // | 355 | // |
356 | public void llParticleSystem(List<Object> rules) { m_LSL_Functions.llParticleSystem(rules); } | 356 | public void llParticleSystem(List<Object> rules) { m_LSL_Functions.llParticleSystem(rules); } |
357 | public void llGroundRepel(double height, int water, double tau) { m_LSL_Functions.llGroundRepel(height, water, tau); } | 357 | public void llGroundRepel(double height, int water, double tau) { m_LSL_Functions.llGroundRepel(height, water, tau); } |
358 | public void llGiveInventoryList() { m_LSL_Functions.llGiveInventoryList(); } | 358 | public void llGiveInventoryList() { m_LSL_Functions.llGiveInventoryList(); } |
359 | public void llSetVehicleType(int type) { m_LSL_Functions.llSetVehicleType(type); } | 359 | public void llSetVehicleType(int type) { m_LSL_Functions.llSetVehicleType(type); } |
360 | public void llSetVehicledoubleParam(int param, double value) { m_LSL_Functions.llSetVehicledoubleParam(param, value); } | 360 | public void llSetVehicledoubleParam(int param, double value) { m_LSL_Functions.llSetVehicledoubleParam(param, value); } |
361 | public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec) { m_LSL_Functions.llSetVehicleVectorParam(param, vec); } | 361 | public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec) { m_LSL_Functions.llSetVehicleVectorParam(param, vec); } |
362 | public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot) { m_LSL_Functions.llSetVehicleRotationParam(param, rot); } | 362 | public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot) { m_LSL_Functions.llSetVehicleRotationParam(param, rot); } |
363 | public void llSetVehicleFlags(int flags) { m_LSL_Functions.llSetVehicleFlags(flags); } | 363 | public void llSetVehicleFlags(int flags) { m_LSL_Functions.llSetVehicleFlags(flags); } |
364 | public void llRemoveVehicleFlags(int flags) { m_LSL_Functions.llRemoveVehicleFlags(flags); } | 364 | public void llRemoveVehicleFlags(int flags) { m_LSL_Functions.llRemoveVehicleFlags(flags); } |
365 | public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot) { m_LSL_Functions.llSitTarget(offset, rot); } | 365 | public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot) { m_LSL_Functions.llSitTarget(offset, rot); } |
366 | public string llAvatarOnSitTarget() { return m_LSL_Functions.llAvatarOnSitTarget(); } | 366 | public string llAvatarOnSitTarget() { return m_LSL_Functions.llAvatarOnSitTarget(); } |
367 | public void llAddToLandPassList(string avatar, double hours) { m_LSL_Functions.llAddToLandPassList(avatar, hours); } | 367 | public void llAddToLandPassList(string avatar, double hours) { m_LSL_Functions.llAddToLandPassList(avatar, hours); } |
368 | public void llSetTouchText(string text) { m_LSL_Functions.llSetTouchText(text); } | 368 | public void llSetTouchText(string text) { m_LSL_Functions.llSetTouchText(text); } |
369 | public void llSetSitText(string text) { m_LSL_Functions.llSetSitText(text); } | 369 | public void llSetSitText(string text) { m_LSL_Functions.llSetSitText(text); } |
370 | public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) { m_LSL_Functions.llSetCameraEyeOffset(offset); } | 370 | public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) { m_LSL_Functions.llSetCameraEyeOffset(offset); } |
371 | public void llSetCameraAtOffset(LSL_Types.Vector3 offset) { m_LSL_Functions.llSetCameraAtOffset(offset); } | 371 | public void llSetCameraAtOffset(LSL_Types.Vector3 offset) { m_LSL_Functions.llSetCameraAtOffset(offset); } |
372 | public void llDumpList2String() { m_LSL_Functions.llDumpList2String(); } | 372 | public void llDumpList2String() { m_LSL_Functions.llDumpList2String(); } |
373 | public void llScriptDanger(LSL_Types.Vector3 pos) { m_LSL_Functions.llScriptDanger(pos); } | 373 | public void llScriptDanger(LSL_Types.Vector3 pos) { m_LSL_Functions.llScriptDanger(pos); } |
374 | public void llDialog(string avatar, string message, List<string> buttons, int chat_channel) { m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel); } | 374 | public void llDialog(string avatar, string message, List<string> buttons, int chat_channel) { m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel); } |
375 | public void llVolumeDetect(int detect) { m_LSL_Functions.llVolumeDetect(detect); } | 375 | public void llVolumeDetect(int detect) { m_LSL_Functions.llVolumeDetect(detect); } |
376 | public void llResetOtherScript(string name) { m_LSL_Functions.llResetOtherScript(name); } | 376 | public void llResetOtherScript(string name) { m_LSL_Functions.llResetOtherScript(name); } |
377 | public int llGetScriptState(string name) { return m_LSL_Functions.llGetScriptState(name); } | 377 | public int llGetScriptState(string name) { return m_LSL_Functions.llGetScriptState(name); } |
378 | public void llRemoteLoadScript() { m_LSL_Functions.llRemoteLoadScript(); } | 378 | public void llRemoteLoadScript() { m_LSL_Functions.llRemoteLoadScript(); } |
379 | public void llSetRemoteScriptAccessPin(int pin) { m_LSL_Functions.llSetRemoteScriptAccessPin(pin); } | 379 | public void llSetRemoteScriptAccessPin(int pin) { m_LSL_Functions.llSetRemoteScriptAccessPin(pin); } |
380 | public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { m_LSL_Functions.llRemoteLoadScriptPin(target, name, pin, running, start_param); } | 380 | public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { m_LSL_Functions.llRemoteLoadScriptPin(target, name, pin, running, start_param); } |
381 | // | 381 | // |
382 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 382 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
383 | // | 383 | // |
384 | public void llOpenRemoteDataChannel() { m_LSL_Functions.llOpenRemoteDataChannel(); } | 384 | public void llOpenRemoteDataChannel() { m_LSL_Functions.llOpenRemoteDataChannel(); } |
385 | public string llSendRemoteData(string channel, string dest, int idata, string sdata) { return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata); } | 385 | public string llSendRemoteData(string channel, string dest, int idata, string sdata) { return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata); } |
386 | public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) { m_LSL_Functions.llRemoteDataReply(channel, message_id, sdata, idata); } | 386 | public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) { m_LSL_Functions.llRemoteDataReply(channel, message_id, sdata, idata); } |
387 | public void llCloseRemoteDataChannel(string channel) { m_LSL_Functions.llCloseRemoteDataChannel(channel); } | 387 | public void llCloseRemoteDataChannel(string channel) { m_LSL_Functions.llCloseRemoteDataChannel(channel); } |
388 | public string llMD5String(string src, int nonce) { return m_LSL_Functions.llMD5String(src, nonce); } | 388 | public string llMD5String(string src, int nonce) { return m_LSL_Functions.llMD5String(src, nonce); } |
389 | public void llSetPrimitiveParams(List<string> rules) { m_LSL_Functions.llSetPrimitiveParams(rules); } | 389 | public void llSetPrimitiveParams(List<string> rules) { m_LSL_Functions.llSetPrimitiveParams(rules); } |
390 | public string llStringToBase64(string str) { return m_LSL_Functions.llStringToBase64(str); } | 390 | public string llStringToBase64(string str) { return m_LSL_Functions.llStringToBase64(str); } |
391 | public string llBase64ToString(string str) { return m_LSL_Functions.llBase64ToString(str); } | 391 | public string llBase64ToString(string str) { return m_LSL_Functions.llBase64ToString(str); } |
392 | public void llXorBase64Strings() { m_LSL_Functions.llXorBase64Strings(); } | 392 | public void llXorBase64Strings() { m_LSL_Functions.llXorBase64Strings(); } |
393 | public void llRemoteDataSetRegion() { m_LSL_Functions.llRemoteDataSetRegion(); } | 393 | public void llRemoteDataSetRegion() { m_LSL_Functions.llRemoteDataSetRegion(); } |
394 | public double llLog10(double val) { return m_LSL_Functions.llLog10(val); } | 394 | public double llLog10(double val) { return m_LSL_Functions.llLog10(val); } |
395 | public double llLog(double val) { return m_LSL_Functions.llLog(val); } | 395 | public double llLog(double val) { return m_LSL_Functions.llLog(val); } |
396 | public List<string> llGetAnimationList(string id) { return m_LSL_Functions.llGetAnimationList(id); } | 396 | public List<string> llGetAnimationList(string id) { return m_LSL_Functions.llGetAnimationList(id); } |
397 | public void llSetParcelMusicURL(string url) { m_LSL_Functions.llSetParcelMusicURL(url); } | 397 | public void llSetParcelMusicURL(string url) { m_LSL_Functions.llSetParcelMusicURL(url); } |
398 | public LSL_Types.Vector3 llGetRootPosition() { return m_LSL_Functions.llGetRootPosition(); } | 398 | public LSL_Types.Vector3 llGetRootPosition() { return m_LSL_Functions.llGetRootPosition(); } |
399 | public LSL_Types.Quaternion llGetRootRotation() { return m_LSL_Functions.llGetRootRotation(); } | 399 | public LSL_Types.Quaternion llGetRootRotation() { return m_LSL_Functions.llGetRootRotation(); } |
400 | public string llGetObjectDesc() { return m_LSL_Functions.llGetObjectDesc(); } | 400 | public string llGetObjectDesc() { return m_LSL_Functions.llGetObjectDesc(); } |
401 | public void llSetObjectDesc(string desc) { m_LSL_Functions.llSetObjectDesc(desc); } | 401 | public void llSetObjectDesc(string desc) { m_LSL_Functions.llSetObjectDesc(desc); } |
402 | public string llGetCreator() { return m_LSL_Functions.llGetCreator(); } | 402 | public string llGetCreator() { return m_LSL_Functions.llGetCreator(); } |
403 | public string llGetTimestamp() { return m_LSL_Functions.llGetTimestamp(); } | 403 | public string llGetTimestamp() { return m_LSL_Functions.llGetTimestamp(); } |
404 | public void llSetLinkAlpha(int linknumber, double alpha, int face) { m_LSL_Functions.llSetLinkAlpha(linknumber, alpha, face); } | 404 | public void llSetLinkAlpha(int linknumber, double alpha, int face) { m_LSL_Functions.llSetLinkAlpha(linknumber, alpha, face); } |
405 | public int llGetNumberOfPrims() { return m_LSL_Functions.llGetNumberOfPrims(); } | 405 | public int llGetNumberOfPrims() { return m_LSL_Functions.llGetNumberOfPrims(); } |
406 | public string llGetNumberOfNotecardLines(string name) { return m_LSL_Functions.llGetNumberOfNotecardLines(name); } | 406 | public string llGetNumberOfNotecardLines(string name) { return m_LSL_Functions.llGetNumberOfNotecardLines(name); } |
407 | public List<string> llGetBoundingBox(string obj) { return m_LSL_Functions.llGetBoundingBox(obj); } | 407 | public List<string> llGetBoundingBox(string obj) { return m_LSL_Functions.llGetBoundingBox(obj); } |
408 | public LSL_Types.Vector3 llGetGeometricCenter() { return m_LSL_Functions.llGetGeometricCenter(); } | 408 | public LSL_Types.Vector3 llGetGeometricCenter() { return m_LSL_Functions.llGetGeometricCenter(); } |
409 | public void llGetPrimitiveParams() { m_LSL_Functions.llGetPrimitiveParams(); } | 409 | public void llGetPrimitiveParams() { m_LSL_Functions.llGetPrimitiveParams(); } |
410 | // | 410 | // |
411 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 411 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
412 | // | 412 | // |
413 | public string llIntegerToBase64(int number) { return m_LSL_Functions.llIntegerToBase64(number); } | 413 | public string llIntegerToBase64(int number) { return m_LSL_Functions.llIntegerToBase64(number); } |
414 | public int llBase64ToInteger(string str) { return m_LSL_Functions.llBase64ToInteger(str); } | 414 | public int llBase64ToInteger(string str) { return m_LSL_Functions.llBase64ToInteger(str); } |
415 | public double llGetGMTclock() { return m_LSL_Functions.llGetGMTclock(); } | 415 | public double llGetGMTclock() { return m_LSL_Functions.llGetGMTclock(); } |
416 | public string llGetSimulatorHostname() { return m_LSL_Functions.llGetSimulatorHostname(); } | 416 | public string llGetSimulatorHostname() { return m_LSL_Functions.llGetSimulatorHostname(); } |
417 | public void llSetLocalRot(LSL_Types.Quaternion rot) { m_LSL_Functions.llSetLocalRot(rot); } | 417 | public void llSetLocalRot(LSL_Types.Quaternion rot) { m_LSL_Functions.llSetLocalRot(rot); } |
418 | public List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers) { return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers); } | 418 | public List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers) { return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers); } |
419 | public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Quaternion rot, int param) { m_LSL_Functions.llRezAtRoot(inventory, position, velocity, rot, param); } | 419 | public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Quaternion rot, int param) { m_LSL_Functions.llRezAtRoot(inventory, position, velocity, rot, param); } |
420 | public int llGetObjectPermMask(int mask) { return m_LSL_Functions.llGetObjectPermMask(mask); } | 420 | public int llGetObjectPermMask(int mask) { return m_LSL_Functions.llGetObjectPermMask(mask); } |
421 | public void llSetObjectPermMask(int mask, int value) { m_LSL_Functions.llSetObjectPermMask(mask, value); } | 421 | public void llSetObjectPermMask(int mask, int value) { m_LSL_Functions.llSetObjectPermMask(mask, value); } |
422 | public void llGetInventoryPermMask(string item, int mask) { m_LSL_Functions.llGetInventoryPermMask(item, mask); } | 422 | public void llGetInventoryPermMask(string item, int mask) { m_LSL_Functions.llGetInventoryPermMask(item, mask); } |
423 | public void llSetInventoryPermMask(string item, int mask, int value) { m_LSL_Functions.llSetInventoryPermMask(item, mask, value); } | 423 | public void llSetInventoryPermMask(string item, int mask, int value) { m_LSL_Functions.llSetInventoryPermMask(item, mask, value); } |
424 | public string llGetInventoryCreator(string item) { return m_LSL_Functions.llGetInventoryCreator(item); } | 424 | public string llGetInventoryCreator(string item) { return m_LSL_Functions.llGetInventoryCreator(item); } |
425 | public void llOwnerSay(string msg) { m_LSL_Functions.llOwnerSay(msg); } | 425 | public void llOwnerSay(string msg) { m_LSL_Functions.llOwnerSay(msg); } |
426 | public void llRequestSimulatorData(string simulator, int data) { m_LSL_Functions.llRequestSimulatorData(simulator, data); } | 426 | public void llRequestSimulatorData(string simulator, int data) { m_LSL_Functions.llRequestSimulatorData(simulator, data); } |
427 | public void llForceMouselook(int mouselook) { m_LSL_Functions.llForceMouselook(mouselook); } | 427 | public void llForceMouselook(int mouselook) { m_LSL_Functions.llForceMouselook(mouselook); } |
428 | public double llGetObjectMass(string id) { return m_LSL_Functions.llGetObjectMass(id); } | 428 | public double llGetObjectMass(string id) { return m_LSL_Functions.llGetObjectMass(id); } |
429 | public void llListReplaceList() { m_LSL_Functions.llListReplaceList(); } | 429 | public void llListReplaceList() { m_LSL_Functions.llListReplaceList(); } |
430 | public void llLoadURL(string avatar_id, string message, string url) { m_LSL_Functions.llLoadURL(avatar_id, message, url); } | 430 | public void llLoadURL(string avatar_id, string message, string url) { m_LSL_Functions.llLoadURL(avatar_id, message, url); } |
431 | public void llParcelMediaCommandList(List<string> commandList) { m_LSL_Functions.llParcelMediaCommandList(commandList); } | 431 | public void llParcelMediaCommandList(List<string> commandList) { m_LSL_Functions.llParcelMediaCommandList(commandList); } |
432 | public void llParcelMediaQuery() { m_LSL_Functions.llParcelMediaQuery(); } | 432 | public void llParcelMediaQuery() { m_LSL_Functions.llParcelMediaQuery(); } |
433 | public int llModPow(int a, int b, int c) { return m_LSL_Functions.llModPow(a, b, c); } | 433 | public int llModPow(int a, int b, int c) { return m_LSL_Functions.llModPow(a, b, c); } |
434 | // | 434 | // |
435 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 435 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
436 | // | 436 | // |
437 | public int llGetInventoryType(string name) { return m_LSL_Functions.llGetInventoryType(name); } | 437 | public int llGetInventoryType(string name) { return m_LSL_Functions.llGetInventoryType(name); } |
438 | public void llSetPayPrice(int price, List<string> quick_pay_buttons) { m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons); } | 438 | public void llSetPayPrice(int price, List<string> quick_pay_buttons) { m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons); } |
439 | public LSL_Types.Vector3 llGetCameraPos() { return m_LSL_Functions.llGetCameraPos(); } | 439 | public LSL_Types.Vector3 llGetCameraPos() { return m_LSL_Functions.llGetCameraPos(); } |
440 | public LSL_Types.Quaternion llGetCameraRot() { return m_LSL_Functions.llGetCameraRot(); } | 440 | public LSL_Types.Quaternion llGetCameraRot() { return m_LSL_Functions.llGetCameraRot(); } |
441 | public void llSetPrimURL() { m_LSL_Functions.llSetPrimURL(); } | 441 | public void llSetPrimURL() { m_LSL_Functions.llSetPrimURL(); } |
442 | public void llRefreshPrimURL() { m_LSL_Functions.llRefreshPrimURL(); } | 442 | public void llRefreshPrimURL() { m_LSL_Functions.llRefreshPrimURL(); } |
443 | public string llEscapeURL(string url) { return m_LSL_Functions.llEscapeURL(url); } | 443 | public string llEscapeURL(string url) { return m_LSL_Functions.llEscapeURL(url); } |
444 | public string llUnescapeURL(string url) { return m_LSL_Functions.llUnescapeURL(url); } | 444 | public string llUnescapeURL(string url) { return m_LSL_Functions.llUnescapeURL(url); } |
445 | public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at) { m_LSL_Functions.llMapDestination(simname, pos, look_at); } | 445 | public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at) { m_LSL_Functions.llMapDestination(simname, pos, look_at); } |
446 | public void llAddToLandBanList(string avatar, double hours) { m_LSL_Functions.llAddToLandBanList(avatar, hours); } | 446 | public void llAddToLandBanList(string avatar, double hours) { m_LSL_Functions.llAddToLandBanList(avatar, hours); } |
447 | public void llRemoveFromLandPassList(string avatar) { m_LSL_Functions.llRemoveFromLandPassList(avatar); } | 447 | public void llRemoveFromLandPassList(string avatar) { m_LSL_Functions.llRemoveFromLandPassList(avatar); } |
448 | public void llRemoveFromLandBanList(string avatar) { m_LSL_Functions.llRemoveFromLandBanList(avatar); } | 448 | public void llRemoveFromLandBanList(string avatar) { m_LSL_Functions.llRemoveFromLandBanList(avatar); } |
449 | public void llSetCameraParams(List<string> rules) { m_LSL_Functions.llSetCameraParams(rules); } | 449 | public void llSetCameraParams(List<string> rules) { m_LSL_Functions.llSetCameraParams(rules); } |
450 | public void llClearCameraParams() { m_LSL_Functions.llClearCameraParams(); } | 450 | public void llClearCameraParams() { m_LSL_Functions.llClearCameraParams(); } |
451 | public double llListStatistics(int operation, List<string> src) { return m_LSL_Functions.llListStatistics(operation, src); } | 451 | public double llListStatistics(int operation, List<string> src) { return m_LSL_Functions.llListStatistics(operation, src); } |
452 | public int llGetUnixTime() { return m_LSL_Functions.llGetUnixTime(); } | 452 | public int llGetUnixTime() { return m_LSL_Functions.llGetUnixTime(); } |
453 | public int llGetParcelFlags(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetParcelFlags(pos); } | 453 | public int llGetParcelFlags(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetParcelFlags(pos); } |
454 | public int llGetRegionFlags() { return m_LSL_Functions.llGetRegionFlags(); } | 454 | public int llGetRegionFlags() { return m_LSL_Functions.llGetRegionFlags(); } |
455 | public string llXorBase64StringsCorrect(string str1, string str2) { return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2); } | 455 | public string llXorBase64StringsCorrect(string str1, string str2) { return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2); } |
456 | public void llHTTPRequest() { m_LSL_Functions.llHTTPRequest(); } | 456 | public void llHTTPRequest() { m_LSL_Functions.llHTTPRequest(); } |
457 | public void llResetLandBanList() { m_LSL_Functions.llResetLandBanList(); } | 457 | public void llResetLandBanList() { m_LSL_Functions.llResetLandBanList(); } |
458 | public void llResetLandPassList() { m_LSL_Functions.llResetLandPassList(); } | 458 | public void llResetLandPassList() { m_LSL_Functions.llResetLandPassList(); } |
459 | public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide); } | 459 | public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide); } |
460 | public List<string> llGetParcelPrimOwners(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetParcelPrimOwners(pos); } | 460 | public List<string> llGetParcelPrimOwners(LSL_Types.Vector3 pos) { return m_LSL_Functions.llGetParcelPrimOwners(pos); } |
461 | public int llGetObjectPrimCount(string object_id) { return m_LSL_Functions.llGetObjectPrimCount(object_id); } | 461 | public int llGetObjectPrimCount(string object_id) { return m_LSL_Functions.llGetObjectPrimCount(object_id); } |
462 | // | 462 | // |
463 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 463 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
464 | // | 464 | // |
465 | public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) { return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide); } | 465 | public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) { return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide); } |
466 | public List<string> llGetParcelDetails(LSL_Types.Vector3 pos, List<string> param) { return m_LSL_Functions.llGetParcelDetails(pos, param); } | 466 | public List<string> llGetParcelDetails(LSL_Types.Vector3 pos, List<string> param) { return m_LSL_Functions.llGetParcelDetails(pos, param); } |
467 | 467 | ||
468 | // | 468 | // |
469 | // OpenSim Functions | 469 | // OpenSim Functions |
470 | // | 470 | // |
471 | public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer) { return m_LSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer); } | 471 | public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer) { return m_LSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer); } |
472 | 472 | ||
473 | // LSL CONSTANTS | 473 | // LSL CONSTANTS |
474 | public const int TRUE = 1; | 474 | public const int TRUE = 1; |
475 | public const int FALSE = 0; | 475 | public const int FALSE = 0; |
476 | public const int STATUS_PHYSICS = 1; | 476 | public const int STATUS_PHYSICS = 1; |
477 | public const int STATUS_ROTATE_X = 2; | 477 | public const int STATUS_ROTATE_X = 2; |
478 | public const int STATUS_ROTATE_Y = 4; | 478 | public const int STATUS_ROTATE_Y = 4; |
479 | public const int STATUS_ROTATE_Z = 8; | 479 | public const int STATUS_ROTATE_Z = 8; |
480 | public const int STATUS_PHANTOM = 16; | 480 | public const int STATUS_PHANTOM = 16; |
481 | public const int STATUS_SANDBOX = 32; | 481 | public const int STATUS_SANDBOX = 32; |
482 | public const int STATUS_BLOCK_GRAB = 64; | 482 | public const int STATUS_BLOCK_GRAB = 64; |
483 | public const int STATUS_DIE_AT_EDGE = 128; | 483 | public const int STATUS_DIE_AT_EDGE = 128; |
484 | public const int STATUS_RETURN_AT_EDGE = 256; | 484 | public const int STATUS_RETURN_AT_EDGE = 256; |
485 | public const int AGENT = 1; | 485 | public const int AGENT = 1; |
486 | public const int ACTIVE = 2; | 486 | public const int ACTIVE = 2; |
487 | public const int PASSIVE = 4; | 487 | public const int PASSIVE = 4; |
488 | public const int SCRIPTED = 8; | 488 | public const int SCRIPTED = 8; |
489 | public const int CONTROL_FWD = 1; | 489 | public const int CONTROL_FWD = 1; |
490 | public const int CONTROL_BACK = 2; | 490 | public const int CONTROL_BACK = 2; |
491 | public const int CONTROL_LEFT = 4; | 491 | public const int CONTROL_LEFT = 4; |
492 | public const int CONTROL_RIGHT = 8; | 492 | public const int CONTROL_RIGHT = 8; |
493 | public const int CONTROL_UP = 16; | 493 | public const int CONTROL_UP = 16; |
494 | public const int CONTROL_DOWN = 32; | 494 | public const int CONTROL_DOWN = 32; |
495 | public const int CONTROL_ROT_LEFT = 256; | 495 | public const int CONTROL_ROT_LEFT = 256; |
496 | public const int CONTROL_ROT_RIGHT = 512; | 496 | public const int CONTROL_ROT_RIGHT = 512; |
497 | public const int CONTROL_LBUTTON = 268435456; | 497 | public const int CONTROL_LBUTTON = 268435456; |
498 | public const int CONTROL_ML_LBUTTON = 1073741824; | 498 | public const int CONTROL_ML_LBUTTON = 1073741824; |
499 | public const int PERMISSION_DEBIT = 2; | 499 | public const int PERMISSION_DEBIT = 2; |
500 | public const int PERMISSION_TAKE_CONTROLS = 4; | 500 | public const int PERMISSION_TAKE_CONTROLS = 4; |
501 | public const int PERMISSION_REMAP_CONTROLS = 8; | 501 | public const int PERMISSION_REMAP_CONTROLS = 8; |
502 | public const int PERMISSION_TRIGGER_ANIMATION = 16; | 502 | public const int PERMISSION_TRIGGER_ANIMATION = 16; |
503 | public const int PERMISSION_ATTACH = 32; | 503 | public const int PERMISSION_ATTACH = 32; |
504 | public const int PERMISSION_RELEASE_OWNERSHIP = 64; | 504 | public const int PERMISSION_RELEASE_OWNERSHIP = 64; |
505 | public const int PERMISSION_CHANGE_LINKS = 128; | 505 | public const int PERMISSION_CHANGE_LINKS = 128; |
506 | public const int PERMISSION_CHANGE_JOINTS = 256; | 506 | public const int PERMISSION_CHANGE_JOINTS = 256; |
507 | public const int PERMISSION_CHANGE_PERMISSIONS = 512; | 507 | public const int PERMISSION_CHANGE_PERMISSIONS = 512; |
508 | public const int PERMISSION_TRACK_CAMERA = 1024; | 508 | public const int PERMISSION_TRACK_CAMERA = 1024; |
509 | public const int AGENT_FLYING = 1; | 509 | public const int AGENT_FLYING = 1; |
510 | public const int AGENT_ATTACHMENTS = 2; | 510 | public const int AGENT_ATTACHMENTS = 2; |
511 | public const int AGENT_SCRIPTED = 4; | 511 | public const int AGENT_SCRIPTED = 4; |
512 | public const int AGENT_MOUSELOOK = 8; | 512 | public const int AGENT_MOUSELOOK = 8; |
513 | public const int AGENT_SITTING = 16; | 513 | public const int AGENT_SITTING = 16; |
514 | public const int AGENT_ON_OBJECT = 32; | 514 | public const int AGENT_ON_OBJECT = 32; |
515 | public const int AGENT_AWAY = 64; | 515 | public const int AGENT_AWAY = 64; |
516 | public const int AGENT_WALKING = 128; | 516 | public const int AGENT_WALKING = 128; |
517 | public const int AGENT_IN_AIR = 256; | 517 | public const int AGENT_IN_AIR = 256; |
518 | public const int AGENT_TYPING = 512; | 518 | public const int AGENT_TYPING = 512; |
519 | public const int AGENT_CROUCHING = 1024; | 519 | public const int AGENT_CROUCHING = 1024; |
520 | public const int AGENT_BUSY = 2048; | 520 | public const int AGENT_BUSY = 2048; |
521 | public const int AGENT_ALWAYS_RUN = 4096; | 521 | public const int AGENT_ALWAYS_RUN = 4096; |
522 | public const int PSYS_PART_INTERP_COLOR_MASK = 1; | 522 | public const int PSYS_PART_INTERP_COLOR_MASK = 1; |
523 | public const int PSYS_PART_INTERP_SCALE_MASK = 2; | 523 | public const int PSYS_PART_INTERP_SCALE_MASK = 2; |
524 | public const int PSYS_PART_BOUNCE_MASK = 4; | 524 | public const int PSYS_PART_BOUNCE_MASK = 4; |
525 | public const int PSYS_PART_WIND_MASK = 8; | 525 | public const int PSYS_PART_WIND_MASK = 8; |
526 | public const int PSYS_PART_FOLLOW_SRC_MASK = 16; | 526 | public const int PSYS_PART_FOLLOW_SRC_MASK = 16; |
527 | public const int PSYS_PART_FOLLOW_VELOCITY_MASK = 32; | 527 | public const int PSYS_PART_FOLLOW_VELOCITY_MASK = 32; |
528 | public const int PSYS_PART_TARGET_POS_MASK = 64; | 528 | public const int PSYS_PART_TARGET_POS_MASK = 64; |
529 | public const int PSYS_PART_TARGET_LINEAR_MASK = 128; | 529 | public const int PSYS_PART_TARGET_LINEAR_MASK = 128; |
530 | public const int PSYS_PART_EMISSIVE_MASK = 256; | 530 | public const int PSYS_PART_EMISSIVE_MASK = 256; |
531 | public const int PSYS_PART_FLAGS = 0; | 531 | public const int PSYS_PART_FLAGS = 0; |
532 | public const int PSYS_PART_START_COLOR = 1; | 532 | public const int PSYS_PART_START_COLOR = 1; |
533 | public const int PSYS_PART_START_ALPHA = 2; | 533 | public const int PSYS_PART_START_ALPHA = 2; |
534 | public const int PSYS_PART_END_COLOR = 3; | 534 | public const int PSYS_PART_END_COLOR = 3; |
535 | public const int PSYS_PART_END_ALPHA = 4; | 535 | public const int PSYS_PART_END_ALPHA = 4; |
536 | public const int PSYS_PART_START_SCALE = 5; | 536 | public const int PSYS_PART_START_SCALE = 5; |
537 | public const int PSYS_PART_END_SCALE = 6; | 537 | public const int PSYS_PART_END_SCALE = 6; |
538 | public const int PSYS_PART_MAX_AGE = 7; | 538 | public const int PSYS_PART_MAX_AGE = 7; |
539 | public const int PSYS_SRC_ACCEL = 8; | 539 | public const int PSYS_SRC_ACCEL = 8; |
540 | public const int PSYS_SRC_PATTERN = 9; | 540 | public const int PSYS_SRC_PATTERN = 9; |
541 | public const int PSYS_SRC_INNERANGLE = 10; | 541 | public const int PSYS_SRC_INNERANGLE = 10; |
542 | public const int PSYS_SRC_OUTERANGLE = 11; | 542 | public const int PSYS_SRC_OUTERANGLE = 11; |
543 | public const int PSYS_SRC_TEXTURE = 12; | 543 | public const int PSYS_SRC_TEXTURE = 12; |
544 | public const int PSYS_SRC_BURST_RATE = 13; | 544 | public const int PSYS_SRC_BURST_RATE = 13; |
545 | public const int PSYS_SRC_BURST_PART_COUNT = 15; | 545 | public const int PSYS_SRC_BURST_PART_COUNT = 15; |
546 | public const int PSYS_SRC_BURST_RADIUS = 16; | 546 | public const int PSYS_SRC_BURST_RADIUS = 16; |
547 | public const int PSYS_SRC_BURST_SPEED_MIN = 17; | 547 | public const int PSYS_SRC_BURST_SPEED_MIN = 17; |
548 | public const int PSYS_SRC_BURST_SPEED_MAX = 18; | 548 | public const int PSYS_SRC_BURST_SPEED_MAX = 18; |
549 | public const int PSYS_SRC_MAX_AGE = 19; | 549 | public const int PSYS_SRC_MAX_AGE = 19; |
550 | public const int PSYS_SRC_TARGET_KEY = 20; | 550 | public const int PSYS_SRC_TARGET_KEY = 20; |
551 | public const int PSYS_SRC_OMEGA = 21; | 551 | public const int PSYS_SRC_OMEGA = 21; |
552 | public const int PSYS_SRC_ANGLE_BEGIN = 22; | 552 | public const int PSYS_SRC_ANGLE_BEGIN = 22; |
553 | public const int PSYS_SRC_ANGLE_END = 23; | 553 | public const int PSYS_SRC_ANGLE_END = 23; |
554 | public const int PSYS_SRC_PATTERN_DROP = 1; | 554 | public const int PSYS_SRC_PATTERN_DROP = 1; |
555 | public const int PSYS_SRC_PATTERN_EXPLODE = 2; | 555 | public const int PSYS_SRC_PATTERN_EXPLODE = 2; |
556 | public const int PSYS_SRC_PATTERN_ANGLE = 4; | 556 | public const int PSYS_SRC_PATTERN_ANGLE = 4; |
557 | public const int PSYS_SRC_PATTERN_ANGLE_CONE = 8; | 557 | public const int PSYS_SRC_PATTERN_ANGLE_CONE = 8; |
558 | public const int PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY = 16; | 558 | public const int PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY = 16; |
559 | public const int VEHICLE_TYPE_NONE = 0; | 559 | public const int VEHICLE_TYPE_NONE = 0; |
560 | public const int VEHICLE_TYPE_SLED = 1; | 560 | public const int VEHICLE_TYPE_SLED = 1; |
561 | public const int VEHICLE_TYPE_CAR = 2; | 561 | public const int VEHICLE_TYPE_CAR = 2; |
562 | public const int VEHICLE_TYPE_BOAT = 3; | 562 | public const int VEHICLE_TYPE_BOAT = 3; |
563 | public const int VEHICLE_TYPE_AIRPLANE = 4; | 563 | public const int VEHICLE_TYPE_AIRPLANE = 4; |
564 | public const int VEHICLE_TYPE_BALLOON = 5; | 564 | public const int VEHICLE_TYPE_BALLOON = 5; |
565 | public const int VEHICLE_LINEAR_FRICTION_TIMESCALE = 16; | 565 | public const int VEHICLE_LINEAR_FRICTION_TIMESCALE = 16; |
566 | public const int VEHICLE_ANGULAR_FRICTION_TIMESCALE = 17; | 566 | public const int VEHICLE_ANGULAR_FRICTION_TIMESCALE = 17; |
567 | public const int VEHICLE_LINEAR_MOTOR_DIRECTION = 18; | 567 | public const int VEHICLE_LINEAR_MOTOR_DIRECTION = 18; |
568 | public const int VEHICLE_LINEAR_MOTOR_OFFSET = 20; | 568 | public const int VEHICLE_LINEAR_MOTOR_OFFSET = 20; |
569 | public const int VEHICLE_ANGULAR_MOTOR_DIRECTION = 19; | 569 | public const int VEHICLE_ANGULAR_MOTOR_DIRECTION = 19; |
570 | public const int VEHICLE_HOVER_HEIGHT = 24; | 570 | public const int VEHICLE_HOVER_HEIGHT = 24; |
571 | public const int VEHICLE_HOVER_EFFICIENCY = 25; | 571 | public const int VEHICLE_HOVER_EFFICIENCY = 25; |
572 | public const int VEHICLE_HOVER_TIMESCALE = 26; | 572 | public const int VEHICLE_HOVER_TIMESCALE = 26; |
573 | public const int VEHICLE_BUOYANCY = 27; | 573 | public const int VEHICLE_BUOYANCY = 27; |
574 | public const int VEHICLE_LINEAR_DEFLECTION_EFFICIENCY = 28; | 574 | public const int VEHICLE_LINEAR_DEFLECTION_EFFICIENCY = 28; |
575 | public const int VEHICLE_LINEAR_DEFLECTION_TIMESCALE = 29; | 575 | public const int VEHICLE_LINEAR_DEFLECTION_TIMESCALE = 29; |
576 | public const int VEHICLE_LINEAR_MOTOR_TIMESCALE = 30; | 576 | public const int VEHICLE_LINEAR_MOTOR_TIMESCALE = 30; |
577 | public const int VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE = 31; | 577 | public const int VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE = 31; |
578 | public const int VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY = 32; | 578 | public const int VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY = 32; |
579 | public const int VEHICLE_ANGULAR_DEFLECTION_TIMESCALE = 33; | 579 | public const int VEHICLE_ANGULAR_DEFLECTION_TIMESCALE = 33; |
580 | public const int VEHICLE_ANGULAR_MOTOR_TIMESCALE = 34; | 580 | public const int VEHICLE_ANGULAR_MOTOR_TIMESCALE = 34; |
581 | public const int VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE = 35; | 581 | public const int VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE = 35; |
582 | public const int VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY = 36; | 582 | public const int VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY = 36; |
583 | public const int VEHICLE_VERTICAL_ATTRACTION_TIMESCALE = 37; | 583 | public const int VEHICLE_VERTICAL_ATTRACTION_TIMESCALE = 37; |
584 | public const int VEHICLE_BANKING_EFFICIENCY = 38; | 584 | public const int VEHICLE_BANKING_EFFICIENCY = 38; |
585 | public const int VEHICLE_BANKING_MIX = 39; | 585 | public const int VEHICLE_BANKING_MIX = 39; |
586 | public const int VEHICLE_BANKING_TIMESCALE = 40; | 586 | public const int VEHICLE_BANKING_TIMESCALE = 40; |
587 | public const int VEHICLE_REFERENCE_FRAME = 44; | 587 | public const int VEHICLE_REFERENCE_FRAME = 44; |
588 | public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1; | 588 | public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1; |
589 | public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2; | 589 | public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2; |
590 | public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4; | 590 | public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4; |
591 | public const int VEHICLE_FLAG_HOVER_TERRAIN_ONLY = 8; | 591 | public const int VEHICLE_FLAG_HOVER_TERRAIN_ONLY = 8; |
592 | public const int VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT = 16; | 592 | public const int VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT = 16; |
593 | public const int VEHICLE_FLAG_HOVER_UP_ONLY = 32; | 593 | public const int VEHICLE_FLAG_HOVER_UP_ONLY = 32; |
594 | public const int VEHICLE_FLAG_LIMIT_MOTOR_UP = 64; | 594 | public const int VEHICLE_FLAG_LIMIT_MOTOR_UP = 64; |
595 | public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128; | 595 | public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128; |
596 | public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256; | 596 | public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256; |
597 | public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512; | 597 | public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512; |
598 | public const int INVENTORY_ALL = -1; | 598 | public const int INVENTORY_ALL = -1; |
599 | public const int INVENTORY_NONE = -1; | 599 | public const int INVENTORY_NONE = -1; |
600 | public const int INVENTORY_TEXTURE = 0; | 600 | public const int INVENTORY_TEXTURE = 0; |
601 | public const int INVENTORY_SOUND = 1; | 601 | public const int INVENTORY_SOUND = 1; |
602 | public const int INVENTORY_LANDMARK = 3; | 602 | public const int INVENTORY_LANDMARK = 3; |
603 | public const int INVENTORY_CLOTHING = 5; | 603 | public const int INVENTORY_CLOTHING = 5; |
604 | public const int INVENTORY_OBJECT = 6; | 604 | public const int INVENTORY_OBJECT = 6; |
605 | public const int INVENTORY_NOTECARD = 7; | 605 | public const int INVENTORY_NOTECARD = 7; |
606 | public const int INVENTORY_SCRIPT = 10; | 606 | public const int INVENTORY_SCRIPT = 10; |
607 | public const int INVENTORY_BODYPART = 13; | 607 | public const int INVENTORY_BODYPART = 13; |
608 | public const int INVENTORY_ANIMATION = 20; | 608 | public const int INVENTORY_ANIMATION = 20; |
609 | public const int INVENTORY_GESTURE = 21; | 609 | public const int INVENTORY_GESTURE = 21; |
610 | public const int ATTACH_CHEST = 1; | 610 | public const int ATTACH_CHEST = 1; |
611 | public const int ATTACH_HEAD = 2; | 611 | public const int ATTACH_HEAD = 2; |
612 | public const int ATTACH_LSHOULDER = 3; | 612 | public const int ATTACH_LSHOULDER = 3; |
613 | public const int ATTACH_RSHOULDER = 4; | 613 | public const int ATTACH_RSHOULDER = 4; |
614 | public const int ATTACH_LHAND = 5; | 614 | public const int ATTACH_LHAND = 5; |
615 | public const int ATTACH_RHAND = 6; | 615 | public const int ATTACH_RHAND = 6; |
616 | public const int ATTACH_LFOOT = 7; | 616 | public const int ATTACH_LFOOT = 7; |
617 | public const int ATTACH_RFOOT = 8; | 617 | public const int ATTACH_RFOOT = 8; |
618 | public const int ATTACH_BACK = 9; | 618 | public const int ATTACH_BACK = 9; |
619 | public const int ATTACH_PELVIS = 10; | 619 | public const int ATTACH_PELVIS = 10; |
620 | public const int ATTACH_MOUTH = 11; | 620 | public const int ATTACH_MOUTH = 11; |
621 | public const int ATTACH_CHIN = 12; | 621 | public const int ATTACH_CHIN = 12; |
622 | public const int ATTACH_LEAR = 13; | 622 | public const int ATTACH_LEAR = 13; |
623 | public const int ATTACH_REAR = 14; | 623 | public const int ATTACH_REAR = 14; |
624 | public const int ATTACH_LEYE = 15; | 624 | public const int ATTACH_LEYE = 15; |
625 | public const int ATTACH_REYE = 16; | 625 | public const int ATTACH_REYE = 16; |
626 | public const int ATTACH_NOSE = 17; | 626 | public const int ATTACH_NOSE = 17; |
627 | public const int ATTACH_RUARM = 18; | 627 | public const int ATTACH_RUARM = 18; |
628 | public const int ATTACH_RLARM = 19; | 628 | public const int ATTACH_RLARM = 19; |
629 | public const int ATTACH_LUARM = 20; | 629 | public const int ATTACH_LUARM = 20; |
630 | public const int ATTACH_LLARM = 21; | 630 | public const int ATTACH_LLARM = 21; |
631 | public const int ATTACH_RHIP = 22; | 631 | public const int ATTACH_RHIP = 22; |
632 | public const int ATTACH_RULEG = 23; | 632 | public const int ATTACH_RULEG = 23; |
633 | public const int ATTACH_RLLEG = 24; | 633 | public const int ATTACH_RLLEG = 24; |
634 | public const int ATTACH_LHIP = 25; | 634 | public const int ATTACH_LHIP = 25; |
635 | public const int ATTACH_LULEG = 26; | 635 | public const int ATTACH_LULEG = 26; |
636 | public const int ATTACH_LLLEG = 27; | 636 | public const int ATTACH_LLLEG = 27; |
637 | public const int ATTACH_BELLY = 28; | 637 | public const int ATTACH_BELLY = 28; |
638 | public const int ATTACH_RPEC = 29; | 638 | public const int ATTACH_RPEC = 29; |
639 | public const int ATTACH_LPEC = 30; | 639 | public const int ATTACH_LPEC = 30; |
640 | public const int LAND_LEVEL = 0; | 640 | public const int LAND_LEVEL = 0; |
641 | public const int LAND_RAISE = 1; | 641 | public const int LAND_RAISE = 1; |
642 | public const int LAND_LOWER = 2; | 642 | public const int LAND_LOWER = 2; |
643 | public const int LAND_SMOOTH = 3; | 643 | public const int LAND_SMOOTH = 3; |
644 | public const int LAND_NOISE = 4; | 644 | public const int LAND_NOISE = 4; |
645 | public const int LAND_REVERT = 5; | 645 | public const int LAND_REVERT = 5; |
646 | public const int LAND_SMALL_BRUSH = 1; | 646 | public const int LAND_SMALL_BRUSH = 1; |
647 | public const int LAND_MEDIUM_BRUSH = 2; | 647 | public const int LAND_MEDIUM_BRUSH = 2; |
648 | public const int LAND_LARGE_BRUSH = 3; | 648 | public const int LAND_LARGE_BRUSH = 3; |
649 | public const int DATA_ONLINE = 1; | 649 | public const int DATA_ONLINE = 1; |
650 | public const int DATA_NAME = 2; | 650 | public const int DATA_NAME = 2; |
651 | public const int DATA_BORN = 3; | 651 | public const int DATA_BORN = 3; |
652 | public const int DATA_RATING = 4; | 652 | public const int DATA_RATING = 4; |
653 | public const int DATA_SIM_POS = 5; | 653 | public const int DATA_SIM_POS = 5; |
654 | public const int DATA_SIM_STATUS = 6; | 654 | public const int DATA_SIM_STATUS = 6; |
655 | public const int DATA_SIM_RATING = 7; | 655 | public const int DATA_SIM_RATING = 7; |
656 | public const int ANIM_ON = 1; | 656 | public const int ANIM_ON = 1; |
657 | public const int LOOP = 2; | 657 | public const int LOOP = 2; |
658 | public const int REVERSE = 4; | 658 | public const int REVERSE = 4; |
659 | public const int PING_PONG = 8; | 659 | public const int PING_PONG = 8; |
660 | public const int SMOOTH = 16; | 660 | public const int SMOOTH = 16; |
661 | public const int ROTATE = 32; | 661 | public const int ROTATE = 32; |
662 | public const int SCALE = 64; | 662 | public const int SCALE = 64; |
663 | public const int ALL_SIDES = -1; | 663 | public const int ALL_SIDES = -1; |
664 | public const int LINK_SET = -1; | 664 | public const int LINK_SET = -1; |
665 | public const int LINK_ROOT = 1; | 665 | public const int LINK_ROOT = 1; |
666 | public const int LINK_ALL_OTHERS = -2; | 666 | public const int LINK_ALL_OTHERS = -2; |
667 | public const int LINK_ALL_CHILDREN = -3; | 667 | public const int LINK_ALL_CHILDREN = -3; |
668 | public const int LINK_THIS = -4; | 668 | public const int LINK_THIS = -4; |
669 | public const int CHANGED_INVENTORY = 1; | 669 | public const int CHANGED_INVENTORY = 1; |
670 | public const int CHANGED_COLOR = 2; | 670 | public const int CHANGED_COLOR = 2; |
671 | public const int CHANGED_SHAPE = 4; | 671 | public const int CHANGED_SHAPE = 4; |
672 | public const int CHANGED_SCALE = 8; | 672 | public const int CHANGED_SCALE = 8; |
673 | public const int CHANGED_TEXTURE = 16; | 673 | public const int CHANGED_TEXTURE = 16; |
674 | public const int CHANGED_LINK = 32; | 674 | public const int CHANGED_LINK = 32; |
675 | public const int CHANGED_ALLOWED_DROP = 64; | 675 | public const int CHANGED_ALLOWED_DROP = 64; |
676 | public const int CHANGED_OWNER = 128; | 676 | public const int CHANGED_OWNER = 128; |
677 | public const int TYPE_INVALID = 0; | 677 | public const int TYPE_INVALID = 0; |
678 | public const int TYPE_INTEGER = 1; | 678 | public const int TYPE_INTEGER = 1; |
679 | public const int TYPE_double = 2; | 679 | public const int TYPE_double = 2; |
680 | public const int TYPE_STRING = 3; | 680 | public const int TYPE_STRING = 3; |
681 | public const int TYPE_KEY = 4; | 681 | public const int TYPE_KEY = 4; |
682 | public const int TYPE_VECTOR = 5; | 682 | public const int TYPE_VECTOR = 5; |
683 | public const int TYPE_ROTATION = 6; | 683 | public const int TYPE_ROTATION = 6; |
684 | public const int REMOTE_DATA_CHANNEL = 1; | 684 | public const int REMOTE_DATA_CHANNEL = 1; |
685 | public const int REMOTE_DATA_REQUEST = 2; | 685 | public const int REMOTE_DATA_REQUEST = 2; |
686 | public const int REMOTE_DATA_REPLY = 3; | 686 | public const int REMOTE_DATA_REPLY = 3; |
687 | //public const int PRIM_TYPE = 1; | 687 | //public const int PRIM_TYPE = 1; |
688 | public const int PRIM_MATERIAL = 2; | 688 | public const int PRIM_MATERIAL = 2; |
689 | public const int PRIM_PHYSICS = 3; | 689 | public const int PRIM_PHYSICS = 3; |
690 | public const int PRIM_TEMP_ON_REZ = 4; | 690 | public const int PRIM_TEMP_ON_REZ = 4; |
691 | public const int PRIM_PHANTOM = 5; | 691 | public const int PRIM_PHANTOM = 5; |
692 | public const int PRIM_POSITION = 6; | 692 | public const int PRIM_POSITION = 6; |
693 | public const int PRIM_SIZE = 7; | 693 | public const int PRIM_SIZE = 7; |
694 | public const int PRIM_ROTATION = 8; | 694 | public const int PRIM_ROTATION = 8; |
695 | public const int PRIM_TYPE = 9; | 695 | public const int PRIM_TYPE = 9; |
696 | public const int PRIM_TEXTURE = 17; | 696 | public const int PRIM_TEXTURE = 17; |
697 | public const int PRIM_COLOR = 18; | 697 | public const int PRIM_COLOR = 18; |
698 | public const int PRIM_BUMP_SHINY = 19; | 698 | public const int PRIM_BUMP_SHINY = 19; |
699 | public const int PRIM_FULLBRIGHT = 20; | 699 | public const int PRIM_FULLBRIGHT = 20; |
700 | public const int PRIM_FLEXIBLE = 21; | 700 | public const int PRIM_FLEXIBLE = 21; |
701 | public const int PRIM_TEXGEN = 22; | 701 | public const int PRIM_TEXGEN = 22; |
702 | public const int PRIM_TEXGEN_DEFAULT = 0; | 702 | public const int PRIM_TEXGEN_DEFAULT = 0; |
703 | public const int PRIM_TEXGEN_PLANAR = 1; | 703 | public const int PRIM_TEXGEN_PLANAR = 1; |
704 | public const int PRIM_TYPE_BOX = 0; | 704 | public const int PRIM_TYPE_BOX = 0; |
705 | public const int PRIM_TYPE_CYLINDER = 1; | 705 | public const int PRIM_TYPE_CYLINDER = 1; |
706 | public const int PRIM_TYPE_PRISM = 2; | 706 | public const int PRIM_TYPE_PRISM = 2; |
707 | public const int PRIM_TYPE_SPHERE = 3; | 707 | public const int PRIM_TYPE_SPHERE = 3; |
708 | public const int PRIM_TYPE_TORUS = 4; | 708 | public const int PRIM_TYPE_TORUS = 4; |
709 | public const int PRIM_TYPE_TUBE = 5; | 709 | public const int PRIM_TYPE_TUBE = 5; |
710 | public const int PRIM_TYPE_RING = 6; | 710 | public const int PRIM_TYPE_RING = 6; |
711 | public const int PRIM_HOLE_DEFAULT = 0; | 711 | public const int PRIM_HOLE_DEFAULT = 0; |
712 | public const int PRIM_HOLE_CIRCLE = 16; | 712 | public const int PRIM_HOLE_CIRCLE = 16; |
713 | public const int PRIM_HOLE_SQUARE = 32; | 713 | public const int PRIM_HOLE_SQUARE = 32; |
714 | public const int PRIM_HOLE_TRIANGLE = 48; | 714 | public const int PRIM_HOLE_TRIANGLE = 48; |
715 | public const int PRIM_MATERIAL_STONE = 0; | 715 | public const int PRIM_MATERIAL_STONE = 0; |
716 | public const int PRIM_MATERIAL_METAL = 1; | 716 | public const int PRIM_MATERIAL_METAL = 1; |
717 | public const int PRIM_MATERIAL_GLASS = 2; | 717 | public const int PRIM_MATERIAL_GLASS = 2; |
718 | public const int PRIM_MATERIAL_WOOD = 3; | 718 | public const int PRIM_MATERIAL_WOOD = 3; |
719 | public const int PRIM_MATERIAL_FLESH = 4; | 719 | public const int PRIM_MATERIAL_FLESH = 4; |
720 | public const int PRIM_MATERIAL_PLASTIC = 5; | 720 | public const int PRIM_MATERIAL_PLASTIC = 5; |
721 | public const int PRIM_MATERIAL_RUBBER = 6; | 721 | public const int PRIM_MATERIAL_RUBBER = 6; |
722 | public const int PRIM_MATERIAL_LIGHT = 7; | 722 | public const int PRIM_MATERIAL_LIGHT = 7; |
723 | public const int PRIM_SHINY_NONE = 0; | 723 | public const int PRIM_SHINY_NONE = 0; |
724 | public const int PRIM_SHINY_LOW = 1; | 724 | public const int PRIM_SHINY_LOW = 1; |
725 | public const int PRIM_SHINY_MEDIUM = 2; | 725 | public const int PRIM_SHINY_MEDIUM = 2; |
726 | public const int PRIM_SHINY_HIGH = 3; | 726 | public const int PRIM_SHINY_HIGH = 3; |
727 | public const int PRIM_BUMP_NONE = 0; | 727 | public const int PRIM_BUMP_NONE = 0; |
728 | public const int PRIM_BUMP_BRIGHT = 1; | 728 | public const int PRIM_BUMP_BRIGHT = 1; |
729 | public const int PRIM_BUMP_DARK = 2; | 729 | public const int PRIM_BUMP_DARK = 2; |
730 | public const int PRIM_BUMP_WOOD = 3; | 730 | public const int PRIM_BUMP_WOOD = 3; |
731 | public const int PRIM_BUMP_BARK = 4; | 731 | public const int PRIM_BUMP_BARK = 4; |
732 | public const int PRIM_BUMP_BRICKS = 5; | 732 | public const int PRIM_BUMP_BRICKS = 5; |
733 | public const int PRIM_BUMP_CHECKER = 6; | 733 | public const int PRIM_BUMP_CHECKER = 6; |
734 | public const int PRIM_BUMP_CONCRETE = 7; | 734 | public const int PRIM_BUMP_CONCRETE = 7; |
735 | public const int PRIM_BUMP_TILE = 8; | 735 | public const int PRIM_BUMP_TILE = 8; |
736 | public const int PRIM_BUMP_STONE = 9; | 736 | public const int PRIM_BUMP_STONE = 9; |
737 | public const int PRIM_BUMP_DISKS = 10; | 737 | public const int PRIM_BUMP_DISKS = 10; |
738 | public const int PRIM_BUMP_GRAVEL = 11; | 738 | public const int PRIM_BUMP_GRAVEL = 11; |
739 | public const int PRIM_BUMP_BLOBS = 12; | 739 | public const int PRIM_BUMP_BLOBS = 12; |
740 | public const int PRIM_BUMP_SIDING = 13; | 740 | public const int PRIM_BUMP_SIDING = 13; |
741 | public const int PRIM_BUMP_LARGETILE = 14; | 741 | public const int PRIM_BUMP_LARGETILE = 14; |
742 | public const int PRIM_BUMP_STUCCO = 15; | 742 | public const int PRIM_BUMP_STUCCO = 15; |
743 | public const int PRIM_BUMP_SUCTION = 16; | 743 | public const int PRIM_BUMP_SUCTION = 16; |
744 | public const int PRIM_BUMP_WEAVE = 17; | 744 | public const int PRIM_BUMP_WEAVE = 17; |
745 | public const int MASK_BASE = 0; | 745 | public const int MASK_BASE = 0; |
746 | public const int MASK_OWNER = 1; | 746 | public const int MASK_OWNER = 1; |
747 | public const int MASK_GROUP = 2; | 747 | public const int MASK_GROUP = 2; |
748 | public const int MASK_EVERYONE = 3; | 748 | public const int MASK_EVERYONE = 3; |
749 | public const int MASK_NEXT = 4; | 749 | public const int MASK_NEXT = 4; |
750 | public const int PERM_TRANSFER = 8192; | 750 | public const int PERM_TRANSFER = 8192; |
751 | public const int PERM_MODIFY = 16384; | 751 | public const int PERM_MODIFY = 16384; |
752 | public const int PERM_COPY = 32768; | 752 | public const int PERM_COPY = 32768; |
753 | public const int PERM_MOVE = 524288; | 753 | public const int PERM_MOVE = 524288; |
754 | public const int PERM_ALL = 2147483647; | 754 | public const int PERM_ALL = 2147483647; |
755 | public const int PARCEL_MEDIA_COMMAND_STOP = 0; | 755 | public const int PARCEL_MEDIA_COMMAND_STOP = 0; |
756 | public const int PARCEL_MEDIA_COMMAND_PAUSE = 1; | 756 | public const int PARCEL_MEDIA_COMMAND_PAUSE = 1; |
757 | public const int PARCEL_MEDIA_COMMAND_PLAY = 2; | 757 | public const int PARCEL_MEDIA_COMMAND_PLAY = 2; |
758 | public const int PARCEL_MEDIA_COMMAND_LOOP = 3; | 758 | public const int PARCEL_MEDIA_COMMAND_LOOP = 3; |
759 | public const int PARCEL_MEDIA_COMMAND_TEXTURE = 4; | 759 | public const int PARCEL_MEDIA_COMMAND_TEXTURE = 4; |
760 | public const int PARCEL_MEDIA_COMMAND_URL = 5; | 760 | public const int PARCEL_MEDIA_COMMAND_URL = 5; |
761 | public const int PARCEL_MEDIA_COMMAND_TIME = 6; | 761 | public const int PARCEL_MEDIA_COMMAND_TIME = 6; |
762 | public const int PARCEL_MEDIA_COMMAND_AGENT = 7; | 762 | public const int PARCEL_MEDIA_COMMAND_AGENT = 7; |
763 | public const int PARCEL_MEDIA_COMMAND_UNLOAD = 8; | 763 | public const int PARCEL_MEDIA_COMMAND_UNLOAD = 8; |
764 | public const int PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9; | 764 | public const int PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9; |
765 | public const int PAY_HIDE = -1; | 765 | public const int PAY_HIDE = -1; |
766 | public const int PAY_DEFAULT = -2; | 766 | public const int PAY_DEFAULT = -2; |
767 | public const string NULL_KEY = "00000000-0000-0000-0000-000000000000"; | 767 | public const string NULL_KEY = "00000000-0000-0000-0000-000000000000"; |
768 | public const string EOF = "\n\n\n"; | 768 | public const string EOF = "\n\n\n"; |
769 | public const double PI = 3.14159274f; | 769 | public const double PI = 3.14159274f; |
770 | public const double TWO_PI = 6.28318548f; | 770 | public const double TWO_PI = 6.28318548f; |
771 | public const double PI_BY_TWO = 1.57079637f; | 771 | public const double PI_BY_TWO = 1.57079637f; |
772 | public const double DEG_TO_RAD = 0.01745329238f; | 772 | public const double DEG_TO_RAD = 0.01745329238f; |
773 | public const double RAD_TO_DEG = 57.29578f; | 773 | public const double RAD_TO_DEG = 57.29578f; |
774 | public const double SQRT2 = 1.414213538f; | 774 | public const double SQRT2 = 1.414213538f; |
775 | 775 | ||
776 | // Can not be public const? | 776 | // Can not be public const? |
777 | public LSL_Types.Vector3 ZERO_VECTOR = new LSL_Types.Vector3(0, 0, 0); | 777 | public LSL_Types.Vector3 ZERO_VECTOR = new LSL_Types.Vector3(0, 0, 0); |
778 | public LSL_Types.Quaternion ZERO_ROTATION = new LSL_Types.Quaternion(0, 0, 0, 0); | 778 | public LSL_Types.Quaternion ZERO_ROTATION = new LSL_Types.Quaternion(0, 0, 0, 0); |
779 | 779 | ||
780 | 780 | ||
781 | 781 | ||
782 | } | 782 | } |
783 | } | 783 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs index a6cf03e..00eb899 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Common.cs | |||
@@ -1,84 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
34 | { | 34 | { |
35 | public static class Common | 35 | public static class Common |
36 | { | 36 | { |
37 | static public bool Debug = true; | 37 | static public bool Debug = true; |
38 | static public bool IL_UseTryCatch = true; | 38 | static public bool IL_UseTryCatch = true; |
39 | static public bool IL_CreateConstructor = true; | 39 | static public bool IL_CreateConstructor = true; |
40 | static public bool IL_CreateFunctionList = true; | 40 | static public bool IL_CreateFunctionList = true; |
41 | static public bool IL_ProcessCodeChunks = true; | 41 | static public bool IL_ProcessCodeChunks = true; |
42 | 42 | ||
43 | public delegate void SendToDebugEventDelegate(string Message); | 43 | public delegate void SendToDebugEventDelegate(string Message); |
44 | public delegate void SendToLogEventDelegate(string Message); | 44 | public delegate void SendToLogEventDelegate(string Message); |
45 | static public event SendToDebugEventDelegate SendToDebugEvent; | 45 | static public event SendToDebugEventDelegate SendToDebugEvent; |
46 | static public event SendToLogEventDelegate SendToLogEvent; | 46 | static public event SendToLogEventDelegate SendToLogEvent; |
47 | 47 | ||
48 | static public void SendToDebug(string Message) | 48 | static public void SendToDebug(string Message) |
49 | { | 49 | { |
50 | //if (Debug == true) | 50 | //if (Debug == true) |
51 | Console.WriteLine("COMPILER:Debug: " + Message); | 51 | Console.WriteLine("COMPILER:Debug: " + Message); |
52 | SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | 52 | SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); |
53 | } | 53 | } |
54 | static public void SendToLog(string Message) | 54 | static public void SendToLog(string Message) |
55 | { | 55 | { |
56 | //if (Debug == true) | 56 | //if (Debug == true) |
57 | Console.WriteLine("COMPILER:LOG: " + Message); | 57 | Console.WriteLine("COMPILER:LOG: " + Message); |
58 | SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | 58 | SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | // TEMPORARY TEST THINGIES | 62 | // TEMPORARY TEST THINGIES |
63 | public static class IL_Helper | 63 | public static class IL_Helper |
64 | { | 64 | { |
65 | public static string ReverseFormatString(string text1, string format) | 65 | public static string ReverseFormatString(string text1, string format) |
66 | { | 66 | { |
67 | Common.SendToDebug("ReverseFormatString text1: " + text1); | 67 | Common.SendToDebug("ReverseFormatString text1: " + text1); |
68 | Common.SendToDebug("ReverseFormatString format: " + format); | 68 | Common.SendToDebug("ReverseFormatString format: " + format); |
69 | return string.Format(format, text1); | 69 | return string.Format(format, text1); |
70 | } | 70 | } |
71 | public static string ReverseFormatString(string text1, UInt32 text2, string format) | 71 | public static string ReverseFormatString(string text1, UInt32 text2, string format) |
72 | { | 72 | { |
73 | Common.SendToDebug("ReverseFormatString text1: " + text1); | 73 | Common.SendToDebug("ReverseFormatString text1: " + text1); |
74 | Common.SendToDebug("ReverseFormatString text2: " + text2.ToString()); | 74 | Common.SendToDebug("ReverseFormatString text2: " + text2.ToString()); |
75 | Common.SendToDebug("ReverseFormatString format: " + format); | 75 | Common.SendToDebug("ReverseFormatString format: " + format); |
76 | return string.Format(format, text1, text2.ToString()); | 76 | return string.Format(format, text1, text2.ToString()); |
77 | } | 77 | } |
78 | public static string Cast_ToString(object obj) | 78 | public static string Cast_ToString(object obj) |
79 | { | 79 | { |
80 | Common.SendToDebug("OBJECT TO BE CASTED: " + obj.GetType().ToString()); | 80 | Common.SendToDebug("OBJECT TO BE CASTED: " + obj.GetType().ToString()); |
81 | return "ABCDEFGIHJKLMNOPQ123"; | 81 | return "ABCDEFGIHJKLMNOPQ123"; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | } | 84 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs index a0c900f..f060f06 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/Engine.cs | |||
@@ -1,300 +1,300 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Reflection.Emit; | 31 | using System.Reflection.Emit; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | 33 | ||
34 | 34 | ||
35 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 35 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
36 | { | 36 | { |
37 | 37 | ||
38 | 38 | ||
39 | public class Engine | 39 | public class Engine |
40 | { | 40 | { |
41 | //private string LSO_FileName = @"LSO\AdditionTest.lso"; | 41 | //private string LSO_FileName = @"LSO\AdditionTest.lso"; |
42 | private string LSO_FileName;// = @"LSO\CloseToDefault.lso"; | 42 | private string LSO_FileName;// = @"LSO\CloseToDefault.lso"; |
43 | AppDomain appDomain; | 43 | AppDomain appDomain; |
44 | 44 | ||
45 | public string Compile(string LSOFileName) | 45 | public string Compile(string LSOFileName) |
46 | { | 46 | { |
47 | LSO_FileName = LSOFileName; | 47 | LSO_FileName = LSOFileName; |
48 | 48 | ||
49 | 49 | ||
50 | //appDomain = AppDomain.CreateDomain("AlternateAppDomain"); | 50 | //appDomain = AppDomain.CreateDomain("AlternateAppDomain"); |
51 | appDomain = Thread.GetDomain(); | 51 | appDomain = Thread.GetDomain(); |
52 | 52 | ||
53 | // Create Assembly Name | 53 | // Create Assembly Name |
54 | AssemblyName asmName = new AssemblyName(); | 54 | AssemblyName asmName = new AssemblyName(); |
55 | asmName.Name = System.IO.Path.GetFileNameWithoutExtension(LSO_FileName); | 55 | asmName.Name = System.IO.Path.GetFileNameWithoutExtension(LSO_FileName); |
56 | //asmName.Name = "TestAssembly"; | 56 | //asmName.Name = "TestAssembly"; |
57 | 57 | ||
58 | string DLL_FileName = asmName.Name + ".dll"; | 58 | string DLL_FileName = asmName.Name + ".dll"; |
59 | string DLL_FileName_WithPath = System.IO.Path.GetDirectoryName(LSO_FileName) + @"\" + DLL_FileName; | 59 | string DLL_FileName_WithPath = System.IO.Path.GetDirectoryName(LSO_FileName) + @"\" + DLL_FileName; |
60 | 60 | ||
61 | Common.SendToLog("LSO File Name: " + System.IO.Path.GetFileName(LSO_FileName)); | 61 | Common.SendToLog("LSO File Name: " + System.IO.Path.GetFileName(LSO_FileName)); |
62 | Common.SendToLog("Assembly name: " + asmName.Name); | 62 | Common.SendToLog("Assembly name: " + asmName.Name); |
63 | Common.SendToLog("Assembly File Name: " + asmName.Name + ".dll"); | 63 | Common.SendToLog("Assembly File Name: " + asmName.Name + ".dll"); |
64 | Common.SendToLog("Starting processing of LSL ByteCode..."); | 64 | Common.SendToLog("Starting processing of LSL ByteCode..."); |
65 | Common.SendToLog(""); | 65 | Common.SendToLog(""); |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | // Create Assembly | 69 | // Create Assembly |
70 | AssemblyBuilder asmBuilder = appDomain.DefineDynamicAssembly( | 70 | AssemblyBuilder asmBuilder = appDomain.DefineDynamicAssembly( |
71 | asmName, | 71 | asmName, |
72 | AssemblyBuilderAccess.RunAndSave | 72 | AssemblyBuilderAccess.RunAndSave |
73 | ); | 73 | ); |
74 | //// Create Assembly | 74 | //// Create Assembly |
75 | //AssemblyBuilder asmBuilder = | 75 | //AssemblyBuilder asmBuilder = |
76 | // Thread.GetDomain().DefineDynamicAssembly | 76 | // Thread.GetDomain().DefineDynamicAssembly |
77 | //(asmName, AssemblyBuilderAccess.RunAndSave); | 77 | //(asmName, AssemblyBuilderAccess.RunAndSave); |
78 | 78 | ||
79 | // Create a module (and save to disk) | 79 | // Create a module (and save to disk) |
80 | ModuleBuilder modBuilder = asmBuilder.DefineDynamicModule | 80 | ModuleBuilder modBuilder = asmBuilder.DefineDynamicModule |
81 | (asmName.Name, | 81 | (asmName.Name, |
82 | DLL_FileName); | 82 | DLL_FileName); |
83 | 83 | ||
84 | //Common.SendToDebug("asmName.Name is still \"" + asmName.Name + "\""); | 84 | //Common.SendToDebug("asmName.Name is still \"" + asmName.Name + "\""); |
85 | // Create a Class (/Type) | 85 | // Create a Class (/Type) |
86 | TypeBuilder typeBuilder = modBuilder.DefineType( | 86 | TypeBuilder typeBuilder = modBuilder.DefineType( |
87 | "LSL_ScriptObject", | 87 | "LSL_ScriptObject", |
88 | TypeAttributes.Public | TypeAttributes.BeforeFieldInit, | 88 | TypeAttributes.Public | TypeAttributes.BeforeFieldInit, |
89 | typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass)); | 89 | typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass)); |
90 | //, | 90 | //, |
91 | // typeof()); | 91 | // typeof()); |
92 | //, typeof(LSL_BuiltIn_Commands_Interface)); | 92 | //, typeof(LSL_BuiltIn_Commands_Interface)); |
93 | //, | 93 | //, |
94 | // typeof(object), | 94 | // typeof(object), |
95 | // new Type[] { typeof(LSL_CLRInterface.LSLScript) }); | 95 | // new Type[] { typeof(LSL_CLRInterface.LSLScript) }); |
96 | 96 | ||
97 | 97 | ||
98 | 98 | ||
99 | /* | 99 | /* |
100 | * Generate the IL itself | 100 | * Generate the IL itself |
101 | */ | 101 | */ |
102 | 102 | ||
103 | LSO_Parser LSOP = new LSO_Parser(LSO_FileName, typeBuilder); | 103 | LSO_Parser LSOP = new LSO_Parser(LSO_FileName, typeBuilder); |
104 | LSOP.OpenFile(); | 104 | LSOP.OpenFile(); |
105 | LSOP.Parse(); | 105 | LSOP.Parse(); |
106 | 106 | ||
107 | // Constructor has to be created AFTER LSO_Parser because of accumulated variables | 107 | // Constructor has to be created AFTER LSO_Parser because of accumulated variables |
108 | if (Common.IL_CreateConstructor) | 108 | if (Common.IL_CreateConstructor) |
109 | IL_CREATE_CONSTRUCTOR(typeBuilder, LSOP); | 109 | IL_CREATE_CONSTRUCTOR(typeBuilder, LSOP); |
110 | 110 | ||
111 | LSOP.CloseFile(); | 111 | LSOP.CloseFile(); |
112 | /* | 112 | /* |
113 | * Done generating. Create a type and run it. | 113 | * Done generating. Create a type and run it. |
114 | */ | 114 | */ |
115 | 115 | ||
116 | 116 | ||
117 | Common.SendToLog("Attempting to compile assembly..."); | 117 | Common.SendToLog("Attempting to compile assembly..."); |
118 | // Compile it | 118 | // Compile it |
119 | Type type = typeBuilder.CreateType(); | 119 | Type type = typeBuilder.CreateType(); |
120 | Common.SendToLog("Compilation successful!"); | 120 | Common.SendToLog("Compilation successful!"); |
121 | 121 | ||
122 | Common.SendToLog("Saving assembly: " + DLL_FileName); | 122 | Common.SendToLog("Saving assembly: " + DLL_FileName); |
123 | asmBuilder.Save(DLL_FileName); | 123 | asmBuilder.Save(DLL_FileName); |
124 | 124 | ||
125 | Common.SendToLog("Returning assembly filename: " + DLL_FileName); | 125 | Common.SendToLog("Returning assembly filename: " + DLL_FileName); |
126 | 126 | ||
127 | 127 | ||
128 | return DLL_FileName; | 128 | return DLL_FileName; |
129 | 129 | ||
130 | 130 | ||
131 | //Common.SendToLog("Creating an instance of new assembly..."); | 131 | //Common.SendToLog("Creating an instance of new assembly..."); |
132 | //// Create an instance we can play with | 132 | //// Create an instance we can play with |
133 | ////LSLScript hello = (LSLScript)Activator.CreateInstance(type); | 133 | ////LSLScript hello = (LSLScript)Activator.CreateInstance(type); |
134 | ////LSL_CLRInterface.LSLScript MyScript = (LSL_CLRInterface.LSLScript)Activator.CreateInstance(type); | 134 | ////LSL_CLRInterface.LSLScript MyScript = (LSL_CLRInterface.LSLScript)Activator.CreateInstance(type); |
135 | //object MyScript = (object)Activator.CreateInstance(type); | 135 | //object MyScript = (object)Activator.CreateInstance(type); |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | //System.Reflection.MemberInfo[] Members = type.GetMembers(); | 141 | //System.Reflection.MemberInfo[] Members = type.GetMembers(); |
142 | 142 | ||
143 | //Common.SendToLog("Members of assembly " + type.ToString() + ":"); | 143 | //Common.SendToLog("Members of assembly " + type.ToString() + ":"); |
144 | //foreach (MemberInfo member in Members) | 144 | //foreach (MemberInfo member in Members) |
145 | // Common.SendToLog(member.ToString()); | 145 | // Common.SendToLog(member.ToString()); |
146 | 146 | ||
147 | 147 | ||
148 | //// Play with it | 148 | //// Play with it |
149 | ////MyScript.event_state_entry("Test"); | 149 | ////MyScript.event_state_entry("Test"); |
150 | //object[] args = { null }; | 150 | //object[] args = { null }; |
151 | ////System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, MyScript, null); | 151 | ////System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, MyScript, null); |
152 | 152 | ||
153 | //string[] ret = { }; | 153 | //string[] ret = { }; |
154 | //if (Common.IL_CreateFunctionList) | 154 | //if (Common.IL_CreateFunctionList) |
155 | // ret = (string[])type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, MyScript, null); | 155 | // ret = (string[])type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, MyScript, null); |
156 | 156 | ||
157 | //foreach (string s in ret) | 157 | //foreach (string s in ret) |
158 | //{ | 158 | //{ |
159 | // Common.SendToLog(""); | 159 | // Common.SendToLog(""); |
160 | // Common.SendToLog("*** Executing LSL Server Event: " + s); | 160 | // Common.SendToLog("*** Executing LSL Server Event: " + s); |
161 | // //object test = type.GetMember(s); | 161 | // //object test = type.GetMember(s); |
162 | // //object runner = type.InvokeMember(s, BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Instance, null, MyScript, args); | 162 | // //object runner = type.InvokeMember(s, BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Instance, null, MyScript, args); |
163 | // //runner(); | 163 | // //runner(); |
164 | // //objBooks_Late = type.InvokeMember(s, BindingFlags.CreateInstance, null, objApp_Late, null); | 164 | // //objBooks_Late = type.InvokeMember(s, BindingFlags.CreateInstance, null, objApp_Late, null); |
165 | // type.InvokeMember(s, BindingFlags.InvokeMethod, null, MyScript, new object[] { "Test" }); | 165 | // type.InvokeMember(s, BindingFlags.InvokeMethod, null, MyScript, new object[] { "Test" }); |
166 | 166 | ||
167 | //} | 167 | //} |
168 | 168 | ||
169 | 169 | ||
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | private static void IL_CREATE_CONSTRUCTOR(TypeBuilder typeBuilder, LSO_Parser LSOP) | 173 | private static void IL_CREATE_CONSTRUCTOR(TypeBuilder typeBuilder, LSO_Parser LSOP) |
174 | { | 174 | { |
175 | 175 | ||
176 | 176 | ||
177 | Common.SendToDebug("IL_CREATE_CONSTRUCTOR()"); | 177 | Common.SendToDebug("IL_CREATE_CONSTRUCTOR()"); |
178 | //ConstructorBuilder constructor = typeBuilder.DefineConstructor( | 178 | //ConstructorBuilder constructor = typeBuilder.DefineConstructor( |
179 | // MethodAttributes.Public, | 179 | // MethodAttributes.Public, |
180 | // CallingConventions.Standard, | 180 | // CallingConventions.Standard, |
181 | // new Type[0]); | 181 | // new Type[0]); |
182 | ConstructorBuilder constructor = typeBuilder.DefineConstructor( | 182 | ConstructorBuilder constructor = typeBuilder.DefineConstructor( |
183 | MethodAttributes.Public | | 183 | MethodAttributes.Public | |
184 | MethodAttributes.SpecialName | | 184 | MethodAttributes.SpecialName | |
185 | MethodAttributes.RTSpecialName, | 185 | MethodAttributes.RTSpecialName, |
186 | CallingConventions.Standard, | 186 | CallingConventions.Standard, |
187 | new Type[0]); | 187 | new Type[0]); |
188 | 188 | ||
189 | //Define the reflection ConstructorInfor for System.Object | 189 | //Define the reflection ConstructorInfor for System.Object |
190 | ConstructorInfo conObj = typeof(LSL_BaseClass).GetConstructor(new Type[0]); | 190 | ConstructorInfo conObj = typeof(LSL_BaseClass).GetConstructor(new Type[0]); |
191 | 191 | ||
192 | //call constructor of base object | 192 | //call constructor of base object |
193 | ILGenerator il = constructor.GetILGenerator(); | 193 | ILGenerator il = constructor.GetILGenerator(); |
194 | 194 | ||
195 | il.Emit(OpCodes.Ldarg_0); | 195 | il.Emit(OpCodes.Ldarg_0); |
196 | il.Emit(OpCodes.Call, conObj); | 196 | il.Emit(OpCodes.Call, conObj); |
197 | 197 | ||
198 | 198 | ||
199 | //Common.SendToDebug("IL_CREATE_CONSTRUCTOR: Creating global: UInt32 State = 0;"); | 199 | //Common.SendToDebug("IL_CREATE_CONSTRUCTOR: Creating global: UInt32 State = 0;"); |
200 | //string FieldName; | 200 | //string FieldName; |
201 | //// Create state object | 201 | //// Create state object |
202 | //FieldName = "State"; | 202 | //FieldName = "State"; |
203 | //FieldBuilder State_fb = typeBuilder.DefineField( | 203 | //FieldBuilder State_fb = typeBuilder.DefineField( |
204 | // FieldName, | 204 | // FieldName, |
205 | // typeof(UInt32), | 205 | // typeof(UInt32), |
206 | // FieldAttributes.Public); | 206 | // FieldAttributes.Public); |
207 | //il.Emit(OpCodes.Ldarg_0); | 207 | //il.Emit(OpCodes.Ldarg_0); |
208 | //il.Emit(OpCodes.Ldc_I4, 0); | 208 | //il.Emit(OpCodes.Ldc_I4, 0); |
209 | //il.Emit(OpCodes.Stfld, State_fb); | 209 | //il.Emit(OpCodes.Stfld, State_fb); |
210 | 210 | ||
211 | 211 | ||
212 | //Common.SendToDebug("IL_CREATE_CONSTRUCTOR: Creating global: LSL_BuiltIn_Commands_TestImplementation LSL_BuiltIns = New LSL_BuiltIn_Commands_TestImplementation();"); | 212 | //Common.SendToDebug("IL_CREATE_CONSTRUCTOR: Creating global: LSL_BuiltIn_Commands_TestImplementation LSL_BuiltIns = New LSL_BuiltIn_Commands_TestImplementation();"); |
213 | ////Type objType1 = typeof(object); | 213 | ////Type objType1 = typeof(object); |
214 | //Type objType1 = typeof(LSL_BuiltIn_Commands_TestImplementation); | 214 | //Type objType1 = typeof(LSL_BuiltIn_Commands_TestImplementation); |
215 | 215 | ||
216 | //FieldName = "LSL_BuiltIns"; | 216 | //FieldName = "LSL_BuiltIns"; |
217 | //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField( | 217 | //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField( |
218 | // FieldName, | 218 | // FieldName, |
219 | // objType1, | 219 | // objType1, |
220 | // FieldAttributes.Public); | 220 | // FieldAttributes.Public); |
221 | 221 | ||
222 | ////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation(); | 222 | ////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation(); |
223 | //il.Emit(OpCodes.Ldarg_0); | 223 | //il.Emit(OpCodes.Ldarg_0); |
224 | ////il.Emit(OpCodes.Ldstr, "Test 123"); | 224 | ////il.Emit(OpCodes.Ldstr, "Test 123"); |
225 | //il.Emit(OpCodes.Newobj, objType1.GetConstructor(new Type[] { })); | 225 | //il.Emit(OpCodes.Newobj, objType1.GetConstructor(new Type[] { })); |
226 | //il.Emit(OpCodes.Stfld, LSL_BuiltIns_fb); | 226 | //il.Emit(OpCodes.Stfld, LSL_BuiltIns_fb); |
227 | 227 | ||
228 | foreach (UInt32 pos in LSOP.StaticBlocks.Keys) | 228 | foreach (UInt32 pos in LSOP.StaticBlocks.Keys) |
229 | { | 229 | { |
230 | LSO_Struct.StaticBlock sb; | 230 | LSO_Struct.StaticBlock sb; |
231 | LSOP.StaticBlocks.TryGetValue(pos, out sb); | 231 | LSOP.StaticBlocks.TryGetValue(pos, out sb); |
232 | 232 | ||
233 | if (sb.ObjectType > 0 && sb.ObjectType < 8) { // We don't want void or null's | 233 | if (sb.ObjectType > 0 && sb.ObjectType < 8) { // We don't want void or null's |
234 | 234 | ||
235 | il.Emit(OpCodes.Ldarg_0); | 235 | il.Emit(OpCodes.Ldarg_0); |
236 | // Push position to stack | 236 | // Push position to stack |
237 | il.Emit(OpCodes.Ldc_I4, pos); | 237 | il.Emit(OpCodes.Ldc_I4, pos); |
238 | //il.Emit(OpCodes.Box, typeof(UInt32)); | 238 | //il.Emit(OpCodes.Box, typeof(UInt32)); |
239 | 239 | ||
240 | 240 | ||
241 | Type datatype = null; | 241 | Type datatype = null; |
242 | 242 | ||
243 | // Push data to stack | 243 | // Push data to stack |
244 | Common.SendToDebug("Adding to static (" + pos + ") type: " + ((LSO_Enums.Variable_Type_Codes)sb.ObjectType).ToString() + " (" + sb.ObjectType + ")"); | 244 | Common.SendToDebug("Adding to static (" + pos + ") type: " + ((LSO_Enums.Variable_Type_Codes)sb.ObjectType).ToString() + " (" + sb.ObjectType + ")"); |
245 | switch ((LSO_Enums.Variable_Type_Codes)sb.ObjectType) | 245 | switch ((LSO_Enums.Variable_Type_Codes)sb.ObjectType) |
246 | { | 246 | { |
247 | case LSO_Enums.Variable_Type_Codes.Float: | 247 | case LSO_Enums.Variable_Type_Codes.Float: |
248 | case LSO_Enums.Variable_Type_Codes.Integer: | 248 | case LSO_Enums.Variable_Type_Codes.Integer: |
249 | //UInt32 | 249 | //UInt32 |
250 | il.Emit(OpCodes.Ldc_I4, BitConverter.ToUInt32(sb.BlockVariable, 0)); | 250 | il.Emit(OpCodes.Ldc_I4, BitConverter.ToUInt32(sb.BlockVariable, 0)); |
251 | datatype = typeof(UInt32); | 251 | datatype = typeof(UInt32); |
252 | il.Emit(OpCodes.Box, datatype); | 252 | il.Emit(OpCodes.Box, datatype); |
253 | break; | 253 | break; |
254 | case LSO_Enums.Variable_Type_Codes.String: | 254 | case LSO_Enums.Variable_Type_Codes.String: |
255 | case LSO_Enums.Variable_Type_Codes.Key: | 255 | case LSO_Enums.Variable_Type_Codes.Key: |
256 | //String | 256 | //String |
257 | LSO_Struct.HeapBlock hb = LSOP.GetHeap(LSOP.myHeader.HR + BitConverter.ToUInt32(sb.BlockVariable, 0) - 1); | 257 | LSO_Struct.HeapBlock hb = LSOP.GetHeap(LSOP.myHeader.HR + BitConverter.ToUInt32(sb.BlockVariable, 0) - 1); |
258 | il.Emit(OpCodes.Ldstr, System.Text.Encoding.UTF8.GetString(hb.Data)); | 258 | il.Emit(OpCodes.Ldstr, System.Text.Encoding.UTF8.GetString(hb.Data)); |
259 | datatype = typeof(string); | 259 | datatype = typeof(string); |
260 | break; | 260 | break; |
261 | case LSO_Enums.Variable_Type_Codes.Vector: | 261 | case LSO_Enums.Variable_Type_Codes.Vector: |
262 | datatype = typeof(LSO_Enums.Vector); | 262 | datatype = typeof(LSO_Enums.Vector); |
263 | //TODO: Not implemented | 263 | //TODO: Not implemented |
264 | break; | 264 | break; |
265 | case LSO_Enums.Variable_Type_Codes.Rotation: | 265 | case LSO_Enums.Variable_Type_Codes.Rotation: |
266 | //Object | 266 | //Object |
267 | //TODO: Not implemented | 267 | //TODO: Not implemented |
268 | datatype = typeof(LSO_Enums.Rotation); | 268 | datatype = typeof(LSO_Enums.Rotation); |
269 | break; | 269 | break; |
270 | default: | 270 | default: |
271 | datatype = typeof(object); | 271 | datatype = typeof(object); |
272 | break; | 272 | break; |
273 | } | 273 | } |
274 | 274 | ||
275 | 275 | ||
276 | // Make call | 276 | // Make call |
277 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddToStatic", new Type[] { typeof(UInt32), datatype })); | 277 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddToStatic", new Type[] { typeof(UInt32), datatype })); |
278 | } | 278 | } |
279 | 279 | ||
280 | } | 280 | } |
281 | 281 | ||
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | ////il.Emit(OpCodes.Newobj, typeof(UInt32)); | 285 | ////il.Emit(OpCodes.Newobj, typeof(UInt32)); |
286 | //il.Emit(OpCodes.Starg_0); | 286 | //il.Emit(OpCodes.Starg_0); |
287 | //// Create LSL function library | 287 | //// Create LSL function library |
288 | //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField("LSL_BuiltIns", typeof(LSL_BuiltIn_Commands_Interface), FieldAttributes.Public); | 288 | //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField("LSL_BuiltIns", typeof(LSL_BuiltIn_Commands_Interface), FieldAttributes.Public); |
289 | //il.Emit(OpCodes.Newobj, typeof(LSL_BuiltIn_Commands_Interface)); | 289 | //il.Emit(OpCodes.Newobj, typeof(LSL_BuiltIn_Commands_Interface)); |
290 | //il.Emit(OpCodes.Stloc_1); | 290 | //il.Emit(OpCodes.Stloc_1); |
291 | 291 | ||
292 | il.Emit(OpCodes.Ret); | 292 | il.Emit(OpCodes.Ret); |
293 | } | 293 | } |
294 | 294 | ||
295 | 295 | ||
296 | 296 | ||
297 | 297 | ||
298 | // End of class | 298 | // End of class |
299 | } | 299 | } |
300 | } | 300 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs index f6444be..65be5e3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/IL_common_functions.cs | |||
@@ -1,56 +1,56 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Reflection.Emit; | 33 | using System.Reflection.Emit; |
34 | 34 | ||
35 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 35 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
36 | { | 36 | { |
37 | partial class LSO_Parser | 37 | partial class LSO_Parser |
38 | { | 38 | { |
39 | private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName) | 39 | private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName) |
40 | { | 40 | { |
41 | TypeBuilder typeBuilder = modBuilder.DefineType(typeName, | 41 | TypeBuilder typeBuilder = modBuilder.DefineType(typeName, |
42 | TypeAttributes.Public | | 42 | TypeAttributes.Public | |
43 | TypeAttributes.Class | | 43 | TypeAttributes.Class | |
44 | TypeAttributes.AutoClass | | 44 | TypeAttributes.AutoClass | |
45 | TypeAttributes.AnsiClass | | 45 | TypeAttributes.AnsiClass | |
46 | TypeAttributes.BeforeFieldInit | | 46 | TypeAttributes.BeforeFieldInit | |
47 | TypeAttributes.AutoLayout, | 47 | TypeAttributes.AutoLayout, |
48 | typeof(object), | 48 | typeof(object), |
49 | new Type[] { typeof(object) }); | 49 | new Type[] { typeof(object) }); |
50 | return typeBuilder; | 50 | return typeBuilder; |
51 | 51 | ||
52 | } | 52 | } |
53 | 53 | ||
54 | 54 | ||
55 | } | 55 | } |
56 | } | 56 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs index 374d37d..9cbb879 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass.cs | |||
@@ -1,60 +1,60 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.IO; | 4 | using System.IO; |
5 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | 5 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; |
6 | using OpenSim.Region.ScriptEngine.Common; | 6 | using OpenSim.Region.ScriptEngine.Common; |
7 | 7 | ||
8 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 8 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
9 | { | 9 | { |
10 | public partial class LSL_BaseClass | 10 | public partial class LSL_BaseClass |
11 | { | 11 | { |
12 | //public MemoryStream LSLStack = new MemoryStream(); | 12 | //public MemoryStream LSLStack = new MemoryStream(); |
13 | public Stack<object> LSLStack = new Stack<object>(); | 13 | public Stack<object> LSLStack = new Stack<object>(); |
14 | public Dictionary<UInt32, object> StaticVariables = new Dictionary<UInt32, object>(); | 14 | public Dictionary<UInt32, object> StaticVariables = new Dictionary<UInt32, object>(); |
15 | public Dictionary<UInt32, object> GlobalVariables = new Dictionary<UInt32, object>(); | 15 | public Dictionary<UInt32, object> GlobalVariables = new Dictionary<UInt32, object>(); |
16 | public Dictionary<UInt32, object> LocalVariables = new Dictionary<UInt32, object>(); | 16 | public Dictionary<UInt32, object> LocalVariables = new Dictionary<UInt32, object>(); |
17 | //public System.Collections.Generic.List<string> FunctionList = new System.Collections.Generic.List<string>(); | 17 | //public System.Collections.Generic.List<string> FunctionList = new System.Collections.Generic.List<string>(); |
18 | //public void AddFunction(String x) { | 18 | //public void AddFunction(String x) { |
19 | // FunctionList.Add(x); | 19 | // FunctionList.Add(x); |
20 | //} | 20 | //} |
21 | //public Stack<StackItemStruct> LSLStack = new Stack<StackItemStruct>; | 21 | //public Stack<StackItemStruct> LSLStack = new Stack<StackItemStruct>; |
22 | //public struct StackItemStruct | 22 | //public struct StackItemStruct |
23 | //{ | 23 | //{ |
24 | // public LSO_Enums.Variable_Type_Codes ItemType; | 24 | // public LSO_Enums.Variable_Type_Codes ItemType; |
25 | // public object Data; | 25 | // public object Data; |
26 | //} | 26 | //} |
27 | public UInt32 State = 0; | 27 | public UInt32 State = 0; |
28 | public LSL_BuiltIn_Commands_Interface LSL_Builtins; | 28 | public LSL_BuiltIn_Commands_Interface LSL_Builtins; |
29 | public LSL_BuiltIn_Commands_Interface GetLSL_BuiltIn() | 29 | public LSL_BuiltIn_Commands_Interface GetLSL_BuiltIn() |
30 | { | 30 | { |
31 | return LSL_Builtins; | 31 | return LSL_Builtins; |
32 | } | 32 | } |
33 | 33 | ||
34 | 34 | ||
35 | public LSL_BaseClass() { } | 35 | public LSL_BaseClass() { } |
36 | 36 | ||
37 | 37 | ||
38 | public virtual int OverrideMe() | 38 | public virtual int OverrideMe() |
39 | { | 39 | { |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | public void Start(LSL_BuiltIn_Commands_Interface LSLBuiltins) | 42 | public void Start(LSL_BuiltIn_Commands_Interface LSLBuiltins) |
43 | { | 43 | { |
44 | LSL_Builtins = LSLBuiltins; | 44 | LSL_Builtins = LSLBuiltins; |
45 | 45 | ||
46 | Common.SendToLog("OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass.Start() called"); | 46 | Common.SendToLog("OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass.Start() called"); |
47 | //LSL_Builtins.llSay(0, "Test"); | 47 | //LSL_Builtins.llSay(0, "Test"); |
48 | return; | 48 | return; |
49 | } | 49 | } |
50 | 50 | ||
51 | public void AddToStatic(UInt32 index, object obj) | 51 | public void AddToStatic(UInt32 index, object obj) |
52 | { | 52 | { |
53 | Common.SendToDebug("AddToStatic: " + index + " type: " + obj.GetType()); | 53 | Common.SendToDebug("AddToStatic: " + index + " type: " + obj.GetType()); |
54 | StaticVariables.Add(index, obj); | 54 | StaticVariables.Add(index, obj); |
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||
59 | } | 59 | } |
60 | } | 60 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_Builtins.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_Builtins.cs index d3ca625..3b47d08 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_Builtins.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_Builtins.cs | |||
@@ -1,373 +1,373 @@ | |||
1 | //using System; | 1 | //using System; |
2 | //using System.Collections.Generic; | 2 | //using System.Collections.Generic; |
3 | //using System.Text; | 3 | //using System.Text; |
4 | 4 | ||
5 | //namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 5 | //namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
6 | //{ | 6 | //{ |
7 | // public partial class LSL_BaseClass | 7 | // public partial class LSL_BaseClass |
8 | // { | 8 | // { |
9 | 9 | ||
10 | 10 | ||
11 | // public float llSin() { | 11 | // public float llSin() { |
12 | // float f = (float)LSLStack.Pop(); | 12 | // float f = (float)LSLStack.Pop(); |
13 | // return LSL_Builtins.llSin(f); | 13 | // return LSL_Builtins.llSin(f); |
14 | // } | 14 | // } |
15 | // public float llCos() { | 15 | // public float llCos() { |
16 | // float f = (float)LSLStack.Pop(); | 16 | // float f = (float)LSLStack.Pop(); |
17 | // return LSL_Builtins.llCos(f); | 17 | // return LSL_Builtins.llCos(f); |
18 | // } | 18 | // } |
19 | // public float llTan() { | 19 | // public float llTan() { |
20 | // float f = (float)LSLStack.Pop(); | 20 | // float f = (float)LSLStack.Pop(); |
21 | // return LSL_Builtins.llTan(f); | 21 | // return LSL_Builtins.llTan(f); |
22 | // } | 22 | // } |
23 | // public float llAtan2() { | 23 | // public float llAtan2() { |
24 | // float x = (float)LSLStack.Pop(); | 24 | // float x = (float)LSLStack.Pop(); |
25 | // float y = (float)LSLStack.Pop(); | 25 | // float y = (float)LSLStack.Pop(); |
26 | // return LSL_Builtins.llAtan2(x, y); | 26 | // return LSL_Builtins.llAtan2(x, y); |
27 | // } | 27 | // } |
28 | // public float llSqrt() { | 28 | // public float llSqrt() { |
29 | // float f = (float)LSLStack.Pop(); | 29 | // float f = (float)LSLStack.Pop(); |
30 | // return LSL_Builtins.llSqrt(f); | 30 | // return LSL_Builtins.llSqrt(f); |
31 | // } | 31 | // } |
32 | // float llPow() | 32 | // float llPow() |
33 | // { | 33 | // { |
34 | // float fexponent = (float)LSLStack.Pop(); | 34 | // float fexponent = (float)LSLStack.Pop(); |
35 | // float fbase = (float)LSLStack.Pop(); | 35 | // float fbase = (float)LSLStack.Pop(); |
36 | // return LSL_Builtins.llPow(fbase, fexponent); | 36 | // return LSL_Builtins.llPow(fbase, fexponent); |
37 | // } | 37 | // } |
38 | // //UInt32 llAbs(UInt32 i){ return; } | 38 | // //UInt32 llAbs(UInt32 i){ return; } |
39 | // //float llFabs(float f){ return; } | 39 | // //float llFabs(float f){ return; } |
40 | // //float llFrand(float mag){ return; } | 40 | // //float llFrand(float mag){ return; } |
41 | // //UInt32 llFloor(float f){ return; } | 41 | // //UInt32 llFloor(float f){ return; } |
42 | // //UInt32 llCeil(float f){ return; } | 42 | // //UInt32 llCeil(float f){ return; } |
43 | // //UInt32 llRound(float f){ return; } | 43 | // //UInt32 llRound(float f){ return; } |
44 | // //float llVecMag(LSO_Enums.Vector v){ return; } | 44 | // //float llVecMag(LSO_Enums.Vector v){ return; } |
45 | // //LSO_Enums.Vector llVecNorm(LSO_Enums.Vector v){ return; } | 45 | // //LSO_Enums.Vector llVecNorm(LSO_Enums.Vector v){ return; } |
46 | // //float llVecDist(LSO_Enums.Vector a, LSO_Enums.Vector b){ return; } | 46 | // //float llVecDist(LSO_Enums.Vector a, LSO_Enums.Vector b){ return; } |
47 | // //LSO_Enums.Vector llRot2Euler(LSO_Enums.Rotation r){ return; } | 47 | // //LSO_Enums.Vector llRot2Euler(LSO_Enums.Rotation r){ return; } |
48 | // //LSO_Enums.Rotation llEuler2Rot(LSO_Enums.Vector v){ return; } | 48 | // //LSO_Enums.Rotation llEuler2Rot(LSO_Enums.Vector v){ return; } |
49 | // //LSO_Enums.Rotation llAxes2Rot(LSO_Enums.Vector fwd, LSO_Enums.Vector left, LSO_Enums.Vector up){ return; } | 49 | // //LSO_Enums.Rotation llAxes2Rot(LSO_Enums.Vector fwd, LSO_Enums.Vector left, LSO_Enums.Vector up){ return; } |
50 | // //LSO_Enums.Vector llRot2Fwd(LSO_Enums.Rotation r){ return; } | 50 | // //LSO_Enums.Vector llRot2Fwd(LSO_Enums.Rotation r){ return; } |
51 | // //LSO_Enums.Vector llRot2Left(LSO_Enums.Rotation r){ return; } | 51 | // //LSO_Enums.Vector llRot2Left(LSO_Enums.Rotation r){ return; } |
52 | // //LSO_Enums.Vector llRot2Up(LSO_Enums.Rotation r){ return; } | 52 | // //LSO_Enums.Vector llRot2Up(LSO_Enums.Rotation r){ return; } |
53 | // //LSO_Enums.Rotation llRotBetween(LSO_Enums.Vector start, LSO_Enums.Vector end){ return; } | 53 | // //LSO_Enums.Rotation llRotBetween(LSO_Enums.Vector start, LSO_Enums.Vector end){ return; } |
54 | // public void llWhisper() | 54 | // public void llWhisper() |
55 | // { | 55 | // { |
56 | // UInt16 i = (UInt16)LSLStack.Pop(); | 56 | // UInt16 i = (UInt16)LSLStack.Pop(); |
57 | // string s = (string)LSLStack.Pop(); | 57 | // string s = (string)LSLStack.Pop(); |
58 | // LSL_Builtins.llWhisper(i, s); | 58 | // LSL_Builtins.llWhisper(i, s); |
59 | // } | 59 | // } |
60 | // public void llSay() | 60 | // public void llSay() |
61 | // { | 61 | // { |
62 | // UInt16 i = (UInt16)LSLStack.Pop(); | 62 | // UInt16 i = (UInt16)LSLStack.Pop(); |
63 | // string s = (string)LSLStack.Pop(); | 63 | // string s = (string)LSLStack.Pop(); |
64 | // LSL_Builtins.llSay(i, s); | 64 | // LSL_Builtins.llSay(i, s); |
65 | // } | 65 | // } |
66 | // //void llShout(UInt16 channelID, string text); | 66 | // //void llShout(UInt16 channelID, string text); |
67 | // //UInt32 llListen(UInt16 channelID, string name, LSO_Enums.Key ID, string msg); | 67 | // //UInt32 llListen(UInt16 channelID, string name, LSO_Enums.Key ID, string msg); |
68 | // //void llListenControl(UInt32 number, UInt32 active); | 68 | // //void llListenControl(UInt32 number, UInt32 active); |
69 | // //void llListenRemove(UInt32 number); | 69 | // //void llListenRemove(UInt32 number); |
70 | // //void llSensor(string name, LSO_Enums.Key id, UInt32 type, float range, float arc); | 70 | // //void llSensor(string name, LSO_Enums.Key id, UInt32 type, float range, float arc); |
71 | // //void llSensorRepeat(string name, LSO_Enums.Key id, UInt32 type, float range, float arc, float rate); | 71 | // //void llSensorRepeat(string name, LSO_Enums.Key id, UInt32 type, float range, float arc, float rate); |
72 | // //void llSensorRemove(); | 72 | // //void llSensorRemove(); |
73 | // //string llDetectedName(UInt32 number); | 73 | // //string llDetectedName(UInt32 number); |
74 | // //LSO_Enums.Key llDetectedKey(UInt32 number); | 74 | // //LSO_Enums.Key llDetectedKey(UInt32 number); |
75 | // //LSO_Enums.Key llDetectedOwner(UInt32 number); | 75 | // //LSO_Enums.Key llDetectedOwner(UInt32 number); |
76 | // //UInt32 llDetectedType(UInt32 number); | 76 | // //UInt32 llDetectedType(UInt32 number); |
77 | // //LSO_Enums.Vector llDetectedPos(UInt32 number); | 77 | // //LSO_Enums.Vector llDetectedPos(UInt32 number); |
78 | // //LSO_Enums.Vector llDetectedVel(UInt32 number); | 78 | // //LSO_Enums.Vector llDetectedVel(UInt32 number); |
79 | // //LSO_Enums.Vector llDetectedGrab(UInt32 number); | 79 | // //LSO_Enums.Vector llDetectedGrab(UInt32 number); |
80 | // //LSO_Enums.Rotation llDetectedRot(UInt32 number); | 80 | // //LSO_Enums.Rotation llDetectedRot(UInt32 number); |
81 | // //UInt32 llDetectedGroup(UInt32 number); | 81 | // //UInt32 llDetectedGroup(UInt32 number); |
82 | // //UInt32 llDetectedLinkNumber(UInt32 number); | 82 | // //UInt32 llDetectedLinkNumber(UInt32 number); |
83 | // //void llDie(); | 83 | // //void llDie(); |
84 | // //float llGround(LSO_Enums.Vector offset); | 84 | // //float llGround(LSO_Enums.Vector offset); |
85 | // //float llCloud(LSO_Enums.Vector offset); | 85 | // //float llCloud(LSO_Enums.Vector offset); |
86 | // //LSO_Enums.Vector llWind(LSO_Enums.Vector offset); | 86 | // //LSO_Enums.Vector llWind(LSO_Enums.Vector offset); |
87 | // //void llSetStatus(UInt32 status, UInt32 value); | 87 | // //void llSetStatus(UInt32 status, UInt32 value); |
88 | // //UInt32 llGetStatus(UInt32 status); | 88 | // //UInt32 llGetStatus(UInt32 status); |
89 | // //void llSetScale(LSO_Enums.Vector scale); | 89 | // //void llSetScale(LSO_Enums.Vector scale); |
90 | // //LSO_Enums.Vector llGetScale(); | 90 | // //LSO_Enums.Vector llGetScale(); |
91 | // //void llSetColor(); | 91 | // //void llSetColor(); |
92 | // //float llGetAlpha(); | 92 | // //float llGetAlpha(); |
93 | // //void llSetAlpha(); | 93 | // //void llSetAlpha(); |
94 | // //LSO_Enums.Vector llGetColor(); | 94 | // //LSO_Enums.Vector llGetColor(); |
95 | // //void llSetTexture(); | 95 | // //void llSetTexture(); |
96 | // //void llScaleTexture(); | 96 | // //void llScaleTexture(); |
97 | // //void llOffsetTexture(); | 97 | // //void llOffsetTexture(); |
98 | // //void llRotateTexture(); | 98 | // //void llRotateTexture(); |
99 | // //string llGetTexture(); | 99 | // //string llGetTexture(); |
100 | // //void llSetPos(); | 100 | // //void llSetPos(); |
101 | 101 | ||
102 | // public void llGetPos() { } | 102 | // public void llGetPos() { } |
103 | // public void llGetLocalPos() { } | 103 | // public void llGetLocalPos() { } |
104 | // public void llSetRot() { } | 104 | // public void llSetRot() { } |
105 | // public void llGetRot() { } | 105 | // public void llGetRot() { } |
106 | // public void llGetLocalRot() { } | 106 | // public void llGetLocalRot() { } |
107 | // public void llSetForce() { } | 107 | // public void llSetForce() { } |
108 | // public void llGetForce() { } | 108 | // public void llGetForce() { } |
109 | // public void llTarget() { } | 109 | // public void llTarget() { } |
110 | // public void llTargetRemove() { } | 110 | // public void llTargetRemove() { } |
111 | // public void llRotTarget() { } | 111 | // public void llRotTarget() { } |
112 | // public void llRotTargetRemove() { } | 112 | // public void llRotTargetRemove() { } |
113 | // public void llMoveToTarget() { } | 113 | // public void llMoveToTarget() { } |
114 | // public void llStopMoveToTarget() { } | 114 | // public void llStopMoveToTarget() { } |
115 | // public void llApplyImpulse() { } | 115 | // public void llApplyImpulse() { } |
116 | // public void llApplyRotationalImpulse() { } | 116 | // public void llApplyRotationalImpulse() { } |
117 | // public void llSetTorque() { } | 117 | // public void llSetTorque() { } |
118 | // public void llGetTorque() { } | 118 | // public void llGetTorque() { } |
119 | // public void llSetForceAndTorque() { } | 119 | // public void llSetForceAndTorque() { } |
120 | // public void llGetVel() { } | 120 | // public void llGetVel() { } |
121 | // public void llGetAccel() { } | 121 | // public void llGetAccel() { } |
122 | // public void llGetOmega() { } | 122 | // public void llGetOmega() { } |
123 | // public void llGetTimeOfDay() { } | 123 | // public void llGetTimeOfDay() { } |
124 | // public void llGetWallclock() { } | 124 | // public void llGetWallclock() { } |
125 | // public void llGetTime() { } | 125 | // public void llGetTime() { } |
126 | // public void llResetTime() { } | 126 | // public void llResetTime() { } |
127 | // public void llGetAndResetTime() { } | 127 | // public void llGetAndResetTime() { } |
128 | // public void llSound() { } | 128 | // public void llSound() { } |
129 | // public void llPlaySound() { } | 129 | // public void llPlaySound() { } |
130 | // public void llLoopSound() { } | 130 | // public void llLoopSound() { } |
131 | // public void llLoopSoundMaster() { } | 131 | // public void llLoopSoundMaster() { } |
132 | // public void llLoopSoundSlave() { } | 132 | // public void llLoopSoundSlave() { } |
133 | // public void llPlaySoundSlave() { } | 133 | // public void llPlaySoundSlave() { } |
134 | // public void llTriggerSound() { } | 134 | // public void llTriggerSound() { } |
135 | // public void llStopSound() { } | 135 | // public void llStopSound() { } |
136 | // public void llPreloadSound() { } | 136 | // public void llPreloadSound() { } |
137 | // public void llGetSubString() { } | 137 | // public void llGetSubString() { } |
138 | // public void llDeleteSubString() { } | 138 | // public void llDeleteSubString() { } |
139 | // public void llInsertString() { } | 139 | // public void llInsertString() { } |
140 | // public void llToUpper() { } | 140 | // public void llToUpper() { } |
141 | // public void llToLower() { } | 141 | // public void llToLower() { } |
142 | // public void llGiveMoney() { } | 142 | // public void llGiveMoney() { } |
143 | // public void llMakeExplosion() { } | 143 | // public void llMakeExplosion() { } |
144 | // public void llMakeFountain() { } | 144 | // public void llMakeFountain() { } |
145 | // public void llMakeSmoke() { } | 145 | // public void llMakeSmoke() { } |
146 | // public void llMakeFire() { } | 146 | // public void llMakeFire() { } |
147 | // public void llRezObject() { } | 147 | // public void llRezObject() { } |
148 | // public void llLookAt() { } | 148 | // public void llLookAt() { } |
149 | // public void llStopLookAt() { } | 149 | // public void llStopLookAt() { } |
150 | // public void llSetTimerEvent() { } | 150 | // public void llSetTimerEvent() { } |
151 | // public void llSleep() { } | 151 | // public void llSleep() { } |
152 | // public void llGetMass() { } | 152 | // public void llGetMass() { } |
153 | // public void llCollisionFilter() { } | 153 | // public void llCollisionFilter() { } |
154 | // public void llTakeControls() { } | 154 | // public void llTakeControls() { } |
155 | // public void llReleaseControls() { } | 155 | // public void llReleaseControls() { } |
156 | // public void llAttachToAvatar() { } | 156 | // public void llAttachToAvatar() { } |
157 | // public void llDetachFromAvatar() { } | 157 | // public void llDetachFromAvatar() { } |
158 | // public void llTakeCamera() { } | 158 | // public void llTakeCamera() { } |
159 | // public void llReleaseCamera() { } | 159 | // public void llReleaseCamera() { } |
160 | // public void llGetOwner() { } | 160 | // public void llGetOwner() { } |
161 | // public void llInstantMessage() { } | 161 | // public void llInstantMessage() { } |
162 | // public void llEmail() { } | 162 | // public void llEmail() { } |
163 | // public void llGetNextEmail() { } | 163 | // public void llGetNextEmail() { } |
164 | // public void llGetKey() { } | 164 | // public void llGetKey() { } |
165 | // public void llSetBuoyancy() { } | 165 | // public void llSetBuoyancy() { } |
166 | // public void llSetHoverHeight() { } | 166 | // public void llSetHoverHeight() { } |
167 | // public void llStopHover() { } | 167 | // public void llStopHover() { } |
168 | // public void llMinEventDelay() { } | 168 | // public void llMinEventDelay() { } |
169 | // public void llSoundPreload() { } | 169 | // public void llSoundPreload() { } |
170 | // public void llRotLookAt() { } | 170 | // public void llRotLookAt() { } |
171 | // public void llStringLength() { } | 171 | // public void llStringLength() { } |
172 | // public void llStartAnimation() { } | 172 | // public void llStartAnimation() { } |
173 | // public void llStopAnimation() { } | 173 | // public void llStopAnimation() { } |
174 | // public void llPointAt() { } | 174 | // public void llPointAt() { } |
175 | // public void llStopPointAt() { } | 175 | // public void llStopPointAt() { } |
176 | // public void llTargetOmega() { } | 176 | // public void llTargetOmega() { } |
177 | // public void llGetStartParameter() { } | 177 | // public void llGetStartParameter() { } |
178 | // public void llGodLikeRezObject() { } | 178 | // public void llGodLikeRezObject() { } |
179 | // public void llRequestPermissions() { } | 179 | // public void llRequestPermissions() { } |
180 | // public void llGetPermissionsKey() { } | 180 | // public void llGetPermissionsKey() { } |
181 | // public void llGetPermissions() { } | 181 | // public void llGetPermissions() { } |
182 | // public void llGetLinkNumber() { } | 182 | // public void llGetLinkNumber() { } |
183 | // public void llSetLinkColor() { } | 183 | // public void llSetLinkColor() { } |
184 | // public void llCreateLink() { } | 184 | // public void llCreateLink() { } |
185 | // public void llBreakLink() { } | 185 | // public void llBreakLink() { } |
186 | // public void llBreakAllLinks() { } | 186 | // public void llBreakAllLinks() { } |
187 | // public void llGetLinkKey() { } | 187 | // public void llGetLinkKey() { } |
188 | // public void llGetLinkName() { } | 188 | // public void llGetLinkName() { } |
189 | // public void llGetInventoryNumber() { } | 189 | // public void llGetInventoryNumber() { } |
190 | // public void llGetInventoryName() { } | 190 | // public void llGetInventoryName() { } |
191 | // public void llSetScriptState() { } | 191 | // public void llSetScriptState() { } |
192 | // public void llGetEnergy() { } | 192 | // public void llGetEnergy() { } |
193 | // public void llGiveInventory() { } | 193 | // public void llGiveInventory() { } |
194 | // public void llRemoveInventory() { } | 194 | // public void llRemoveInventory() { } |
195 | // public void llSetText() { } | 195 | // public void llSetText() { } |
196 | // public void llWater() { } | 196 | // public void llWater() { } |
197 | // public void llPassTouches() { } | 197 | // public void llPassTouches() { } |
198 | // public void llRequestAgentData() { } | 198 | // public void llRequestAgentData() { } |
199 | // public void llRequestInventoryData() { } | 199 | // public void llRequestInventoryData() { } |
200 | // public void llSetDamage() { } | 200 | // public void llSetDamage() { } |
201 | // public void llTeleportAgentHome() { } | 201 | // public void llTeleportAgentHome() { } |
202 | // public void llModifyLand() { } | 202 | // public void llModifyLand() { } |
203 | // public void llCollisionSound() { } | 203 | // public void llCollisionSound() { } |
204 | // public void llCollisionSprite() { } | 204 | // public void llCollisionSprite() { } |
205 | // public void llGetAnimation() { } | 205 | // public void llGetAnimation() { } |
206 | // public void llResetScript() { } | 206 | // public void llResetScript() { } |
207 | // public void llMessageLinked() { } | 207 | // public void llMessageLinked() { } |
208 | // public void llPushObject() { } | 208 | // public void llPushObject() { } |
209 | // public void llPassCollisions() { } | 209 | // public void llPassCollisions() { } |
210 | // public void llGetScriptName() { } | 210 | // public void llGetScriptName() { } |
211 | // public void llGetNumberOfSides() { } | 211 | // public void llGetNumberOfSides() { } |
212 | // public void llAxisAngle2Rot() { } | 212 | // public void llAxisAngle2Rot() { } |
213 | // public void llRot2Axis() { } | 213 | // public void llRot2Axis() { } |
214 | // public void llRot2Angle() { } | 214 | // public void llRot2Angle() { } |
215 | // public void llAcos() { } | 215 | // public void llAcos() { } |
216 | // public void llAsin() { } | 216 | // public void llAsin() { } |
217 | // public void llAngleBetween() { } | 217 | // public void llAngleBetween() { } |
218 | // public void llGetInventoryKey() { } | 218 | // public void llGetInventoryKey() { } |
219 | // public void llAllowInventoryDrop() { } | 219 | // public void llAllowInventoryDrop() { } |
220 | // public void llGetSunDirection() { } | 220 | // public void llGetSunDirection() { } |
221 | // public void llGetTextureOffset() { } | 221 | // public void llGetTextureOffset() { } |
222 | // public void llGetTextureScale() { } | 222 | // public void llGetTextureScale() { } |
223 | // public void llGetTextureRot() { } | 223 | // public void llGetTextureRot() { } |
224 | // public void llSubStringIndex() { } | 224 | // public void llSubStringIndex() { } |
225 | // public void llGetOwnerKey() { } | 225 | // public void llGetOwnerKey() { } |
226 | // public void llGetCenterOfMass() { } | 226 | // public void llGetCenterOfMass() { } |
227 | // public void llListSort() { } | 227 | // public void llListSort() { } |
228 | // public void llGetListLength() { } | 228 | // public void llGetListLength() { } |
229 | // public void llList2Integer() { } | 229 | // public void llList2Integer() { } |
230 | // public void llList2Float() { } | 230 | // public void llList2Float() { } |
231 | // public void llList2String() { } | 231 | // public void llList2String() { } |
232 | // public void llList2Key() { } | 232 | // public void llList2Key() { } |
233 | // public void llList2Vector() { } | 233 | // public void llList2Vector() { } |
234 | // public void llList2Rot() { } | 234 | // public void llList2Rot() { } |
235 | // public void llList2List() { } | 235 | // public void llList2List() { } |
236 | // public void llDeleteSubList() { } | 236 | // public void llDeleteSubList() { } |
237 | // public void llGetListEntryType() { } | 237 | // public void llGetListEntryType() { } |
238 | // public void llList2CSV() { } | 238 | // public void llList2CSV() { } |
239 | // public void llCSV2List() { } | 239 | // public void llCSV2List() { } |
240 | // public void llListRandomize() { } | 240 | // public void llListRandomize() { } |
241 | // public void llList2ListStrided() { } | 241 | // public void llList2ListStrided() { } |
242 | // public void llGetRegionCorner() { } | 242 | // public void llGetRegionCorner() { } |
243 | // public void llListInsertList() { } | 243 | // public void llListInsertList() { } |
244 | // public void llListFindList() { } | 244 | // public void llListFindList() { } |
245 | // public void llGetObjectName() { } | 245 | // public void llGetObjectName() { } |
246 | // public void llSetObjectName() { } | 246 | // public void llSetObjectName() { } |
247 | // public void llGetDate() { } | 247 | // public void llGetDate() { } |
248 | // public void llEdgeOfWorld() { } | 248 | // public void llEdgeOfWorld() { } |
249 | // public void llGetAgentInfo() { } | 249 | // public void llGetAgentInfo() { } |
250 | // public void llAdjustSoundVolume() { } | 250 | // public void llAdjustSoundVolume() { } |
251 | // public void llSetSoundQueueing() { } | 251 | // public void llSetSoundQueueing() { } |
252 | // public void llSetSoundRadius() { } | 252 | // public void llSetSoundRadius() { } |
253 | // public void llKey2Name() { } | 253 | // public void llKey2Name() { } |
254 | // public void llSetTextureAnim() { } | 254 | // public void llSetTextureAnim() { } |
255 | // public void llTriggerSoundLimited() { } | 255 | // public void llTriggerSoundLimited() { } |
256 | // public void llEjectFromLand() { } | 256 | // public void llEjectFromLand() { } |
257 | // public void llParseString2List() { } | 257 | // public void llParseString2List() { } |
258 | // public void llOverMyLand() { } | 258 | // public void llOverMyLand() { } |
259 | // public void llGetLandOwnerAt() { } | 259 | // public void llGetLandOwnerAt() { } |
260 | // public void llGetNotecardLine() { } | 260 | // public void llGetNotecardLine() { } |
261 | // public void llGetAgentSize() { } | 261 | // public void llGetAgentSize() { } |
262 | // public void llSameGroup() { } | 262 | // public void llSameGroup() { } |
263 | // public void llUnSit() { } | 263 | // public void llUnSit() { } |
264 | // public void llGroundSlope() { } | 264 | // public void llGroundSlope() { } |
265 | // public void llGroundNormal() { } | 265 | // public void llGroundNormal() { } |
266 | // public void llGroundContour() { } | 266 | // public void llGroundContour() { } |
267 | // public void llGetAttached() { } | 267 | // public void llGetAttached() { } |
268 | // public void llGetFreeMemory() { } | 268 | // public void llGetFreeMemory() { } |
269 | // public void llGetRegionName() { } | 269 | // public void llGetRegionName() { } |
270 | // public void llGetRegionTimeDilation() { } | 270 | // public void llGetRegionTimeDilation() { } |
271 | // public void llGetRegionFPS() { } | 271 | // public void llGetRegionFPS() { } |
272 | // public void llParticleSystem() { } | 272 | // public void llParticleSystem() { } |
273 | // public void llGroundRepel() { } | 273 | // public void llGroundRepel() { } |
274 | // public void llGiveInventoryList() { } | 274 | // public void llGiveInventoryList() { } |
275 | // public void llSetVehicleType() { } | 275 | // public void llSetVehicleType() { } |
276 | // public void llSetVehicleFloatParam() { } | 276 | // public void llSetVehicleFloatParam() { } |
277 | // public void llSetVehicleVectorParam() { } | 277 | // public void llSetVehicleVectorParam() { } |
278 | // public void llSetVehicleRotationParam() { } | 278 | // public void llSetVehicleRotationParam() { } |
279 | // public void llSetVehicleFlags() { } | 279 | // public void llSetVehicleFlags() { } |
280 | // public void llRemoveVehicleFlags() { } | 280 | // public void llRemoveVehicleFlags() { } |
281 | // public void llSitTarget() { } | 281 | // public void llSitTarget() { } |
282 | // public void llAvatarOnSitTarget() { } | 282 | // public void llAvatarOnSitTarget() { } |
283 | // public void llAddToLandPassList() { } | 283 | // public void llAddToLandPassList() { } |
284 | // public void llSetTouchText() { } | 284 | // public void llSetTouchText() { } |
285 | // public void llSetSitText() { } | 285 | // public void llSetSitText() { } |
286 | // public void llSetCameraEyeOffset() { } | 286 | // public void llSetCameraEyeOffset() { } |
287 | // public void llSetCameraAtOffset() { } | 287 | // public void llSetCameraAtOffset() { } |
288 | // public void llDumpList2String() { } | 288 | // public void llDumpList2String() { } |
289 | // public void llScriptDanger() { } | 289 | // public void llScriptDanger() { } |
290 | // public void llDialog() { } | 290 | // public void llDialog() { } |
291 | // public void llVolumeDetect() { } | 291 | // public void llVolumeDetect() { } |
292 | // public void llResetOtherScript() { } | 292 | // public void llResetOtherScript() { } |
293 | // public void llGetScriptState() { } | 293 | // public void llGetScriptState() { } |
294 | // public void llRemoteLoadScript() { } | 294 | // public void llRemoteLoadScript() { } |
295 | // public void llSetRemoteScriptAccessPin() { } | 295 | // public void llSetRemoteScriptAccessPin() { } |
296 | // public void llRemoteLoadScriptPin() { } | 296 | // public void llRemoteLoadScriptPin() { } |
297 | // public void llOpenRemoteDataChannel() { } | 297 | // public void llOpenRemoteDataChannel() { } |
298 | // public void llSendRemoteData() { } | 298 | // public void llSendRemoteData() { } |
299 | // public void llRemoteDataReply() { } | 299 | // public void llRemoteDataReply() { } |
300 | // public void llCloseRemoteDataChannel() { } | 300 | // public void llCloseRemoteDataChannel() { } |
301 | // public void llMD5String() { } | 301 | // public void llMD5String() { } |
302 | // public void llSetPrimitiveParams() { } | 302 | // public void llSetPrimitiveParams() { } |
303 | // public void llStringToBase64() { } | 303 | // public void llStringToBase64() { } |
304 | // public void llBase64ToString() { } | 304 | // public void llBase64ToString() { } |
305 | // public void llXorBase64Strings() { } | 305 | // public void llXorBase64Strings() { } |
306 | // public void llRemoteDataSetRegion() { } | 306 | // public void llRemoteDataSetRegion() { } |
307 | // public void llLog10() { } | 307 | // public void llLog10() { } |
308 | // public void llLog() { } | 308 | // public void llLog() { } |
309 | // public void llGetAnimationList() { } | 309 | // public void llGetAnimationList() { } |
310 | // public void llSetParcelMusicURL() { } | 310 | // public void llSetParcelMusicURL() { } |
311 | // public void llGetRootPosition() { } | 311 | // public void llGetRootPosition() { } |
312 | // public void llGetRootRotation() { } | 312 | // public void llGetRootRotation() { } |
313 | // public void llGetObjectDesc() { } | 313 | // public void llGetObjectDesc() { } |
314 | // public void llSetObjectDesc() { } | 314 | // public void llSetObjectDesc() { } |
315 | // public void llGetCreator() { } | 315 | // public void llGetCreator() { } |
316 | // public void llGetTimestamp() { } | 316 | // public void llGetTimestamp() { } |
317 | // public void llSetLinkAlpha() { } | 317 | // public void llSetLinkAlpha() { } |
318 | // public void llGetNumberOfPrims() { } | 318 | // public void llGetNumberOfPrims() { } |
319 | // public void llGetNumberOfNotecardLines() { } | 319 | // public void llGetNumberOfNotecardLines() { } |
320 | // public void llGetBoundingBox() { } | 320 | // public void llGetBoundingBox() { } |
321 | // public void llGetGeometricCenter() { } | 321 | // public void llGetGeometricCenter() { } |
322 | // public void llGetPrimitiveParams() { } | 322 | // public void llGetPrimitiveParams() { } |
323 | // public void llIntegerToBase64() { } | 323 | // public void llIntegerToBase64() { } |
324 | // public void llBase64ToInteger() { } | 324 | // public void llBase64ToInteger() { } |
325 | // public void llGetGMTclock() { } | 325 | // public void llGetGMTclock() { } |
326 | // public void llGetSimulatorHostname() { } | 326 | // public void llGetSimulatorHostname() { } |
327 | // public void llSetLocalRot() { } | 327 | // public void llSetLocalRot() { } |
328 | // public void llParseStringKeepNulls() { } | 328 | // public void llParseStringKeepNulls() { } |
329 | // public void llRezAtRoot() { } | 329 | // public void llRezAtRoot() { } |
330 | // public void llGetObjectPermMask() { } | 330 | // public void llGetObjectPermMask() { } |
331 | // public void llSetObjectPermMask() { } | 331 | // public void llSetObjectPermMask() { } |
332 | // public void llGetInventoryPermMask() { } | 332 | // public void llGetInventoryPermMask() { } |
333 | // public void llSetInventoryPermMask() { } | 333 | // public void llSetInventoryPermMask() { } |
334 | // public void llGetInventoryCreator() { } | 334 | // public void llGetInventoryCreator() { } |
335 | // public void llOwnerSay() { } | 335 | // public void llOwnerSay() { } |
336 | // public void llRequestSimulatorData() { } | 336 | // public void llRequestSimulatorData() { } |
337 | // public void llForceMouselook() { } | 337 | // public void llForceMouselook() { } |
338 | // public void llGetObjectMass() { } | 338 | // public void llGetObjectMass() { } |
339 | // public void llListReplaceList() { } | 339 | // public void llListReplaceList() { } |
340 | // public void llLoadURL() { } | 340 | // public void llLoadURL() { } |
341 | // public void llParcelMediaCommandList() { } | 341 | // public void llParcelMediaCommandList() { } |
342 | // public void llParcelMediaQuery() { } | 342 | // public void llParcelMediaQuery() { } |
343 | // public void llModPow() { } | 343 | // public void llModPow() { } |
344 | // public void llGetInventoryType() { } | 344 | // public void llGetInventoryType() { } |
345 | // public void llSetPayPrice() { } | 345 | // public void llSetPayPrice() { } |
346 | // public void llGetCameraPos() { } | 346 | // public void llGetCameraPos() { } |
347 | // public void llGetCameraRot() { } | 347 | // public void llGetCameraRot() { } |
348 | // public void llSetPrimURL() { } | 348 | // public void llSetPrimURL() { } |
349 | // public void llRefreshPrimURL() { } | 349 | // public void llRefreshPrimURL() { } |
350 | // public void llEscapeURL() { } | 350 | // public void llEscapeURL() { } |
351 | // public void llUnescapeURL() { } | 351 | // public void llUnescapeURL() { } |
352 | // public void llMapDestination() { } | 352 | // public void llMapDestination() { } |
353 | // public void llAddToLandBanList() { } | 353 | // public void llAddToLandBanList() { } |
354 | // public void llRemoveFromLandPassList() { } | 354 | // public void llRemoveFromLandPassList() { } |
355 | // public void llRemoveFromLandBanList() { } | 355 | // public void llRemoveFromLandBanList() { } |
356 | // public void llSetCameraParams() { } | 356 | // public void llSetCameraParams() { } |
357 | // public void llClearCameraParams() { } | 357 | // public void llClearCameraParams() { } |
358 | // public void llListStatistics() { } | 358 | // public void llListStatistics() { } |
359 | // public void llGetUnixTime() { } | 359 | // public void llGetUnixTime() { } |
360 | // public void llGetParcelFlags() { } | 360 | // public void llGetParcelFlags() { } |
361 | // public void llGetRegionFlags() { } | 361 | // public void llGetRegionFlags() { } |
362 | // public void llXorBase64StringsCorrect() { } | 362 | // public void llXorBase64StringsCorrect() { } |
363 | // public void llHTTPRequest() { } | 363 | // public void llHTTPRequest() { } |
364 | // public void llResetLandBanList() { } | 364 | // public void llResetLandBanList() { } |
365 | // public void llResetLandPassList() { } | 365 | // public void llResetLandPassList() { } |
366 | // public void llGetParcelPrimCount() { } | 366 | // public void llGetParcelPrimCount() { } |
367 | // public void llGetParcelPrimOwners() { } | 367 | // public void llGetParcelPrimOwners() { } |
368 | // public void llGetObjectPrimCount() { } | 368 | // public void llGetObjectPrimCount() { } |
369 | // public void llGetParcelMaxPrims() { } | 369 | // public void llGetParcelMaxPrims() { } |
370 | // public void llGetParcelDetails() { } | 370 | // public void llGetParcelDetails() { } |
371 | 371 | ||
372 | // } | 372 | // } |
373 | //} | 373 | //} |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_OPCODES.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_OPCODES.cs index e55f28d..09a24d5 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_OPCODES.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_BaseClass_OPCODES.cs | |||
@@ -1,350 +1,350 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | 4 | ||
5 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 5 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
6 | { | 6 | { |
7 | public partial class LSL_BaseClass | 7 | public partial class LSL_BaseClass |
8 | { | 8 | { |
9 | /* | 9 | /* |
10 | * OPCODES | 10 | * OPCODES |
11 | * | 11 | * |
12 | * These are internal "assembly" commands, | 12 | * These are internal "assembly" commands, |
13 | * basic operators like "ADD", "PUSH" and "POP" | 13 | * basic operators like "ADD", "PUSH" and "POP" |
14 | * | 14 | * |
15 | * It also contains managed stack and keeps track of internal variables, etc. | 15 | * It also contains managed stack and keeps track of internal variables, etc. |
16 | * | 16 | * |
17 | */ | 17 | */ |
18 | 18 | ||
19 | 19 | ||
20 | public void StoreToLocal(UInt32 index) | 20 | public void StoreToLocal(UInt32 index) |
21 | { | 21 | { |
22 | // TODO: How to determine local? | 22 | // TODO: How to determine local? |
23 | Common.SendToDebug("::StoreToLocal " + index); | 23 | Common.SendToDebug("::StoreToLocal " + index); |
24 | if (LocalVariables.ContainsKey(index)) | 24 | if (LocalVariables.ContainsKey(index)) |
25 | LocalVariables.Remove(index); | 25 | LocalVariables.Remove(index); |
26 | LocalVariables.Add(index, LSLStack.Peek()); | 26 | LocalVariables.Add(index, LSLStack.Peek()); |
27 | } | 27 | } |
28 | public void StoreToGlobal(UInt32 index) | 28 | public void StoreToGlobal(UInt32 index) |
29 | { | 29 | { |
30 | Common.SendToDebug("::StoreToGlobal " + index); | 30 | Common.SendToDebug("::StoreToGlobal " + index); |
31 | if (GlobalVariables.ContainsKey(index)) | 31 | if (GlobalVariables.ContainsKey(index)) |
32 | GlobalVariables.Remove(index); | 32 | GlobalVariables.Remove(index); |
33 | GlobalVariables.Add(index, LSLStack.Peek()); | 33 | GlobalVariables.Add(index, LSLStack.Peek()); |
34 | } | 34 | } |
35 | public void StoreToStatic(UInt32 index) | 35 | public void StoreToStatic(UInt32 index) |
36 | { | 36 | { |
37 | Common.SendToDebug("::StoreToStatic " + index); | 37 | Common.SendToDebug("::StoreToStatic " + index); |
38 | //if (StaticVariables.ContainsKey(index)) | 38 | //if (StaticVariables.ContainsKey(index)) |
39 | // StaticVariables.Remove(index); | 39 | // StaticVariables.Remove(index); |
40 | StaticVariables.Add(index, LSLStack.Peek()); | 40 | StaticVariables.Add(index, LSLStack.Peek()); |
41 | } | 41 | } |
42 | public void GetFromLocal(UInt32 index) | 42 | public void GetFromLocal(UInt32 index) |
43 | { | 43 | { |
44 | // TODO: How to determine local? | 44 | // TODO: How to determine local? |
45 | Common.SendToDebug("::GetFromLocal " + index); | 45 | Common.SendToDebug("::GetFromLocal " + index); |
46 | object ret; | 46 | object ret; |
47 | LocalVariables.TryGetValue(index, out ret); | 47 | LocalVariables.TryGetValue(index, out ret); |
48 | LSLStack.Push(ret); | 48 | LSLStack.Push(ret); |
49 | //return ret; | 49 | //return ret; |
50 | } | 50 | } |
51 | public void GetFromGlobal(UInt32 index) | 51 | public void GetFromGlobal(UInt32 index) |
52 | { | 52 | { |
53 | Common.SendToDebug("::GetFromGlobal " + index); | 53 | Common.SendToDebug("::GetFromGlobal " + index); |
54 | object ret; | 54 | object ret; |
55 | GlobalVariables.TryGetValue(index, out ret); | 55 | GlobalVariables.TryGetValue(index, out ret); |
56 | LSLStack.Push(ret); | 56 | LSLStack.Push(ret); |
57 | //return ret; | 57 | //return ret; |
58 | } | 58 | } |
59 | public void GetFromStatic(UInt32 index) | 59 | public void GetFromStatic(UInt32 index) |
60 | { | 60 | { |
61 | Common.SendToDebug("::GetFromStatic " + index); | 61 | Common.SendToDebug("::GetFromStatic " + index); |
62 | object ret; | 62 | object ret; |
63 | StaticVariables.TryGetValue(index, out ret); | 63 | StaticVariables.TryGetValue(index, out ret); |
64 | Common.SendToDebug("::GetFromStatic - ObjectType: " + ret.GetType().ToString()); | 64 | Common.SendToDebug("::GetFromStatic - ObjectType: " + ret.GetType().ToString()); |
65 | LSLStack.Push(ret); | 65 | LSLStack.Push(ret); |
66 | //return ret; | 66 | //return ret; |
67 | } | 67 | } |
68 | 68 | ||
69 | public object POPToStack() | 69 | public object POPToStack() |
70 | { | 70 | { |
71 | Common.SendToDebug("::POPToStack"); | 71 | Common.SendToDebug("::POPToStack"); |
72 | //return LSLStack.Pop(); | 72 | //return LSLStack.Pop(); |
73 | object p = LSLStack.Pop(); | 73 | object p = LSLStack.Pop(); |
74 | if (p.GetType() == typeof(UInt32)) | 74 | if (p.GetType() == typeof(UInt32)) |
75 | return (UInt32)p; | 75 | return (UInt32)p; |
76 | if (p.GetType() == typeof(string)) | 76 | if (p.GetType() == typeof(string)) |
77 | return (string)p; | 77 | return (string)p; |
78 | if (p.GetType() == typeof(Int32)) | 78 | if (p.GetType() == typeof(Int32)) |
79 | return (Int32)p; | 79 | return (Int32)p; |
80 | if (p.GetType() == typeof(UInt16)) | 80 | if (p.GetType() == typeof(UInt16)) |
81 | return (UInt16)p; | 81 | return (UInt16)p; |
82 | if (p.GetType() == typeof(float)) | 82 | if (p.GetType() == typeof(float)) |
83 | return (float)p; | 83 | return (float)p; |
84 | if (p.GetType() == typeof(LSO_Enums.Vector)) | 84 | if (p.GetType() == typeof(LSO_Enums.Vector)) |
85 | return (LSO_Enums.Vector)p; | 85 | return (LSO_Enums.Vector)p; |
86 | if (p.GetType() == typeof(LSO_Enums.Rotation)) | 86 | if (p.GetType() == typeof(LSO_Enums.Rotation)) |
87 | return (LSO_Enums.Rotation)p; | 87 | return (LSO_Enums.Rotation)p; |
88 | if (p.GetType() == typeof(LSO_Enums.Key)) | 88 | if (p.GetType() == typeof(LSO_Enums.Key)) |
89 | return (LSO_Enums.Key)p; | 89 | return (LSO_Enums.Key)p; |
90 | 90 | ||
91 | return p; | 91 | return p; |
92 | } | 92 | } |
93 | 93 | ||
94 | //public object POPToStack(UInt32 count) | 94 | //public object POPToStack(UInt32 count) |
95 | //{ | 95 | //{ |
96 | // // POP NUMBER FROM TOP OF STACK | 96 | // // POP NUMBER FROM TOP OF STACK |
97 | // //LSLStack.SetLength(LSLStack.Length - 4); | 97 | // //LSLStack.SetLength(LSLStack.Length - 4); |
98 | // Common.SendToDebug("::POPToStack " + count); | 98 | // Common.SendToDebug("::POPToStack " + count); |
99 | // if (count < 2) | 99 | // if (count < 2) |
100 | // return LSLStack.Pop(); | 100 | // return LSLStack.Pop(); |
101 | 101 | ||
102 | // Stack<object> s = new Stack<object>(); | 102 | // Stack<object> s = new Stack<object>(); |
103 | // for (int i = 0; i < count; i++) | 103 | // for (int i = 0; i < count; i++) |
104 | // { | 104 | // { |
105 | // s.Push(LSLStack.Pop); | 105 | // s.Push(LSLStack.Pop); |
106 | 106 | ||
107 | // } | 107 | // } |
108 | 108 | ||
109 | //} | 109 | //} |
110 | 110 | ||
111 | public void POP() | 111 | public void POP() |
112 | { | 112 | { |
113 | // POP NUMBER FROM TOP OF STACK | 113 | // POP NUMBER FROM TOP OF STACK |
114 | //LSLStack.SetLength(LSLStack.Length - 4); | 114 | //LSLStack.SetLength(LSLStack.Length - 4); |
115 | Common.SendToDebug("::POP"); | 115 | Common.SendToDebug("::POP"); |
116 | if (LSLStack.Count < 1) | 116 | if (LSLStack.Count < 1) |
117 | { | 117 | { |
118 | //TODO: Temporary fix | 118 | //TODO: Temporary fix |
119 | Common.SendToDebug("ERROR: TRYING TO POP EMPTY STACK!"); | 119 | Common.SendToDebug("ERROR: TRYING TO POP EMPTY STACK!"); |
120 | } | 120 | } |
121 | else | 121 | else |
122 | { | 122 | { |
123 | LSLStack.Pop(); | 123 | LSLStack.Pop(); |
124 | } | 124 | } |
125 | } | 125 | } |
126 | public void PUSH(object Param) | 126 | public void PUSH(object Param) |
127 | { | 127 | { |
128 | if (Param == null) | 128 | if (Param == null) |
129 | { | 129 | { |
130 | Common.SendToDebug("::PUSH: <null>"); | 130 | Common.SendToDebug("::PUSH: <null>"); |
131 | } | 131 | } |
132 | else | 132 | else |
133 | { | 133 | { |
134 | 134 | ||
135 | //Common.SendToDebug("::PUSH: " + Param.GetType()); | 135 | //Common.SendToDebug("::PUSH: " + Param.GetType()); |
136 | } | 136 | } |
137 | 137 | ||
138 | LSLStack.Push(Param); | 138 | LSLStack.Push(Param); |
139 | } | 139 | } |
140 | public void ADD(UInt32 Param) | 140 | public void ADD(UInt32 Param) |
141 | { | 141 | { |
142 | Common.SendToDebug("::ADD: " + Param); | 142 | Common.SendToDebug("::ADD: " + Param); |
143 | object o2 = LSLStack.Pop(); | 143 | object o2 = LSLStack.Pop(); |
144 | object o1 = LSLStack.Pop(); | 144 | object o1 = LSLStack.Pop(); |
145 | Common.SendToDebug("::ADD: Debug: o1: " + o1.GetType() + " (" + o1.ToString() + "), o2: " + o2.GetType() + " (" + o2.ToString() + ")"); | 145 | Common.SendToDebug("::ADD: Debug: o1: " + o1.GetType() + " (" + o1.ToString() + "), o2: " + o2.GetType() + " (" + o2.ToString() + ")"); |
146 | if (o2.GetType() == typeof(string)) | 146 | if (o2.GetType() == typeof(string)) |
147 | { | 147 | { |
148 | LSLStack.Push((string)o1 + (string)o2); | 148 | LSLStack.Push((string)o1 + (string)o2); |
149 | return; | 149 | return; |
150 | } | 150 | } |
151 | if (o2.GetType() == typeof(UInt32)) | 151 | if (o2.GetType() == typeof(UInt32)) |
152 | { | 152 | { |
153 | LSLStack.Push((UInt32)o1 + (UInt32)o2); | 153 | LSLStack.Push((UInt32)o1 + (UInt32)o2); |
154 | return; | 154 | return; |
155 | } | 155 | } |
156 | 156 | ||
157 | } | 157 | } |
158 | public void SUB(UInt32 Param) | 158 | public void SUB(UInt32 Param) |
159 | { | 159 | { |
160 | Common.SendToDebug("::SUB: " + Param); | 160 | Common.SendToDebug("::SUB: " + Param); |
161 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 161 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
162 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 162 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
163 | LSLStack.Push((UInt32)(i1 - i2)); | 163 | LSLStack.Push((UInt32)(i1 - i2)); |
164 | } | 164 | } |
165 | public void MUL(UInt32 Param) | 165 | public void MUL(UInt32 Param) |
166 | { | 166 | { |
167 | Common.SendToDebug("::SUB: " + Param); | 167 | Common.SendToDebug("::SUB: " + Param); |
168 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 168 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
169 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 169 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
170 | LSLStack.Push((UInt32)(i1 * i2)); | 170 | LSLStack.Push((UInt32)(i1 * i2)); |
171 | } | 171 | } |
172 | public void DIV(UInt32 Param) | 172 | public void DIV(UInt32 Param) |
173 | { | 173 | { |
174 | Common.SendToDebug("::DIV: " + Param); | 174 | Common.SendToDebug("::DIV: " + Param); |
175 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 175 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
176 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 176 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
177 | LSLStack.Push((UInt32)(i1 / i2)); | 177 | LSLStack.Push((UInt32)(i1 / i2)); |
178 | } | 178 | } |
179 | 179 | ||
180 | 180 | ||
181 | public void MOD(UInt32 Param) | 181 | public void MOD(UInt32 Param) |
182 | { | 182 | { |
183 | Common.SendToDebug("::MOD: " + Param); | 183 | Common.SendToDebug("::MOD: " + Param); |
184 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 184 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
185 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 185 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
186 | LSLStack.Push((UInt32)(i1 % i2)); | 186 | LSLStack.Push((UInt32)(i1 % i2)); |
187 | } | 187 | } |
188 | public void EQ(UInt32 Param) | 188 | public void EQ(UInt32 Param) |
189 | { | 189 | { |
190 | Common.SendToDebug("::EQ: " + Param); | 190 | Common.SendToDebug("::EQ: " + Param); |
191 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 191 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
192 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 192 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
193 | if (i1 == i2) | 193 | if (i1 == i2) |
194 | { | 194 | { |
195 | LSLStack.Push((UInt32)1); | 195 | LSLStack.Push((UInt32)1); |
196 | } | 196 | } |
197 | else | 197 | else |
198 | { | 198 | { |
199 | LSLStack.Push((UInt32)0); | 199 | LSLStack.Push((UInt32)0); |
200 | } | 200 | } |
201 | } | 201 | } |
202 | public void NEQ(UInt32 Param) | 202 | public void NEQ(UInt32 Param) |
203 | { | 203 | { |
204 | Common.SendToDebug("::NEQ: " + Param); | 204 | Common.SendToDebug("::NEQ: " + Param); |
205 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 205 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
206 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 206 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
207 | if (i1 != i2) | 207 | if (i1 != i2) |
208 | { | 208 | { |
209 | LSLStack.Push((UInt32)1); | 209 | LSLStack.Push((UInt32)1); |
210 | } | 210 | } |
211 | else | 211 | else |
212 | { | 212 | { |
213 | LSLStack.Push((UInt32)0); | 213 | LSLStack.Push((UInt32)0); |
214 | } | 214 | } |
215 | } | 215 | } |
216 | public void LEQ(UInt32 Param) | 216 | public void LEQ(UInt32 Param) |
217 | { | 217 | { |
218 | Common.SendToDebug("::LEQ: " + Param); | 218 | Common.SendToDebug("::LEQ: " + Param); |
219 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 219 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
220 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 220 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
221 | if (i1 <= i2) | 221 | if (i1 <= i2) |
222 | { | 222 | { |
223 | LSLStack.Push((UInt32)1); | 223 | LSLStack.Push((UInt32)1); |
224 | } | 224 | } |
225 | else | 225 | else |
226 | { | 226 | { |
227 | LSLStack.Push((UInt32)0); | 227 | LSLStack.Push((UInt32)0); |
228 | } | 228 | } |
229 | } | 229 | } |
230 | public void GEQ(UInt32 Param) | 230 | public void GEQ(UInt32 Param) |
231 | { | 231 | { |
232 | Common.SendToDebug("::GEQ: " + Param); | 232 | Common.SendToDebug("::GEQ: " + Param); |
233 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 233 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
234 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 234 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
235 | if (i1 >= i2) | 235 | if (i1 >= i2) |
236 | { | 236 | { |
237 | LSLStack.Push((UInt32)1); | 237 | LSLStack.Push((UInt32)1); |
238 | } | 238 | } |
239 | else | 239 | else |
240 | { | 240 | { |
241 | LSLStack.Push((UInt32)0); | 241 | LSLStack.Push((UInt32)0); |
242 | } | 242 | } |
243 | } | 243 | } |
244 | public void LESS(UInt32 Param) | 244 | public void LESS(UInt32 Param) |
245 | { | 245 | { |
246 | Common.SendToDebug("::LESS: " + Param); | 246 | Common.SendToDebug("::LESS: " + Param); |
247 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 247 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
248 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 248 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
249 | if (i1 < i2) | 249 | if (i1 < i2) |
250 | { | 250 | { |
251 | LSLStack.Push((UInt32)1); | 251 | LSLStack.Push((UInt32)1); |
252 | } | 252 | } |
253 | else | 253 | else |
254 | { | 254 | { |
255 | LSLStack.Push((UInt32)0); | 255 | LSLStack.Push((UInt32)0); |
256 | } | 256 | } |
257 | } | 257 | } |
258 | public void GREATER(UInt32 Param) | 258 | public void GREATER(UInt32 Param) |
259 | { | 259 | { |
260 | Common.SendToDebug("::GREATER: " + Param); | 260 | Common.SendToDebug("::GREATER: " + Param); |
261 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 261 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
262 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 262 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
263 | if (i1 > i2) | 263 | if (i1 > i2) |
264 | { | 264 | { |
265 | LSLStack.Push((UInt32)1); | 265 | LSLStack.Push((UInt32)1); |
266 | } | 266 | } |
267 | else | 267 | else |
268 | { | 268 | { |
269 | LSLStack.Push((UInt32)0); | 269 | LSLStack.Push((UInt32)0); |
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | 273 | ||
274 | 274 | ||
275 | public void BITAND() | 275 | public void BITAND() |
276 | { | 276 | { |
277 | Common.SendToDebug("::BITAND"); | 277 | Common.SendToDebug("::BITAND"); |
278 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 278 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
279 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 279 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
280 | LSLStack.Push((UInt32)(i1 & i2)); | 280 | LSLStack.Push((UInt32)(i1 & i2)); |
281 | } | 281 | } |
282 | public void BITOR() | 282 | public void BITOR() |
283 | { | 283 | { |
284 | Common.SendToDebug("::BITOR"); | 284 | Common.SendToDebug("::BITOR"); |
285 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 285 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
286 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 286 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
287 | LSLStack.Push((UInt32)(i1 | i2)); | 287 | LSLStack.Push((UInt32)(i1 | i2)); |
288 | } | 288 | } |
289 | public void BITXOR() | 289 | public void BITXOR() |
290 | { | 290 | { |
291 | Common.SendToDebug("::BITXOR"); | 291 | Common.SendToDebug("::BITXOR"); |
292 | UInt32 i2 = (UInt32)LSLStack.Pop(); | 292 | UInt32 i2 = (UInt32)LSLStack.Pop(); |
293 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 293 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
294 | LSLStack.Push((UInt32)(i1 ^ i2)); | 294 | LSLStack.Push((UInt32)(i1 ^ i2)); |
295 | } | 295 | } |
296 | public void BOOLAND() | 296 | public void BOOLAND() |
297 | { | 297 | { |
298 | Common.SendToDebug("::BOOLAND"); | 298 | Common.SendToDebug("::BOOLAND"); |
299 | bool b2 = bool.Parse((string)LSLStack.Pop()); | 299 | bool b2 = bool.Parse((string)LSLStack.Pop()); |
300 | bool b1 = bool.Parse((string)LSLStack.Pop()); | 300 | bool b1 = bool.Parse((string)LSLStack.Pop()); |
301 | if (b1 && b2) | 301 | if (b1 && b2) |
302 | { | 302 | { |
303 | LSLStack.Push((UInt32)1); | 303 | LSLStack.Push((UInt32)1); |
304 | } | 304 | } |
305 | else | 305 | else |
306 | { | 306 | { |
307 | LSLStack.Push((UInt32)0); | 307 | LSLStack.Push((UInt32)0); |
308 | } | 308 | } |
309 | } | 309 | } |
310 | public void BOOLOR() | 310 | public void BOOLOR() |
311 | { | 311 | { |
312 | Common.SendToDebug("::BOOLOR"); | 312 | Common.SendToDebug("::BOOLOR"); |
313 | bool b2 = bool.Parse((string)LSLStack.Pop()); | 313 | bool b2 = bool.Parse((string)LSLStack.Pop()); |
314 | bool b1 = bool.Parse((string)LSLStack.Pop()); | 314 | bool b1 = bool.Parse((string)LSLStack.Pop()); |
315 | 315 | ||
316 | if (b1 || b2) | 316 | if (b1 || b2) |
317 | { | 317 | { |
318 | LSLStack.Push((UInt32)1); | 318 | LSLStack.Push((UInt32)1); |
319 | } | 319 | } |
320 | else | 320 | else |
321 | { | 321 | { |
322 | LSLStack.Push((UInt32)0); | 322 | LSLStack.Push((UInt32)0); |
323 | } | 323 | } |
324 | 324 | ||
325 | } | 325 | } |
326 | public void NEG(UInt32 Param) | 326 | public void NEG(UInt32 Param) |
327 | { | 327 | { |
328 | Common.SendToDebug("::NEG: " + Param); | 328 | Common.SendToDebug("::NEG: " + Param); |
329 | //UInt32 i2 = (UInt32)LSLStack.Pop(); | 329 | //UInt32 i2 = (UInt32)LSLStack.Pop(); |
330 | UInt32 i1 = (UInt32)LSLStack.Pop(); | 330 | UInt32 i1 = (UInt32)LSLStack.Pop(); |
331 | LSLStack.Push((UInt32)(i1 * -1)); | 331 | LSLStack.Push((UInt32)(i1 * -1)); |
332 | } | 332 | } |
333 | public void BITNOT() | 333 | public void BITNOT() |
334 | { | 334 | { |
335 | //Common.SendToDebug("::BITNOT"); | 335 | //Common.SendToDebug("::BITNOT"); |
336 | //UInt32 i2 = (UInt32)LSLStack.Pop(); | 336 | //UInt32 i2 = (UInt32)LSLStack.Pop(); |
337 | //UInt32 i1 = (UInt32)LSLStack.Pop(); | 337 | //UInt32 i1 = (UInt32)LSLStack.Pop(); |
338 | //LSLStack.Push((UInt32)(i1 / i2)); | 338 | //LSLStack.Push((UInt32)(i1 / i2)); |
339 | } | 339 | } |
340 | public void BOOLNOT() | 340 | public void BOOLNOT() |
341 | { | 341 | { |
342 | //Common.SendToDebug("::BOOLNOT"); | 342 | //Common.SendToDebug("::BOOLNOT"); |
343 | ////UInt32 i2 = (UInt32)LSLStack.Pop(); | 343 | ////UInt32 i2 = (UInt32)LSLStack.Pop(); |
344 | //UInt32 i1 = (UInt32)LSLStack.Pop(); | 344 | //UInt32 i1 = (UInt32)LSLStack.Pop(); |
345 | //LSLStack.Push((UInt32)(i1)); | 345 | //LSLStack.Push((UInt32)(i1)); |
346 | } | 346 | } |
347 | 347 | ||
348 | 348 | ||
349 | } | 349 | } |
350 | } | 350 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_CLRInterface.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_CLRInterface.cs index a59f531..5f01bf5 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_CLRInterface.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_CLRInterface.cs | |||
@@ -1,79 +1,79 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
34 | { | 34 | { |
35 | public class LSL_CLRInterface | 35 | public class LSL_CLRInterface |
36 | { | 36 | { |
37 | public interface LSLScript | 37 | public interface LSLScript |
38 | { | 38 | { |
39 | //public virtual void Run(object arg) | 39 | //public virtual void Run(object arg) |
40 | //{ | 40 | //{ |
41 | //} | 41 | //} |
42 | //void Run(object arg); | 42 | //void Run(object arg); |
43 | 43 | ||
44 | //void event_state_entry(object arg); | 44 | //void event_state_entry(object arg); |
45 | //void event_state_exit(); | 45 | //void event_state_exit(); |
46 | //void event_touch_start(object arg); | 46 | //void event_touch_start(object arg); |
47 | //void event_touch(); | 47 | //void event_touch(); |
48 | //void event_touch_end(); | 48 | //void event_touch_end(); |
49 | //void event_collision_start(); | 49 | //void event_collision_start(); |
50 | //void event_collision(); | 50 | //void event_collision(); |
51 | //void event_collision_end(); | 51 | //void event_collision_end(); |
52 | //void event_land_collision_start(); | 52 | //void event_land_collision_start(); |
53 | //void event_land_collision(); | 53 | //void event_land_collision(); |
54 | //void event_land_collision_end(); | 54 | //void event_land_collision_end(); |
55 | //void event_timer(); | 55 | //void event_timer(); |
56 | //void event_listen(); | 56 | //void event_listen(); |
57 | //void event_on_rez(); | 57 | //void event_on_rez(); |
58 | //void event_sensor(); | 58 | //void event_sensor(); |
59 | //void event_no_sensor(); | 59 | //void event_no_sensor(); |
60 | //void event_control(); | 60 | //void event_control(); |
61 | //void event_money(); | 61 | //void event_money(); |
62 | //void event_email(); | 62 | //void event_email(); |
63 | //void event_at_target(); | 63 | //void event_at_target(); |
64 | //void event_not_at_target(); | 64 | //void event_not_at_target(); |
65 | //void event_at_rot_target(); | 65 | //void event_at_rot_target(); |
66 | //void event_not_at_rot_target(); | 66 | //void event_not_at_rot_target(); |
67 | //void event_run_time_permissions(); | 67 | //void event_run_time_permissions(); |
68 | //void event_changed(); | 68 | //void event_changed(); |
69 | //void event_attach(); | 69 | //void event_attach(); |
70 | //void event_dataserver(); | 70 | //void event_dataserver(); |
71 | //void event_link_message(); | 71 | //void event_link_message(); |
72 | //void event_moving_start(); | 72 | //void event_moving_start(); |
73 | //void event_moving_end(); | 73 | //void event_moving_end(); |
74 | //void event_object_rez(); | 74 | //void event_object_rez(); |
75 | //void event_remote_data(); | 75 | //void event_remote_data(); |
76 | //void event_http_response(); | 76 | //void event_http_response(); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | } | 79 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_OPCODE_IL_processor.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_OPCODE_IL_processor.cs index d8ce6c1..ee166a6 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_OPCODE_IL_processor.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSL_OPCODE_IL_processor.cs | |||
@@ -1,436 +1,436 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Reflection.Emit; | 33 | using System.Reflection.Emit; |
34 | using OpenSim.Region.ScriptEngine.Common; | 34 | using OpenSim.Region.ScriptEngine.Common; |
35 | 35 | ||
36 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 36 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
37 | { | 37 | { |
38 | partial class LSO_Parser | 38 | partial class LSO_Parser |
39 | { | 39 | { |
40 | //internal Stack<Type> ILStack = new Stack<Type>(); | 40 | //internal Stack<Type> ILStack = new Stack<Type>(); |
41 | //LSO_Enums MyLSO_Enums = new LSO_Enums(); | 41 | //LSO_Enums MyLSO_Enums = new LSO_Enums(); |
42 | 42 | ||
43 | internal bool LSL_PROCESS_OPCODE(ILGenerator il) | 43 | internal bool LSL_PROCESS_OPCODE(ILGenerator il) |
44 | { | 44 | { |
45 | 45 | ||
46 | byte bp1; | 46 | byte bp1; |
47 | UInt32 u32p1; | 47 | UInt32 u32p1; |
48 | float fp1; | 48 | float fp1; |
49 | UInt16 opcode = br_read(1)[0]; | 49 | UInt16 opcode = br_read(1)[0]; |
50 | Common.SendToDebug("OPCODE: " + ((LSO_Enums.Operation_Table)opcode).ToString()); | 50 | Common.SendToDebug("OPCODE: " + ((LSO_Enums.Operation_Table)opcode).ToString()); |
51 | string idesc = ((LSO_Enums.Operation_Table)opcode).ToString(); | 51 | string idesc = ((LSO_Enums.Operation_Table)opcode).ToString(); |
52 | switch ((LSO_Enums.Operation_Table)opcode) | 52 | switch ((LSO_Enums.Operation_Table)opcode) |
53 | { | 53 | { |
54 | 54 | ||
55 | /*************** | 55 | /*************** |
56 | * IMPLEMENTED * | 56 | * IMPLEMENTED * |
57 | ***************/ | 57 | ***************/ |
58 | case LSO_Enums.Operation_Table.NOOP: | 58 | case LSO_Enums.Operation_Table.NOOP: |
59 | break; | 59 | break; |
60 | case LSO_Enums.Operation_Table.PUSHSP: | 60 | case LSO_Enums.Operation_Table.PUSHSP: |
61 | // Push Stack Top (Memory Address) to stack | 61 | // Push Stack Top (Memory Address) to stack |
62 | Common.SendToDebug("Instruction " + idesc); | 62 | Common.SendToDebug("Instruction " + idesc); |
63 | Common.SendToDebug("Instruction " + idesc + ": Description: Pushing Stack Top (Memory Address from header) to stack"); | 63 | Common.SendToDebug("Instruction " + idesc + ": Description: Pushing Stack Top (Memory Address from header) to stack"); |
64 | IL_Push(il, (UInt32)myHeader.SP); | 64 | IL_Push(il, (UInt32)myHeader.SP); |
65 | break; | 65 | break; |
66 | // BYTE | 66 | // BYTE |
67 | case LSO_Enums.Operation_Table.PUSHARGB: | 67 | case LSO_Enums.Operation_Table.PUSHARGB: |
68 | Common.SendToDebug("Param1: " + br_read(1)[0]); | 68 | Common.SendToDebug("Param1: " + br_read(1)[0]); |
69 | break; | 69 | break; |
70 | // INTEGER | 70 | // INTEGER |
71 | case LSO_Enums.Operation_Table.PUSHARGI: | 71 | case LSO_Enums.Operation_Table.PUSHARGI: |
72 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 72 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
73 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + u32p1); | 73 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + u32p1); |
74 | IL_Push(il, u32p1); | 74 | IL_Push(il, u32p1); |
75 | break; | 75 | break; |
76 | // FLOAT | 76 | // FLOAT |
77 | case LSO_Enums.Operation_Table.PUSHARGF: | 77 | case LSO_Enums.Operation_Table.PUSHARGF: |
78 | fp1 = BitConverter.ToUInt32(br_read(4), 0); | 78 | fp1 = BitConverter.ToUInt32(br_read(4), 0); |
79 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + fp1); | 79 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + fp1); |
80 | IL_Push(il, fp1); | 80 | IL_Push(il, fp1); |
81 | break; | 81 | break; |
82 | // STRING | 82 | // STRING |
83 | case LSO_Enums.Operation_Table.PUSHARGS: | 83 | case LSO_Enums.Operation_Table.PUSHARGS: |
84 | string s = Read_String(); | 84 | string s = Read_String(); |
85 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + s); | 85 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + s); |
86 | IL_Debug(il, "OPCODE: " + idesc + ":" + s); | 86 | IL_Debug(il, "OPCODE: " + idesc + ":" + s); |
87 | IL_Push(il, s); | 87 | IL_Push(il, s); |
88 | break; | 88 | break; |
89 | // VECTOR z,y,x | 89 | // VECTOR z,y,x |
90 | case LSO_Enums.Operation_Table.PUSHARGV: | 90 | case LSO_Enums.Operation_Table.PUSHARGV: |
91 | LSO_Enums.Vector v = new LSO_Enums.Vector(); | 91 | LSO_Enums.Vector v = new LSO_Enums.Vector(); |
92 | v.Z = BitConverter.ToUInt32(br_read(4), 0); | 92 | v.Z = BitConverter.ToUInt32(br_read(4), 0); |
93 | v.Y = BitConverter.ToUInt32(br_read(4), 0); | 93 | v.Y = BitConverter.ToUInt32(br_read(4), 0); |
94 | v.X = BitConverter.ToUInt32(br_read(4), 0); | 94 | v.X = BitConverter.ToUInt32(br_read(4), 0); |
95 | Common.SendToDebug("Param1 Z: " + v.Z); | 95 | Common.SendToDebug("Param1 Z: " + v.Z); |
96 | Common.SendToDebug("Param1 Y: " + v.Y); | 96 | Common.SendToDebug("Param1 Y: " + v.Y); |
97 | Common.SendToDebug("Param1 X: " + v.X); | 97 | Common.SendToDebug("Param1 X: " + v.X); |
98 | IL_Push(il, v); | 98 | IL_Push(il, v); |
99 | break; | 99 | break; |
100 | // ROTATION s,z,y,x | 100 | // ROTATION s,z,y,x |
101 | case LSO_Enums.Operation_Table.PUSHARGQ: | 101 | case LSO_Enums.Operation_Table.PUSHARGQ: |
102 | LSO_Enums.Rotation r = new LSO_Enums.Rotation(); | 102 | LSO_Enums.Rotation r = new LSO_Enums.Rotation(); |
103 | r.S = BitConverter.ToUInt32(br_read(4), 0); | 103 | r.S = BitConverter.ToUInt32(br_read(4), 0); |
104 | r.Z = BitConverter.ToUInt32(br_read(4), 0); | 104 | r.Z = BitConverter.ToUInt32(br_read(4), 0); |
105 | r.Y = BitConverter.ToUInt32(br_read(4), 0); | 105 | r.Y = BitConverter.ToUInt32(br_read(4), 0); |
106 | r.X = BitConverter.ToUInt32(br_read(4), 0); | 106 | r.X = BitConverter.ToUInt32(br_read(4), 0); |
107 | Common.SendToDebug("Param1 S: " + r.S); | 107 | Common.SendToDebug("Param1 S: " + r.S); |
108 | Common.SendToDebug("Param1 Z: " + r.Z); | 108 | Common.SendToDebug("Param1 Z: " + r.Z); |
109 | Common.SendToDebug("Param1 Y: " + r.Y); | 109 | Common.SendToDebug("Param1 Y: " + r.Y); |
110 | Common.SendToDebug("Param1 X: " + r.X); | 110 | Common.SendToDebug("Param1 X: " + r.X); |
111 | IL_Push(il, r); | 111 | IL_Push(il, r); |
112 | break; | 112 | break; |
113 | 113 | ||
114 | case LSO_Enums.Operation_Table.PUSHE: | 114 | case LSO_Enums.Operation_Table.PUSHE: |
115 | IL_Push(il, (UInt32)0); | 115 | IL_Push(il, (UInt32)0); |
116 | break; | 116 | break; |
117 | 117 | ||
118 | case LSO_Enums.Operation_Table.PUSHARGE: | 118 | case LSO_Enums.Operation_Table.PUSHARGE: |
119 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 119 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
120 | Common.SendToDebug("Param1: " + u32p1); | 120 | Common.SendToDebug("Param1: " + u32p1); |
121 | //IL_Push(il, new string(" ".ToCharArray()[0], Convert.ToInt32(u32p1))); | 121 | //IL_Push(il, new string(" ".ToCharArray()[0], Convert.ToInt32(u32p1))); |
122 | IL_Push(il, u32p1); | 122 | IL_Push(il, u32p1); |
123 | break; | 123 | break; |
124 | // BYTE | 124 | // BYTE |
125 | case LSO_Enums.Operation_Table.ADD: | 125 | case LSO_Enums.Operation_Table.ADD: |
126 | case LSO_Enums.Operation_Table.SUB: | 126 | case LSO_Enums.Operation_Table.SUB: |
127 | case LSO_Enums.Operation_Table.MUL: | 127 | case LSO_Enums.Operation_Table.MUL: |
128 | case LSO_Enums.Operation_Table.DIV: | 128 | case LSO_Enums.Operation_Table.DIV: |
129 | case LSO_Enums.Operation_Table.EQ: | 129 | case LSO_Enums.Operation_Table.EQ: |
130 | case LSO_Enums.Operation_Table.NEQ: | 130 | case LSO_Enums.Operation_Table.NEQ: |
131 | case LSO_Enums.Operation_Table.LEQ: | 131 | case LSO_Enums.Operation_Table.LEQ: |
132 | case LSO_Enums.Operation_Table.GEQ: | 132 | case LSO_Enums.Operation_Table.GEQ: |
133 | case LSO_Enums.Operation_Table.LESS: | 133 | case LSO_Enums.Operation_Table.LESS: |
134 | case LSO_Enums.Operation_Table.GREATER: | 134 | case LSO_Enums.Operation_Table.GREATER: |
135 | case LSO_Enums.Operation_Table.NEG: | 135 | case LSO_Enums.Operation_Table.NEG: |
136 | case LSO_Enums.Operation_Table.MOD: | 136 | case LSO_Enums.Operation_Table.MOD: |
137 | bp1 = br_read(1)[0]; | 137 | bp1 = br_read(1)[0]; |
138 | Common.SendToDebug("Param1: " + bp1); | 138 | Common.SendToDebug("Param1: " + bp1); |
139 | IL_CallBaseFunction(il, idesc, (UInt32)bp1); | 139 | IL_CallBaseFunction(il, idesc, (UInt32)bp1); |
140 | break; | 140 | break; |
141 | 141 | ||
142 | // NO ARGUMENTS | 142 | // NO ARGUMENTS |
143 | case LSO_Enums.Operation_Table.BITAND: | 143 | case LSO_Enums.Operation_Table.BITAND: |
144 | case LSO_Enums.Operation_Table.BITOR: | 144 | case LSO_Enums.Operation_Table.BITOR: |
145 | case LSO_Enums.Operation_Table.BITXOR: | 145 | case LSO_Enums.Operation_Table.BITXOR: |
146 | case LSO_Enums.Operation_Table.BOOLAND: | 146 | case LSO_Enums.Operation_Table.BOOLAND: |
147 | case LSO_Enums.Operation_Table.BOOLOR: | 147 | case LSO_Enums.Operation_Table.BOOLOR: |
148 | case LSO_Enums.Operation_Table.BITNOT: | 148 | case LSO_Enums.Operation_Table.BITNOT: |
149 | case LSO_Enums.Operation_Table.BOOLNOT: | 149 | case LSO_Enums.Operation_Table.BOOLNOT: |
150 | IL_CallBaseFunction(il, idesc); | 150 | IL_CallBaseFunction(il, idesc); |
151 | break; | 151 | break; |
152 | // SHORT | 152 | // SHORT |
153 | case LSO_Enums.Operation_Table.CALLLIB_TWO_BYTE: | 153 | case LSO_Enums.Operation_Table.CALLLIB_TWO_BYTE: |
154 | // TODO: What is size of short? | 154 | // TODO: What is size of short? |
155 | UInt16 U16p1 = BitConverter.ToUInt16(br_read(2), 0); | 155 | UInt16 U16p1 = BitConverter.ToUInt16(br_read(2), 0); |
156 | Common.SendToDebug("Instruction " + idesc + ": Builtin Command: " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString()); | 156 | Common.SendToDebug("Instruction " + idesc + ": Builtin Command: " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString()); |
157 | //Common.SendToDebug("Param1: " + U16p1); | 157 | //Common.SendToDebug("Param1: " + U16p1); |
158 | string fname = ((LSO_Enums.BuiltIn_Functions)U16p1).ToString(); | 158 | string fname = ((LSO_Enums.BuiltIn_Functions)U16p1).ToString(); |
159 | 159 | ||
160 | bool cmdFound = false; | 160 | bool cmdFound = false; |
161 | foreach (MethodInfo mi in typeof(LSL_BuiltIn_Commands_Interface).GetMethods()) | 161 | foreach (MethodInfo mi in typeof(LSL_BuiltIn_Commands_Interface).GetMethods()) |
162 | { | 162 | { |
163 | // Found command | 163 | // Found command |
164 | if (mi.Name == fname) | 164 | if (mi.Name == fname) |
165 | { | 165 | { |
166 | il.Emit(OpCodes.Ldarg_0); | 166 | il.Emit(OpCodes.Ldarg_0); |
167 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("GetLSL_BuiltIn", new Type[] { })); | 167 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("GetLSL_BuiltIn", new Type[] { })); |
168 | // Pop required number of items from my stack to .Net stack | 168 | // Pop required number of items from my stack to .Net stack |
169 | IL_PopToStack(il, mi.GetParameters().Length); | 169 | IL_PopToStack(il, mi.GetParameters().Length); |
170 | il.Emit(OpCodes.Callvirt, mi); | 170 | il.Emit(OpCodes.Callvirt, mi); |
171 | cmdFound = true; | 171 | cmdFound = true; |
172 | break; | 172 | break; |
173 | } | 173 | } |
174 | } | 174 | } |
175 | if (cmdFound == false) | 175 | if (cmdFound == false) |
176 | { | 176 | { |
177 | Common.SendToDebug("ERROR: UNABLE TO LOCATE OPCODE " + idesc + " IN BASECLASS"); | 177 | Common.SendToDebug("ERROR: UNABLE TO LOCATE OPCODE " + idesc + " IN BASECLASS"); |
178 | } | 178 | } |
179 | 179 | ||
180 | break; | 180 | break; |
181 | 181 | ||
182 | // RETURN | 182 | // RETURN |
183 | case LSO_Enums.Operation_Table.RETURN: | 183 | case LSO_Enums.Operation_Table.RETURN: |
184 | 184 | ||
185 | Common.SendToDebug("OPCODE: RETURN"); | 185 | Common.SendToDebug("OPCODE: RETURN"); |
186 | return true; | 186 | return true; |
187 | 187 | ||
188 | case LSO_Enums.Operation_Table.POP: | 188 | case LSO_Enums.Operation_Table.POP: |
189 | case LSO_Enums.Operation_Table.POPS: | 189 | case LSO_Enums.Operation_Table.POPS: |
190 | case LSO_Enums.Operation_Table.POPL: | 190 | case LSO_Enums.Operation_Table.POPL: |
191 | case LSO_Enums.Operation_Table.POPV: | 191 | case LSO_Enums.Operation_Table.POPV: |
192 | case LSO_Enums.Operation_Table.POPQ: | 192 | case LSO_Enums.Operation_Table.POPQ: |
193 | // Pops a specific datatype from the stack | 193 | // Pops a specific datatype from the stack |
194 | // We just ignore the datatype for now | 194 | // We just ignore the datatype for now |
195 | IL_Pop(il); | 195 | IL_Pop(il); |
196 | break; | 196 | break; |
197 | 197 | ||
198 | // LONG | 198 | // LONG |
199 | case LSO_Enums.Operation_Table.STORE: | 199 | case LSO_Enums.Operation_Table.STORE: |
200 | case LSO_Enums.Operation_Table.STORES: | 200 | case LSO_Enums.Operation_Table.STORES: |
201 | case LSO_Enums.Operation_Table.STOREL: | 201 | case LSO_Enums.Operation_Table.STOREL: |
202 | case LSO_Enums.Operation_Table.STOREV: | 202 | case LSO_Enums.Operation_Table.STOREV: |
203 | case LSO_Enums.Operation_Table.STOREQ: | 203 | case LSO_Enums.Operation_Table.STOREQ: |
204 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 204 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
205 | Common.SendToDebug("Param1: " + u32p1.ToString()); | 205 | Common.SendToDebug("Param1: " + u32p1.ToString()); |
206 | IL_CallBaseFunction(il, "StoreToLocal", u32p1); | 206 | IL_CallBaseFunction(il, "StoreToLocal", u32p1); |
207 | break; | 207 | break; |
208 | 208 | ||
209 | case LSO_Enums.Operation_Table.STOREG: | 209 | case LSO_Enums.Operation_Table.STOREG: |
210 | case LSO_Enums.Operation_Table.STOREGS: | 210 | case LSO_Enums.Operation_Table.STOREGS: |
211 | case LSO_Enums.Operation_Table.STOREGL: | 211 | case LSO_Enums.Operation_Table.STOREGL: |
212 | case LSO_Enums.Operation_Table.STOREGV: | 212 | case LSO_Enums.Operation_Table.STOREGV: |
213 | case LSO_Enums.Operation_Table.STOREGQ: | 213 | case LSO_Enums.Operation_Table.STOREGQ: |
214 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 214 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
215 | Common.SendToDebug("Param1: " + u32p1.ToString()); | 215 | Common.SendToDebug("Param1: " + u32p1.ToString()); |
216 | IL_CallBaseFunction(il, "StoreToGlobal", u32p1); | 216 | IL_CallBaseFunction(il, "StoreToGlobal", u32p1); |
217 | break; | 217 | break; |
218 | 218 | ||
219 | case LSO_Enums.Operation_Table.LOADP: | 219 | case LSO_Enums.Operation_Table.LOADP: |
220 | case LSO_Enums.Operation_Table.LOADSP: | 220 | case LSO_Enums.Operation_Table.LOADSP: |
221 | case LSO_Enums.Operation_Table.LOADLP: | 221 | case LSO_Enums.Operation_Table.LOADLP: |
222 | case LSO_Enums.Operation_Table.LOADVP: | 222 | case LSO_Enums.Operation_Table.LOADVP: |
223 | case LSO_Enums.Operation_Table.LOADQP: | 223 | case LSO_Enums.Operation_Table.LOADQP: |
224 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 224 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
225 | Common.SendToDebug("Param1: " + u32p1.ToString()); | 225 | Common.SendToDebug("Param1: " + u32p1.ToString()); |
226 | IL_CallBaseFunction(il, "StoreToLocal", u32p1); | 226 | IL_CallBaseFunction(il, "StoreToLocal", u32p1); |
227 | IL_Pop(il); | 227 | IL_Pop(il); |
228 | break; | 228 | break; |
229 | 229 | ||
230 | case LSO_Enums.Operation_Table.LOADGP: | 230 | case LSO_Enums.Operation_Table.LOADGP: |
231 | case LSO_Enums.Operation_Table.LOADGSP: | 231 | case LSO_Enums.Operation_Table.LOADGSP: |
232 | case LSO_Enums.Operation_Table.LOADGLP: | 232 | case LSO_Enums.Operation_Table.LOADGLP: |
233 | case LSO_Enums.Operation_Table.LOADGVP: | 233 | case LSO_Enums.Operation_Table.LOADGVP: |
234 | case LSO_Enums.Operation_Table.LOADGQP: | 234 | case LSO_Enums.Operation_Table.LOADGQP: |
235 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 235 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
236 | Common.SendToDebug("Param1: " + u32p1.ToString()); | 236 | Common.SendToDebug("Param1: " + u32p1.ToString()); |
237 | IL_CallBaseFunction(il, "StoreToStatic", u32p1 - 6 + myHeader.GVR); | 237 | IL_CallBaseFunction(il, "StoreToStatic", u32p1 - 6 + myHeader.GVR); |
238 | IL_Pop(il); | 238 | IL_Pop(il); |
239 | break; | 239 | break; |
240 | 240 | ||
241 | // PUSH FROM LOCAL FRAME | 241 | // PUSH FROM LOCAL FRAME |
242 | case LSO_Enums.Operation_Table.PUSH: | 242 | case LSO_Enums.Operation_Table.PUSH: |
243 | case LSO_Enums.Operation_Table.PUSHS: | 243 | case LSO_Enums.Operation_Table.PUSHS: |
244 | case LSO_Enums.Operation_Table.PUSHL: | 244 | case LSO_Enums.Operation_Table.PUSHL: |
245 | case LSO_Enums.Operation_Table.PUSHV: | 245 | case LSO_Enums.Operation_Table.PUSHV: |
246 | case LSO_Enums.Operation_Table.PUSHQ: | 246 | case LSO_Enums.Operation_Table.PUSHQ: |
247 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 247 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
248 | Common.SendToDebug("Param1: " + u32p1.ToString()); | 248 | Common.SendToDebug("Param1: " + u32p1.ToString()); |
249 | IL_CallBaseFunction(il, "GetFromLocal", u32p1); | 249 | IL_CallBaseFunction(il, "GetFromLocal", u32p1); |
250 | 250 | ||
251 | break; | 251 | break; |
252 | 252 | ||
253 | // PUSH FROM STATIC FRAME | 253 | // PUSH FROM STATIC FRAME |
254 | case LSO_Enums.Operation_Table.PUSHG: | 254 | case LSO_Enums.Operation_Table.PUSHG: |
255 | case LSO_Enums.Operation_Table.PUSHGS: | 255 | case LSO_Enums.Operation_Table.PUSHGS: |
256 | case LSO_Enums.Operation_Table.PUSHGL: | 256 | case LSO_Enums.Operation_Table.PUSHGL: |
257 | case LSO_Enums.Operation_Table.PUSHGV: | 257 | case LSO_Enums.Operation_Table.PUSHGV: |
258 | case LSO_Enums.Operation_Table.PUSHGQ: | 258 | case LSO_Enums.Operation_Table.PUSHGQ: |
259 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | 259 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); |
260 | Common.SendToDebug("Param1: " + u32p1.ToString()); | 260 | Common.SendToDebug("Param1: " + u32p1.ToString()); |
261 | IL_CallBaseFunction(il, "GetFromStatic", u32p1 - 6 + myHeader.GVR); | 261 | IL_CallBaseFunction(il, "GetFromStatic", u32p1 - 6 + myHeader.GVR); |
262 | break; | 262 | break; |
263 | 263 | ||
264 | 264 | ||
265 | /*********************** | 265 | /*********************** |
266 | * NOT IMPLEMENTED YET * | 266 | * NOT IMPLEMENTED YET * |
267 | ***********************/ | 267 | ***********************/ |
268 | 268 | ||
269 | 269 | ||
270 | 270 | ||
271 | case LSO_Enums.Operation_Table.POPIP: | 271 | case LSO_Enums.Operation_Table.POPIP: |
272 | case LSO_Enums.Operation_Table.POPSP: | 272 | case LSO_Enums.Operation_Table.POPSP: |
273 | case LSO_Enums.Operation_Table.POPSLR: | 273 | case LSO_Enums.Operation_Table.POPSLR: |
274 | case LSO_Enums.Operation_Table.POPARG: | 274 | case LSO_Enums.Operation_Table.POPARG: |
275 | case LSO_Enums.Operation_Table.POPBP: | 275 | case LSO_Enums.Operation_Table.POPBP: |
276 | //Common.SendToDebug("Instruction " + idesc + ": Ignored"); | 276 | //Common.SendToDebug("Instruction " + idesc + ": Ignored"); |
277 | Common.SendToDebug("Instruction " + idesc + ": Description: Drop x bytes from the stack (TODO: Only popping 1)"); | 277 | Common.SendToDebug("Instruction " + idesc + ": Description: Drop x bytes from the stack (TODO: Only popping 1)"); |
278 | //Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | 278 | //Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); |
279 | IL_Pop(il); | 279 | IL_Pop(il); |
280 | break; | 280 | break; |
281 | 281 | ||
282 | 282 | ||
283 | 283 | ||
284 | // None | 284 | // None |
285 | case LSO_Enums.Operation_Table.PUSHIP: | 285 | case LSO_Enums.Operation_Table.PUSHIP: |
286 | // PUSH INSTRUCTION POINTER | 286 | // PUSH INSTRUCTION POINTER |
287 | break; | 287 | break; |
288 | case LSO_Enums.Operation_Table.PUSHBP: | 288 | case LSO_Enums.Operation_Table.PUSHBP: |
289 | 289 | ||
290 | case LSO_Enums.Operation_Table.PUSHEV: | 290 | case LSO_Enums.Operation_Table.PUSHEV: |
291 | break; | 291 | break; |
292 | case LSO_Enums.Operation_Table.PUSHEQ: | 292 | case LSO_Enums.Operation_Table.PUSHEQ: |
293 | break; | 293 | break; |
294 | 294 | ||
295 | 295 | ||
296 | // LONG | 296 | // LONG |
297 | case LSO_Enums.Operation_Table.JUMP: | 297 | case LSO_Enums.Operation_Table.JUMP: |
298 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | 298 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); |
299 | break; | 299 | break; |
300 | // BYTE, LONG | 300 | // BYTE, LONG |
301 | case LSO_Enums.Operation_Table.JUMPIF: | 301 | case LSO_Enums.Operation_Table.JUMPIF: |
302 | case LSO_Enums.Operation_Table.JUMPNIF: | 302 | case LSO_Enums.Operation_Table.JUMPNIF: |
303 | Common.SendToDebug("Param1: " + br_read(1)[0]); | 303 | Common.SendToDebug("Param1: " + br_read(1)[0]); |
304 | Common.SendToDebug("Param2: " + BitConverter.ToUInt32(br_read(4), 0)); | 304 | Common.SendToDebug("Param2: " + BitConverter.ToUInt32(br_read(4), 0)); |
305 | break; | 305 | break; |
306 | // LONG | 306 | // LONG |
307 | case LSO_Enums.Operation_Table.STATE: | 307 | case LSO_Enums.Operation_Table.STATE: |
308 | bp1 = br_read(1)[0]; | 308 | bp1 = br_read(1)[0]; |
309 | //il.Emit(OpCodes.Ld); // Load local variable 0 onto stack | 309 | //il.Emit(OpCodes.Ld); // Load local variable 0 onto stack |
310 | //il.Emit(OpCodes.Ldc_I4, 0); // Push index position | 310 | //il.Emit(OpCodes.Ldc_I4, 0); // Push index position |
311 | //il.Emit(OpCodes.Ldstr, EventList[p1]); // Push value | 311 | //il.Emit(OpCodes.Ldstr, EventList[p1]); // Push value |
312 | //il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value | 312 | //il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value |
313 | break; | 313 | break; |
314 | case LSO_Enums.Operation_Table.CALL: | 314 | case LSO_Enums.Operation_Table.CALL: |
315 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | 315 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); |
316 | Common.SendToDebug("ERROR: Function CALL not implemented yet."); | 316 | Common.SendToDebug("ERROR: Function CALL not implemented yet."); |
317 | break; | 317 | break; |
318 | // BYTE | 318 | // BYTE |
319 | case LSO_Enums.Operation_Table.CAST: | 319 | case LSO_Enums.Operation_Table.CAST: |
320 | bp1 = br_read(1)[0]; | 320 | bp1 = br_read(1)[0]; |
321 | Common.SendToDebug("Instruction " + idesc + ": Cast to type: " + ((LSO_Enums.OpCode_Cast_TypeDefs)bp1)); | 321 | Common.SendToDebug("Instruction " + idesc + ": Cast to type: " + ((LSO_Enums.OpCode_Cast_TypeDefs)bp1)); |
322 | Common.SendToDebug("Param1: " + bp1); | 322 | Common.SendToDebug("Param1: " + bp1); |
323 | switch ((LSO_Enums.OpCode_Cast_TypeDefs)bp1) | 323 | switch ((LSO_Enums.OpCode_Cast_TypeDefs)bp1) |
324 | { | 324 | { |
325 | case LSO_Enums.OpCode_Cast_TypeDefs.String: | 325 | case LSO_Enums.OpCode_Cast_TypeDefs.String: |
326 | Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Box, ILStack.Pop());"); | 326 | Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Box, ILStack.Pop());"); |
327 | break; | 327 | break; |
328 | default: | 328 | default: |
329 | Common.SendToDebug("Instruction " + idesc + ": Unknown cast type!"); | 329 | Common.SendToDebug("Instruction " + idesc + ": Unknown cast type!"); |
330 | break; | 330 | break; |
331 | } | 331 | } |
332 | break; | 332 | break; |
333 | // LONG | 333 | // LONG |
334 | case LSO_Enums.Operation_Table.STACKTOS: | 334 | case LSO_Enums.Operation_Table.STACKTOS: |
335 | case LSO_Enums.Operation_Table.STACKTOL: | 335 | case LSO_Enums.Operation_Table.STACKTOL: |
336 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | 336 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); |
337 | break; | 337 | break; |
338 | // BYTE | 338 | // BYTE |
339 | case LSO_Enums.Operation_Table.PRINT: | 339 | case LSO_Enums.Operation_Table.PRINT: |
340 | case LSO_Enums.Operation_Table.CALLLIB: | 340 | case LSO_Enums.Operation_Table.CALLLIB: |
341 | Common.SendToDebug("Param1: " + br_read(1)[0]); | 341 | Common.SendToDebug("Param1: " + br_read(1)[0]); |
342 | break; | 342 | break; |
343 | } | 343 | } |
344 | return false; | 344 | return false; |
345 | } | 345 | } |
346 | 346 | ||
347 | private void IL_PopToStack(ILGenerator il) | 347 | private void IL_PopToStack(ILGenerator il) |
348 | { | 348 | { |
349 | IL_PopToStack(il, 1); | 349 | IL_PopToStack(il, 1); |
350 | } | 350 | } |
351 | private void IL_PopToStack(ILGenerator il, int count) | 351 | private void IL_PopToStack(ILGenerator il, int count) |
352 | { | 352 | { |
353 | Common.SendToDebug("IL_PopToStack();"); | 353 | Common.SendToDebug("IL_PopToStack();"); |
354 | for (int i = 0; i < count; i++) | 354 | for (int i = 0; i < count; i++) |
355 | { | 355 | { |
356 | IL_CallBaseFunction(il, "POPToStack"); | 356 | IL_CallBaseFunction(il, "POPToStack"); |
357 | //il.Emit(OpCodes.Ldarg_0); | 357 | //il.Emit(OpCodes.Ldarg_0); |
358 | //il.Emit(OpCodes.Call, | 358 | //il.Emit(OpCodes.Call, |
359 | // typeof(LSL_BaseClass).GetMethod("POPToStack", | 359 | // typeof(LSL_BaseClass).GetMethod("POPToStack", |
360 | // new Type[] { })); | 360 | // new Type[] { })); |
361 | } | 361 | } |
362 | } | 362 | } |
363 | private void IL_Pop(ILGenerator il) | 363 | private void IL_Pop(ILGenerator il) |
364 | { | 364 | { |
365 | Common.SendToDebug("IL_Pop();"); | 365 | Common.SendToDebug("IL_Pop();"); |
366 | IL_CallBaseFunction(il, "POP"); | 366 | IL_CallBaseFunction(il, "POP"); |
367 | } | 367 | } |
368 | private void IL_Debug(ILGenerator il, string text) | 368 | private void IL_Debug(ILGenerator il, string text) |
369 | { | 369 | { |
370 | il.Emit(OpCodes.Ldstr, text); | 370 | il.Emit(OpCodes.Ldstr, text); |
371 | il.Emit(OpCodes.Call, typeof(Common).GetMethod("SendToDebug", | 371 | il.Emit(OpCodes.Call, typeof(Common).GetMethod("SendToDebug", |
372 | new Type[] { typeof(string) } | 372 | new Type[] { typeof(string) } |
373 | )); | 373 | )); |
374 | } | 374 | } |
375 | private void IL_CallBaseFunction(ILGenerator il, string methodname) | 375 | private void IL_CallBaseFunction(ILGenerator il, string methodname) |
376 | { | 376 | { |
377 | il.Emit(OpCodes.Ldarg_0); | 377 | il.Emit(OpCodes.Ldarg_0); |
378 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod(methodname, new Type[] { })); | 378 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod(methodname, new Type[] { })); |
379 | } | 379 | } |
380 | private void IL_CallBaseFunction(ILGenerator il, string methodname, object data) | 380 | private void IL_CallBaseFunction(ILGenerator il, string methodname, object data) |
381 | { | 381 | { |
382 | il.Emit(OpCodes.Ldarg_0); | 382 | il.Emit(OpCodes.Ldarg_0); |
383 | if (data.GetType() == typeof(string)) | 383 | if (data.GetType() == typeof(string)) |
384 | il.Emit(OpCodes.Ldstr, (string)data); | 384 | il.Emit(OpCodes.Ldstr, (string)data); |
385 | if (data.GetType() == typeof(UInt32)) | 385 | if (data.GetType() == typeof(UInt32)) |
386 | il.Emit(OpCodes.Ldc_I4, (UInt32)data); | 386 | il.Emit(OpCodes.Ldc_I4, (UInt32)data); |
387 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod(methodname, new Type[] { data.GetType() })); | 387 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod(methodname, new Type[] { data.GetType() })); |
388 | } | 388 | } |
389 | 389 | ||
390 | private void IL_Push(ILGenerator il, object data) | 390 | private void IL_Push(ILGenerator il, object data) |
391 | { | 391 | { |
392 | il.Emit(OpCodes.Ldarg_0); | 392 | il.Emit(OpCodes.Ldarg_0); |
393 | Common.SendToDebug("PUSH datatype: " + data.GetType()); | 393 | Common.SendToDebug("PUSH datatype: " + data.GetType()); |
394 | 394 | ||
395 | IL_PushDataTypeToILStack(il, data); | 395 | IL_PushDataTypeToILStack(il, data); |
396 | 396 | ||
397 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("PUSH", new Type[] { data.GetType() })); | 397 | il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("PUSH", new Type[] { data.GetType() })); |
398 | 398 | ||
399 | } | 399 | } |
400 | 400 | ||
401 | private void IL_PushDataTypeToILStack(ILGenerator il, object data) | 401 | private void IL_PushDataTypeToILStack(ILGenerator il, object data) |
402 | { | 402 | { |
403 | if (data.GetType() == typeof(UInt16)) | 403 | if (data.GetType() == typeof(UInt16)) |
404 | { | 404 | { |
405 | il.Emit(OpCodes.Ldc_I4, (UInt16)data); | 405 | il.Emit(OpCodes.Ldc_I4, (UInt16)data); |
406 | il.Emit(OpCodes.Box, data.GetType()); | 406 | il.Emit(OpCodes.Box, data.GetType()); |
407 | } | 407 | } |
408 | if (data.GetType() == typeof(UInt32)) | 408 | if (data.GetType() == typeof(UInt32)) |
409 | { | 409 | { |
410 | il.Emit(OpCodes.Ldc_I4, (UInt32)data); | 410 | il.Emit(OpCodes.Ldc_I4, (UInt32)data); |
411 | il.Emit(OpCodes.Box, data.GetType()); | 411 | il.Emit(OpCodes.Box, data.GetType()); |
412 | } | 412 | } |
413 | if (data.GetType() == typeof(Int32)) | 413 | if (data.GetType() == typeof(Int32)) |
414 | { | 414 | { |
415 | il.Emit(OpCodes.Ldc_I4, (Int32)data); | 415 | il.Emit(OpCodes.Ldc_I4, (Int32)data); |
416 | il.Emit(OpCodes.Box, data.GetType()); | 416 | il.Emit(OpCodes.Box, data.GetType()); |
417 | } | 417 | } |
418 | if (data.GetType() == typeof(float)) | 418 | if (data.GetType() == typeof(float)) |
419 | { | 419 | { |
420 | il.Emit(OpCodes.Ldc_I4, (float)data); | 420 | il.Emit(OpCodes.Ldc_I4, (float)data); |
421 | il.Emit(OpCodes.Box, data.GetType()); | 421 | il.Emit(OpCodes.Box, data.GetType()); |
422 | } | 422 | } |
423 | if (data.GetType() == typeof(string)) | 423 | if (data.GetType() == typeof(string)) |
424 | il.Emit(OpCodes.Ldstr, (string)data); | 424 | il.Emit(OpCodes.Ldstr, (string)data); |
425 | //if (data.GetType() == typeof(LSO_Enums.Rotation)) | 425 | //if (data.GetType() == typeof(LSO_Enums.Rotation)) |
426 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Rotation)data); | 426 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Rotation)data); |
427 | //if (data.GetType() == typeof(LSO_Enums.Vector)) | 427 | //if (data.GetType() == typeof(LSO_Enums.Vector)) |
428 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Vector)data); | 428 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Vector)data); |
429 | //if (data.GetType() == typeof(LSO_Enums.Key)) | 429 | //if (data.GetType() == typeof(LSO_Enums.Key)) |
430 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Key)data); | 430 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Key)data); |
431 | 431 | ||
432 | } | 432 | } |
433 | 433 | ||
434 | 434 | ||
435 | } | 435 | } |
436 | } | 436 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Enums.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Enums.cs index db666d9..30ce314 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Enums.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Enums.cs | |||
@@ -1,557 +1,557 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
34 | { | 34 | { |
35 | public static class LSO_Enums | 35 | public static class LSO_Enums |
36 | { | 36 | { |
37 | //public System.Collections.Generic.Dictionary<Byte, Type> OpCode_Add_Types; | 37 | //public System.Collections.Generic.Dictionary<Byte, Type> OpCode_Add_Types; |
38 | 38 | ||
39 | //LSO_Enums() { | 39 | //LSO_Enums() { |
40 | // OpCode_Add_Types.Add(51, typeof(String)); | 40 | // OpCode_Add_Types.Add(51, typeof(String)); |
41 | // OpCode_Add_Types.Add(17, typeof(UInt32)); | 41 | // OpCode_Add_Types.Add(17, typeof(UInt32)); |
42 | //} | 42 | //} |
43 | 43 | ||
44 | [Serializable] | 44 | [Serializable] |
45 | public enum OpCode_Add_TypeDefs | 45 | public enum OpCode_Add_TypeDefs |
46 | { | 46 | { |
47 | String = 51, | 47 | String = 51, |
48 | UInt32 = 17 | 48 | UInt32 = 17 |
49 | } | 49 | } |
50 | [Serializable] | 50 | [Serializable] |
51 | public enum OpCode_Cast_TypeDefs | 51 | public enum OpCode_Cast_TypeDefs |
52 | { | 52 | { |
53 | String = 19 | 53 | String = 19 |
54 | } | 54 | } |
55 | 55 | ||
56 | [Serializable] | 56 | [Serializable] |
57 | public struct Key | 57 | public struct Key |
58 | { | 58 | { |
59 | public string KeyString; | 59 | public string KeyString; |
60 | } | 60 | } |
61 | 61 | ||
62 | [Serializable] | 62 | [Serializable] |
63 | public struct Vector | 63 | public struct Vector |
64 | { | 64 | { |
65 | public UInt32 Z; | 65 | public UInt32 Z; |
66 | public UInt32 Y; | 66 | public UInt32 Y; |
67 | public UInt32 X; | 67 | public UInt32 X; |
68 | } | 68 | } |
69 | [Serializable] | 69 | [Serializable] |
70 | public struct Rotation | 70 | public struct Rotation |
71 | { | 71 | { |
72 | public UInt32 S; | 72 | public UInt32 S; |
73 | public UInt32 Z; | 73 | public UInt32 Z; |
74 | public UInt32 Y; | 74 | public UInt32 Y; |
75 | public UInt32 X; | 75 | public UInt32 X; |
76 | } | 76 | } |
77 | [Serializable] | 77 | [Serializable] |
78 | public enum Variable_Type_Codes | 78 | public enum Variable_Type_Codes |
79 | { | 79 | { |
80 | Void = 0, | 80 | Void = 0, |
81 | Integer = 1, | 81 | Integer = 1, |
82 | Float = 2, | 82 | Float = 2, |
83 | String = 3, | 83 | String = 3, |
84 | Key = 4, | 84 | Key = 4, |
85 | Vector = 5, | 85 | Vector = 5, |
86 | Rotation = 6, | 86 | Rotation = 6, |
87 | List = 7, | 87 | List = 7, |
88 | Null = 8 | 88 | Null = 8 |
89 | } | 89 | } |
90 | [Serializable] | 90 | [Serializable] |
91 | public enum Event_Mask_Values | 91 | public enum Event_Mask_Values |
92 | { | 92 | { |
93 | state_entry = 0, | 93 | state_entry = 0, |
94 | state_exit = 1, | 94 | state_exit = 1, |
95 | touch_start = 2, | 95 | touch_start = 2, |
96 | touch = 3, | 96 | touch = 3, |
97 | touch_end = 4, | 97 | touch_end = 4, |
98 | collision_start = 5, | 98 | collision_start = 5, |
99 | collision = 6, | 99 | collision = 6, |
100 | collision_end = 7, | 100 | collision_end = 7, |
101 | land_collision_start = 8, | 101 | land_collision_start = 8, |
102 | land_collision = 9, | 102 | land_collision = 9, |
103 | land_collision_end = 10, | 103 | land_collision_end = 10, |
104 | timer = 11, | 104 | timer = 11, |
105 | listen = 12, | 105 | listen = 12, |
106 | on_rez = 13, | 106 | on_rez = 13, |
107 | sensor = 14, | 107 | sensor = 14, |
108 | no_sensor = 15, | 108 | no_sensor = 15, |
109 | control = 16, | 109 | control = 16, |
110 | money = 17, | 110 | money = 17, |
111 | email = 18, | 111 | email = 18, |
112 | at_target = 19, | 112 | at_target = 19, |
113 | not_at_target = 20, | 113 | not_at_target = 20, |
114 | at_rot_target = 21, | 114 | at_rot_target = 21, |
115 | not_at_rot_target = 22, | 115 | not_at_rot_target = 22, |
116 | run_time_permissions = 23, | 116 | run_time_permissions = 23, |
117 | changed = 24, | 117 | changed = 24, |
118 | attach = 25, | 118 | attach = 25, |
119 | dataserver = 26, | 119 | dataserver = 26, |
120 | link_message = 27, | 120 | link_message = 27, |
121 | moving_start = 28, | 121 | moving_start = 28, |
122 | moving_end = 29, | 122 | moving_end = 29, |
123 | object_rez = 30, | 123 | object_rez = 30, |
124 | remote_data = 31, | 124 | remote_data = 31, |
125 | http_response = 32 | 125 | http_response = 32 |
126 | } | 126 | } |
127 | [Serializable] | 127 | [Serializable] |
128 | public enum Operation_Table | 128 | public enum Operation_Table |
129 | { | 129 | { |
130 | NOOP = 0x0, | 130 | NOOP = 0x0, |
131 | POP = 0x1, | 131 | POP = 0x1, |
132 | POPS = 0x2, | 132 | POPS = 0x2, |
133 | POPL = 0x3, | 133 | POPL = 0x3, |
134 | POPV = 0x4, | 134 | POPV = 0x4, |
135 | POPQ = 0x5, | 135 | POPQ = 0x5, |
136 | POPARG = 0x6, | 136 | POPARG = 0x6, |
137 | POPIP = 0x7, | 137 | POPIP = 0x7, |
138 | POPBP = 0x8, | 138 | POPBP = 0x8, |
139 | POPSP = 0x9, | 139 | POPSP = 0x9, |
140 | POPSLR = 0xa, | 140 | POPSLR = 0xa, |
141 | DUP = 0x20, | 141 | DUP = 0x20, |
142 | DUPS = 0x21, | 142 | DUPS = 0x21, |
143 | DUPL = 0x22, | 143 | DUPL = 0x22, |
144 | DUPV = 0x23, | 144 | DUPV = 0x23, |
145 | DUPQ = 0x24, | 145 | DUPQ = 0x24, |
146 | STORE = 0x30, | 146 | STORE = 0x30, |
147 | STORES = 0x31, | 147 | STORES = 0x31, |
148 | STOREL = 0x32, | 148 | STOREL = 0x32, |
149 | STOREV = 0x33, | 149 | STOREV = 0x33, |
150 | STOREQ = 0x34, | 150 | STOREQ = 0x34, |
151 | STOREG = 0x35, | 151 | STOREG = 0x35, |
152 | STOREGS = 0x36, | 152 | STOREGS = 0x36, |
153 | STOREGL = 0x37, | 153 | STOREGL = 0x37, |
154 | STOREGV = 0x38, | 154 | STOREGV = 0x38, |
155 | STOREGQ = 0x39, | 155 | STOREGQ = 0x39, |
156 | LOADP = 0x3a, | 156 | LOADP = 0x3a, |
157 | LOADSP = 0x3b, | 157 | LOADSP = 0x3b, |
158 | LOADLP = 0x3c, | 158 | LOADLP = 0x3c, |
159 | LOADVP = 0x3d, | 159 | LOADVP = 0x3d, |
160 | LOADQP = 0x3e, | 160 | LOADQP = 0x3e, |
161 | LOADGP = 0x3f, | 161 | LOADGP = 0x3f, |
162 | LOADGSP = 0x40, | 162 | LOADGSP = 0x40, |
163 | LOADGLP = 0x41, | 163 | LOADGLP = 0x41, |
164 | LOADGVP = 0x42, | 164 | LOADGVP = 0x42, |
165 | LOADGQP = 0x43, | 165 | LOADGQP = 0x43, |
166 | PUSH = 0x50, | 166 | PUSH = 0x50, |
167 | PUSHS = 0x51, | 167 | PUSHS = 0x51, |
168 | PUSHL = 0x52, | 168 | PUSHL = 0x52, |
169 | PUSHV = 0x53, | 169 | PUSHV = 0x53, |
170 | PUSHQ = 0x54, | 170 | PUSHQ = 0x54, |
171 | PUSHG = 0x55, | 171 | PUSHG = 0x55, |
172 | PUSHGS = 0x56, | 172 | PUSHGS = 0x56, |
173 | PUSHGL = 0x57, | 173 | PUSHGL = 0x57, |
174 | PUSHGV = 0x58, | 174 | PUSHGV = 0x58, |
175 | PUSHGQ = 0x59, | 175 | PUSHGQ = 0x59, |
176 | PUSHIP = 0x5a, | 176 | PUSHIP = 0x5a, |
177 | PUSHBP = 0x5b, | 177 | PUSHBP = 0x5b, |
178 | PUSHSP = 0x5c, | 178 | PUSHSP = 0x5c, |
179 | PUSHARGB = 0x5d, | 179 | PUSHARGB = 0x5d, |
180 | PUSHARGI = 0x5e, | 180 | PUSHARGI = 0x5e, |
181 | PUSHARGF = 0x5f, | 181 | PUSHARGF = 0x5f, |
182 | PUSHARGS = 0x60, | 182 | PUSHARGS = 0x60, |
183 | PUSHARGV = 0x61, | 183 | PUSHARGV = 0x61, |
184 | PUSHARGQ = 0x62, | 184 | PUSHARGQ = 0x62, |
185 | PUSHE = 0x63, | 185 | PUSHE = 0x63, |
186 | PUSHEV = 0x64, | 186 | PUSHEV = 0x64, |
187 | PUSHEQ = 0x65, | 187 | PUSHEQ = 0x65, |
188 | PUSHARGE = 0x66, | 188 | PUSHARGE = 0x66, |
189 | ADD = 0x70, | 189 | ADD = 0x70, |
190 | SUB = 0x71, | 190 | SUB = 0x71, |
191 | MUL = 0x72, | 191 | MUL = 0x72, |
192 | DIV = 0x73, | 192 | DIV = 0x73, |
193 | MOD = 0x74, | 193 | MOD = 0x74, |
194 | EQ = 0x75, | 194 | EQ = 0x75, |
195 | NEQ = 0x76, | 195 | NEQ = 0x76, |
196 | LEQ = 0x77, | 196 | LEQ = 0x77, |
197 | GEQ = 0x78, | 197 | GEQ = 0x78, |
198 | LESS = 0x79, | 198 | LESS = 0x79, |
199 | GREATER = 0x7a, | 199 | GREATER = 0x7a, |
200 | BITAND = 0x7b, | 200 | BITAND = 0x7b, |
201 | BITOR = 0x7c, | 201 | BITOR = 0x7c, |
202 | BITXOR = 0x7d, | 202 | BITXOR = 0x7d, |
203 | BOOLAND = 0x7e, | 203 | BOOLAND = 0x7e, |
204 | BOOLOR = 0x7f, | 204 | BOOLOR = 0x7f, |
205 | NEG = 0x80, | 205 | NEG = 0x80, |
206 | BITNOT = 0x81, | 206 | BITNOT = 0x81, |
207 | BOOLNOT = 0x82, | 207 | BOOLNOT = 0x82, |
208 | JUMP = 0x90, | 208 | JUMP = 0x90, |
209 | JUMPIF = 0x91, | 209 | JUMPIF = 0x91, |
210 | JUMPNIF = 0x92, | 210 | JUMPNIF = 0x92, |
211 | STATE = 0x93, | 211 | STATE = 0x93, |
212 | CALL = 0x94, | 212 | CALL = 0x94, |
213 | RETURN = 0x95, | 213 | RETURN = 0x95, |
214 | CAST = 0xa0, | 214 | CAST = 0xa0, |
215 | STACKTOS = 0xb0, | 215 | STACKTOS = 0xb0, |
216 | STACKTOL = 0xb1, | 216 | STACKTOL = 0xb1, |
217 | PRINT = 0xc0, | 217 | PRINT = 0xc0, |
218 | CALLLIB = 0xd0, | 218 | CALLLIB = 0xd0, |
219 | CALLLIB_TWO_BYTE = 0xd1, | 219 | CALLLIB_TWO_BYTE = 0xd1, |
220 | SHL = 0xe0, | 220 | SHL = 0xe0, |
221 | SHR = 0xe1 | 221 | SHR = 0xe1 |
222 | } | 222 | } |
223 | [Serializable] | 223 | [Serializable] |
224 | public enum BuiltIn_Functions | 224 | public enum BuiltIn_Functions |
225 | { | 225 | { |
226 | llSin = 0, | 226 | llSin = 0, |
227 | llCos = 1, | 227 | llCos = 1, |
228 | llTan = 2, | 228 | llTan = 2, |
229 | llAtan2 = 3, | 229 | llAtan2 = 3, |
230 | llSqrt = 4, | 230 | llSqrt = 4, |
231 | llPow = 5, | 231 | llPow = 5, |
232 | llAbs = 6, | 232 | llAbs = 6, |
233 | llFabs = 7, | 233 | llFabs = 7, |
234 | llFrand = 8, | 234 | llFrand = 8, |
235 | llFloor = 9, | 235 | llFloor = 9, |
236 | llCeil = 10, | 236 | llCeil = 10, |
237 | llRound = 11, | 237 | llRound = 11, |
238 | llVecMag = 12, | 238 | llVecMag = 12, |
239 | llVecNorm = 13, | 239 | llVecNorm = 13, |
240 | llVecDist = 14, | 240 | llVecDist = 14, |
241 | llRot2Euler = 15, | 241 | llRot2Euler = 15, |
242 | llEuler2Rot = 16, | 242 | llEuler2Rot = 16, |
243 | llAxes2Rot = 17, | 243 | llAxes2Rot = 17, |
244 | llRot2Fwd = 18, | 244 | llRot2Fwd = 18, |
245 | llRot2Left = 19, | 245 | llRot2Left = 19, |
246 | llRot2Up = 20, | 246 | llRot2Up = 20, |
247 | llRotBetween = 21, | 247 | llRotBetween = 21, |
248 | llWhisper = 22, | 248 | llWhisper = 22, |
249 | llSay = 23, | 249 | llSay = 23, |
250 | llShout = 24, | 250 | llShout = 24, |
251 | llListen = 25, | 251 | llListen = 25, |
252 | llListenControl = 26, | 252 | llListenControl = 26, |
253 | llListenRemove = 27, | 253 | llListenRemove = 27, |
254 | llSensor = 28, | 254 | llSensor = 28, |
255 | llSensorRepeat = 29, | 255 | llSensorRepeat = 29, |
256 | llSensorRemove = 30, | 256 | llSensorRemove = 30, |
257 | llDetectedName = 31, | 257 | llDetectedName = 31, |
258 | llDetectedKey = 32, | 258 | llDetectedKey = 32, |
259 | llDetectedOwner = 33, | 259 | llDetectedOwner = 33, |
260 | llDetectedType = 34, | 260 | llDetectedType = 34, |
261 | llDetectedPos = 35, | 261 | llDetectedPos = 35, |
262 | llDetectedVel = 36, | 262 | llDetectedVel = 36, |
263 | llDetectedGrab = 37, | 263 | llDetectedGrab = 37, |
264 | llDetectedRot = 38, | 264 | llDetectedRot = 38, |
265 | llDetectedGroup = 39, | 265 | llDetectedGroup = 39, |
266 | llDetectedLinkNumber = 40, | 266 | llDetectedLinkNumber = 40, |
267 | llDie = 41, | 267 | llDie = 41, |
268 | llGround = 42, | 268 | llGround = 42, |
269 | llCloud = 43, | 269 | llCloud = 43, |
270 | llWind = 44, | 270 | llWind = 44, |
271 | llSetStatus = 45, | 271 | llSetStatus = 45, |
272 | llGetStatus = 46, | 272 | llGetStatus = 46, |
273 | llSetScale = 47, | 273 | llSetScale = 47, |
274 | llGetScale = 48, | 274 | llGetScale = 48, |
275 | llSetColor = 49, | 275 | llSetColor = 49, |
276 | llGetAlpha = 50, | 276 | llGetAlpha = 50, |
277 | llSetAlpha = 51, | 277 | llSetAlpha = 51, |
278 | llGetColor = 52, | 278 | llGetColor = 52, |
279 | llSetTexture = 53, | 279 | llSetTexture = 53, |
280 | llScaleTexture = 54, | 280 | llScaleTexture = 54, |
281 | llOffsetTexture = 55, | 281 | llOffsetTexture = 55, |
282 | llRotateTexture = 56, | 282 | llRotateTexture = 56, |
283 | llGetTexture = 57, | 283 | llGetTexture = 57, |
284 | llSetPos = 58, | 284 | llSetPos = 58, |
285 | llGetPos = 59, | 285 | llGetPos = 59, |
286 | llGetLocalPos = 60, | 286 | llGetLocalPos = 60, |
287 | llSetRot = 61, | 287 | llSetRot = 61, |
288 | llGetRot = 62, | 288 | llGetRot = 62, |
289 | llGetLocalRot = 63, | 289 | llGetLocalRot = 63, |
290 | llSetForce = 64, | 290 | llSetForce = 64, |
291 | llGetForce = 65, | 291 | llGetForce = 65, |
292 | llTarget = 66, | 292 | llTarget = 66, |
293 | llTargetRemove = 67, | 293 | llTargetRemove = 67, |
294 | llRotTarget = 68, | 294 | llRotTarget = 68, |
295 | llRotTargetRemove = 69, | 295 | llRotTargetRemove = 69, |
296 | llMoveToTarget = 70, | 296 | llMoveToTarget = 70, |
297 | llStopMoveToTarget = 71, | 297 | llStopMoveToTarget = 71, |
298 | llApplyImpulse = 72, | 298 | llApplyImpulse = 72, |
299 | llApplyRotationalImpulse = 73, | 299 | llApplyRotationalImpulse = 73, |
300 | llSetTorque = 74, | 300 | llSetTorque = 74, |
301 | llGetTorque = 75, | 301 | llGetTorque = 75, |
302 | llSetForceAndTorque = 76, | 302 | llSetForceAndTorque = 76, |
303 | llGetVel = 77, | 303 | llGetVel = 77, |
304 | llGetAccel = 78, | 304 | llGetAccel = 78, |
305 | llGetOmega = 79, | 305 | llGetOmega = 79, |
306 | llGetTimeOfDay = 80, | 306 | llGetTimeOfDay = 80, |
307 | llGetWallclock = 81, | 307 | llGetWallclock = 81, |
308 | llGetTime = 82, | 308 | llGetTime = 82, |
309 | llResetTime = 83, | 309 | llResetTime = 83, |
310 | llGetAndResetTime = 84, | 310 | llGetAndResetTime = 84, |
311 | llSound = 85, | 311 | llSound = 85, |
312 | llPlaySound = 86, | 312 | llPlaySound = 86, |
313 | llLoopSound = 87, | 313 | llLoopSound = 87, |
314 | llLoopSoundMaster = 88, | 314 | llLoopSoundMaster = 88, |
315 | llLoopSoundSlave = 89, | 315 | llLoopSoundSlave = 89, |
316 | llPlaySoundSlave = 90, | 316 | llPlaySoundSlave = 90, |
317 | llTriggerSound = 91, | 317 | llTriggerSound = 91, |
318 | llStopSound = 92, | 318 | llStopSound = 92, |
319 | llPreloadSound = 93, | 319 | llPreloadSound = 93, |
320 | llGetSubString = 94, | 320 | llGetSubString = 94, |
321 | llDeleteSubString = 95, | 321 | llDeleteSubString = 95, |
322 | llInsertString = 96, | 322 | llInsertString = 96, |
323 | llToUpper = 97, | 323 | llToUpper = 97, |
324 | llToLower = 98, | 324 | llToLower = 98, |
325 | llGiveMoney = 99, | 325 | llGiveMoney = 99, |
326 | llMakeExplosion = 100, | 326 | llMakeExplosion = 100, |
327 | llMakeFountain = 101, | 327 | llMakeFountain = 101, |
328 | llMakeSmoke = 102, | 328 | llMakeSmoke = 102, |
329 | llMakeFire = 103, | 329 | llMakeFire = 103, |
330 | llRezObject = 104, | 330 | llRezObject = 104, |
331 | llLookAt = 105, | 331 | llLookAt = 105, |
332 | llStopLookAt = 106, | 332 | llStopLookAt = 106, |
333 | llSetTimerEvent = 107, | 333 | llSetTimerEvent = 107, |
334 | llSleep = 108, | 334 | llSleep = 108, |
335 | llGetMass = 109, | 335 | llGetMass = 109, |
336 | llCollisionFilter = 110, | 336 | llCollisionFilter = 110, |
337 | llTakeControls = 111, | 337 | llTakeControls = 111, |
338 | llReleaseControls = 112, | 338 | llReleaseControls = 112, |
339 | llAttachToAvatar = 113, | 339 | llAttachToAvatar = 113, |
340 | llDetachFromAvatar = 114, | 340 | llDetachFromAvatar = 114, |
341 | llTakeCamera = 115, | 341 | llTakeCamera = 115, |
342 | llReleaseCamera = 116, | 342 | llReleaseCamera = 116, |
343 | llGetOwner = 117, | 343 | llGetOwner = 117, |
344 | llInstantMessage = 118, | 344 | llInstantMessage = 118, |
345 | llEmail = 119, | 345 | llEmail = 119, |
346 | llGetNextEmail = 120, | 346 | llGetNextEmail = 120, |
347 | llGetKey = 121, | 347 | llGetKey = 121, |
348 | llSetBuoyancy = 122, | 348 | llSetBuoyancy = 122, |
349 | llSetHoverHeight = 123, | 349 | llSetHoverHeight = 123, |
350 | llStopHover = 124, | 350 | llStopHover = 124, |
351 | llMinEventDelay = 125, | 351 | llMinEventDelay = 125, |
352 | llSoundPreload = 126, | 352 | llSoundPreload = 126, |
353 | llRotLookAt = 127, | 353 | llRotLookAt = 127, |
354 | llStringLength = 128, | 354 | llStringLength = 128, |
355 | llStartAnimation = 129, | 355 | llStartAnimation = 129, |
356 | llStopAnimation = 130, | 356 | llStopAnimation = 130, |
357 | llPointAt = 131, | 357 | llPointAt = 131, |
358 | llStopPointAt = 132, | 358 | llStopPointAt = 132, |
359 | llTargetOmega = 133, | 359 | llTargetOmega = 133, |
360 | llGetStartParameter = 134, | 360 | llGetStartParameter = 134, |
361 | llGodLikeRezObject = 135, | 361 | llGodLikeRezObject = 135, |
362 | llRequestPermissions = 136, | 362 | llRequestPermissions = 136, |
363 | llGetPermissionsKey = 137, | 363 | llGetPermissionsKey = 137, |
364 | llGetPermissions = 138, | 364 | llGetPermissions = 138, |
365 | llGetLinkNumber = 139, | 365 | llGetLinkNumber = 139, |
366 | llSetLinkColor = 140, | 366 | llSetLinkColor = 140, |
367 | llCreateLink = 141, | 367 | llCreateLink = 141, |
368 | llBreakLink = 142, | 368 | llBreakLink = 142, |
369 | llBreakAllLinks = 143, | 369 | llBreakAllLinks = 143, |
370 | llGetLinkKey = 144, | 370 | llGetLinkKey = 144, |
371 | llGetLinkName = 145, | 371 | llGetLinkName = 145, |
372 | llGetInventoryNumber = 146, | 372 | llGetInventoryNumber = 146, |
373 | llGetInventoryName = 147, | 373 | llGetInventoryName = 147, |
374 | llSetScriptState = 148, | 374 | llSetScriptState = 148, |
375 | llGetEnergy = 149, | 375 | llGetEnergy = 149, |
376 | llGiveInventory = 150, | 376 | llGiveInventory = 150, |
377 | llRemoveInventory = 151, | 377 | llRemoveInventory = 151, |
378 | llSetText = 152, | 378 | llSetText = 152, |
379 | llWater = 153, | 379 | llWater = 153, |
380 | llPassTouches = 154, | 380 | llPassTouches = 154, |
381 | llRequestAgentData = 155, | 381 | llRequestAgentData = 155, |
382 | llRequestInventoryData = 156, | 382 | llRequestInventoryData = 156, |
383 | llSetDamage = 157, | 383 | llSetDamage = 157, |
384 | llTeleportAgentHome = 158, | 384 | llTeleportAgentHome = 158, |
385 | llModifyLand = 159, | 385 | llModifyLand = 159, |
386 | llCollisionSound = 160, | 386 | llCollisionSound = 160, |
387 | llCollisionSprite = 161, | 387 | llCollisionSprite = 161, |
388 | llGetAnimation = 162, | 388 | llGetAnimation = 162, |
389 | llResetScript = 163, | 389 | llResetScript = 163, |
390 | llMessageLinked = 164, | 390 | llMessageLinked = 164, |
391 | llPushObject = 165, | 391 | llPushObject = 165, |
392 | llPassCollisions = 166, | 392 | llPassCollisions = 166, |
393 | llGetScriptName = 167, | 393 | llGetScriptName = 167, |
394 | llGetNumberOfSides = 168, | 394 | llGetNumberOfSides = 168, |
395 | llAxisAngle2Rot = 169, | 395 | llAxisAngle2Rot = 169, |
396 | llRot2Axis = 170, | 396 | llRot2Axis = 170, |
397 | llRot2Angle = 171, | 397 | llRot2Angle = 171, |
398 | llAcos = 172, | 398 | llAcos = 172, |
399 | llAsin = 173, | 399 | llAsin = 173, |
400 | llAngleBetween = 174, | 400 | llAngleBetween = 174, |
401 | llGetInventoryKey = 175, | 401 | llGetInventoryKey = 175, |
402 | llAllowInventoryDrop = 176, | 402 | llAllowInventoryDrop = 176, |
403 | llGetSunDirection = 177, | 403 | llGetSunDirection = 177, |
404 | llGetTextureOffset = 178, | 404 | llGetTextureOffset = 178, |
405 | llGetTextureScale = 179, | 405 | llGetTextureScale = 179, |
406 | llGetTextureRot = 180, | 406 | llGetTextureRot = 180, |
407 | llSubStringIndex = 181, | 407 | llSubStringIndex = 181, |
408 | llGetOwnerKey = 182, | 408 | llGetOwnerKey = 182, |
409 | llGetCenterOfMass = 183, | 409 | llGetCenterOfMass = 183, |
410 | llListSort = 184, | 410 | llListSort = 184, |
411 | llGetListLength = 185, | 411 | llGetListLength = 185, |
412 | llList2Integer = 186, | 412 | llList2Integer = 186, |
413 | llList2Float = 187, | 413 | llList2Float = 187, |
414 | llList2String = 188, | 414 | llList2String = 188, |
415 | llList2Key = 189, | 415 | llList2Key = 189, |
416 | llList2Vector = 190, | 416 | llList2Vector = 190, |
417 | llList2Rot = 191, | 417 | llList2Rot = 191, |
418 | llList2List = 192, | 418 | llList2List = 192, |
419 | llDeleteSubList = 193, | 419 | llDeleteSubList = 193, |
420 | llGetListEntryType = 194, | 420 | llGetListEntryType = 194, |
421 | llList2CSV = 195, | 421 | llList2CSV = 195, |
422 | llCSV2List = 196, | 422 | llCSV2List = 196, |
423 | llListRandomize = 197, | 423 | llListRandomize = 197, |
424 | llList2ListStrided = 198, | 424 | llList2ListStrided = 198, |
425 | llGetRegionCorner = 199, | 425 | llGetRegionCorner = 199, |
426 | llListInsertList = 200, | 426 | llListInsertList = 200, |
427 | llListFindList = 201, | 427 | llListFindList = 201, |
428 | llGetObjectName = 202, | 428 | llGetObjectName = 202, |
429 | llSetObjectName = 203, | 429 | llSetObjectName = 203, |
430 | llGetDate = 204, | 430 | llGetDate = 204, |
431 | llEdgeOfWorld = 205, | 431 | llEdgeOfWorld = 205, |
432 | llGetAgentInfo = 206, | 432 | llGetAgentInfo = 206, |
433 | llAdjustSoundVolume = 207, | 433 | llAdjustSoundVolume = 207, |
434 | llSetSoundQueueing = 208, | 434 | llSetSoundQueueing = 208, |
435 | llSetSoundRadius = 209, | 435 | llSetSoundRadius = 209, |
436 | llKey2Name = 210, | 436 | llKey2Name = 210, |
437 | llSetTextureAnim = 211, | 437 | llSetTextureAnim = 211, |
438 | llTriggerSoundLimited = 212, | 438 | llTriggerSoundLimited = 212, |
439 | llEjectFromLand = 213, | 439 | llEjectFromLand = 213, |
440 | llParseString2List = 214, | 440 | llParseString2List = 214, |
441 | llOverMyLand = 215, | 441 | llOverMyLand = 215, |
442 | llGetLandOwnerAt = 216, | 442 | llGetLandOwnerAt = 216, |
443 | llGetNotecardLine = 217, | 443 | llGetNotecardLine = 217, |
444 | llGetAgentSize = 218, | 444 | llGetAgentSize = 218, |
445 | llSameGroup = 219, | 445 | llSameGroup = 219, |
446 | llUnSit = 220, | 446 | llUnSit = 220, |
447 | llGroundSlope = 221, | 447 | llGroundSlope = 221, |
448 | llGroundNormal = 222, | 448 | llGroundNormal = 222, |
449 | llGroundContour = 223, | 449 | llGroundContour = 223, |
450 | llGetAttached = 224, | 450 | llGetAttached = 224, |
451 | llGetFreeMemory = 225, | 451 | llGetFreeMemory = 225, |
452 | llGetRegionName = 226, | 452 | llGetRegionName = 226, |
453 | llGetRegionTimeDilation = 227, | 453 | llGetRegionTimeDilation = 227, |
454 | llGetRegionFPS = 228, | 454 | llGetRegionFPS = 228, |
455 | llParticleSystem = 229, | 455 | llParticleSystem = 229, |
456 | llGroundRepel = 230, | 456 | llGroundRepel = 230, |
457 | llGiveInventoryList = 231, | 457 | llGiveInventoryList = 231, |
458 | llSetVehicleType = 232, | 458 | llSetVehicleType = 232, |
459 | llSetVehicleFloatParam = 233, | 459 | llSetVehicleFloatParam = 233, |
460 | llSetVehicleVectorParam = 234, | 460 | llSetVehicleVectorParam = 234, |
461 | llSetVehicleRotationParam = 235, | 461 | llSetVehicleRotationParam = 235, |
462 | llSetVehicleFlags = 236, | 462 | llSetVehicleFlags = 236, |
463 | llRemoveVehicleFlags = 237, | 463 | llRemoveVehicleFlags = 237, |
464 | llSitTarget = 238, | 464 | llSitTarget = 238, |
465 | llAvatarOnSitTarget = 239, | 465 | llAvatarOnSitTarget = 239, |
466 | llAddToLandPassList = 240, | 466 | llAddToLandPassList = 240, |
467 | llSetTouchText = 241, | 467 | llSetTouchText = 241, |
468 | llSetSitText = 242, | 468 | llSetSitText = 242, |
469 | llSetCameraEyeOffset = 243, | 469 | llSetCameraEyeOffset = 243, |
470 | llSetCameraAtOffset = 244, | 470 | llSetCameraAtOffset = 244, |
471 | llDumpList2String = 245, | 471 | llDumpList2String = 245, |
472 | llScriptDanger = 246, | 472 | llScriptDanger = 246, |
473 | llDialog = 247, | 473 | llDialog = 247, |
474 | llVolumeDetect = 248, | 474 | llVolumeDetect = 248, |
475 | llResetOtherScript = 249, | 475 | llResetOtherScript = 249, |
476 | llGetScriptState = 250, | 476 | llGetScriptState = 250, |
477 | llRemoteLoadScript = 251, | 477 | llRemoteLoadScript = 251, |
478 | llSetRemoteScriptAccessPin = 252, | 478 | llSetRemoteScriptAccessPin = 252, |
479 | llRemoteLoadScriptPin = 253, | 479 | llRemoteLoadScriptPin = 253, |
480 | llOpenRemoteDataChannel = 254, | 480 | llOpenRemoteDataChannel = 254, |
481 | llSendRemoteData = 255, | 481 | llSendRemoteData = 255, |
482 | llRemoteDataReply = 256, | 482 | llRemoteDataReply = 256, |
483 | llCloseRemoteDataChannel = 257, | 483 | llCloseRemoteDataChannel = 257, |
484 | llMD5String = 258, | 484 | llMD5String = 258, |
485 | llSetPrimitiveParams = 259, | 485 | llSetPrimitiveParams = 259, |
486 | llStringToBase64 = 260, | 486 | llStringToBase64 = 260, |
487 | llBase64ToString = 261, | 487 | llBase64ToString = 261, |
488 | llXorBase64Strings = 262, | 488 | llXorBase64Strings = 262, |
489 | llRemoteDataSetRegion = 263, | 489 | llRemoteDataSetRegion = 263, |
490 | llLog10 = 264, | 490 | llLog10 = 264, |
491 | llLog = 265, | 491 | llLog = 265, |
492 | llGetAnimationList = 266, | 492 | llGetAnimationList = 266, |
493 | llSetParcelMusicURL = 267, | 493 | llSetParcelMusicURL = 267, |
494 | llGetRootPosition = 268, | 494 | llGetRootPosition = 268, |
495 | llGetRootRotation = 269, | 495 | llGetRootRotation = 269, |
496 | llGetObjectDesc = 270, | 496 | llGetObjectDesc = 270, |
497 | llSetObjectDesc = 271, | 497 | llSetObjectDesc = 271, |
498 | llGetCreator = 272, | 498 | llGetCreator = 272, |
499 | llGetTimestamp = 273, | 499 | llGetTimestamp = 273, |
500 | llSetLinkAlpha = 274, | 500 | llSetLinkAlpha = 274, |
501 | llGetNumberOfPrims = 275, | 501 | llGetNumberOfPrims = 275, |
502 | llGetNumberOfNotecardLines = 276, | 502 | llGetNumberOfNotecardLines = 276, |
503 | llGetBoundingBox = 277, | 503 | llGetBoundingBox = 277, |
504 | llGetGeometricCenter = 278, | 504 | llGetGeometricCenter = 278, |
505 | llGetPrimitiveParams = 279, | 505 | llGetPrimitiveParams = 279, |
506 | llIntegerToBase64 = 280, | 506 | llIntegerToBase64 = 280, |
507 | llBase64ToInteger = 281, | 507 | llBase64ToInteger = 281, |
508 | llGetGMTclock = 282, | 508 | llGetGMTclock = 282, |
509 | llGetSimulatorHostname = 283, | 509 | llGetSimulatorHostname = 283, |
510 | llSetLocalRot = 284, | 510 | llSetLocalRot = 284, |
511 | llParseStringKeepNulls = 285, | 511 | llParseStringKeepNulls = 285, |
512 | llRezAtRoot = 286, | 512 | llRezAtRoot = 286, |
513 | llGetObjectPermMask = 287, | 513 | llGetObjectPermMask = 287, |
514 | llSetObjectPermMask = 288, | 514 | llSetObjectPermMask = 288, |
515 | llGetInventoryPermMask = 289, | 515 | llGetInventoryPermMask = 289, |
516 | llSetInventoryPermMask = 290, | 516 | llSetInventoryPermMask = 290, |
517 | llGetInventoryCreator = 291, | 517 | llGetInventoryCreator = 291, |
518 | llOwnerSay = 292, | 518 | llOwnerSay = 292, |
519 | llRequestSimulatorData = 293, | 519 | llRequestSimulatorData = 293, |
520 | llForceMouselook = 294, | 520 | llForceMouselook = 294, |
521 | llGetObjectMass = 295, | 521 | llGetObjectMass = 295, |
522 | llListReplaceList = 296, | 522 | llListReplaceList = 296, |
523 | llLoadURL = 297, | 523 | llLoadURL = 297, |
524 | llParcelMediaCommandList = 298, | 524 | llParcelMediaCommandList = 298, |
525 | llParcelMediaQuery = 299, | 525 | llParcelMediaQuery = 299, |
526 | llModPow = 300, | 526 | llModPow = 300, |
527 | llGetInventoryType = 301, | 527 | llGetInventoryType = 301, |
528 | llSetPayPrice = 302, | 528 | llSetPayPrice = 302, |
529 | llGetCameraPos = 303, | 529 | llGetCameraPos = 303, |
530 | llGetCameraRot = 304, | 530 | llGetCameraRot = 304, |
531 | llSetPrimURL = 305, | 531 | llSetPrimURL = 305, |
532 | llRefreshPrimURL = 306, | 532 | llRefreshPrimURL = 306, |
533 | llEscapeURL = 307, | 533 | llEscapeURL = 307, |
534 | llUnescapeURL = 308, | 534 | llUnescapeURL = 308, |
535 | llMapDestination = 309, | 535 | llMapDestination = 309, |
536 | llAddToLandBanList = 310, | 536 | llAddToLandBanList = 310, |
537 | llRemoveFromLandPassList = 311, | 537 | llRemoveFromLandPassList = 311, |
538 | llRemoveFromLandBanList = 312, | 538 | llRemoveFromLandBanList = 312, |
539 | llSetCameraParams = 313, | 539 | llSetCameraParams = 313, |
540 | llClearCameraParams = 314, | 540 | llClearCameraParams = 314, |
541 | llListStatistics = 315, | 541 | llListStatistics = 315, |
542 | llGetUnixTime = 316, | 542 | llGetUnixTime = 316, |
543 | llGetParcelFlags = 317, | 543 | llGetParcelFlags = 317, |
544 | llGetRegionFlags = 318, | 544 | llGetRegionFlags = 318, |
545 | llXorBase64StringsCorrect = 319, | 545 | llXorBase64StringsCorrect = 319, |
546 | llHTTPRequest = 320, | 546 | llHTTPRequest = 320, |
547 | llResetLandBanList = 321, | 547 | llResetLandBanList = 321, |
548 | llResetLandPassList = 322, | 548 | llResetLandPassList = 322, |
549 | llGetParcelPrimCount = 323, | 549 | llGetParcelPrimCount = 323, |
550 | llGetParcelPrimOwners = 324, | 550 | llGetParcelPrimOwners = 324, |
551 | llGetObjectPrimCount = 325, | 551 | llGetObjectPrimCount = 325, |
552 | llGetParcelMaxPrims = 326, | 552 | llGetParcelMaxPrims = 326, |
553 | llGetParcelDetails = 327 | 553 | llGetParcelDetails = 327 |
554 | } | 554 | } |
555 | 555 | ||
556 | } | 556 | } |
557 | } | 557 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Parser.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Parser.cs index c3e3e73..ba97375 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Parser.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Parser.cs | |||
@@ -1,722 +1,722 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Reflection.Emit; | 34 | using System.Reflection.Emit; |
35 | 35 | ||
36 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 36 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
37 | { | 37 | { |
38 | partial class LSO_Parser | 38 | partial class LSO_Parser |
39 | { | 39 | { |
40 | private string FileName; | 40 | private string FileName; |
41 | private FileStream fs; | 41 | private FileStream fs; |
42 | private BinaryReader br; | 42 | private BinaryReader br; |
43 | internal LSO_Struct.Header myHeader; | 43 | internal LSO_Struct.Header myHeader; |
44 | internal Dictionary<long, LSO_Struct.StaticBlock> StaticBlocks = new Dictionary<long, LSO_Struct.StaticBlock>(); | 44 | internal Dictionary<long, LSO_Struct.StaticBlock> StaticBlocks = new Dictionary<long, LSO_Struct.StaticBlock>(); |
45 | //private System.Collections.Hashtable StaticBlocks = new System.Collections.Hashtable(); | 45 | //private System.Collections.Hashtable StaticBlocks = new System.Collections.Hashtable(); |
46 | 46 | ||
47 | private TypeBuilder typeBuilder; | 47 | private TypeBuilder typeBuilder; |
48 | private System.Collections.Generic.List<string> EventList = new System.Collections.Generic.List<string>(); | 48 | private System.Collections.Generic.List<string> EventList = new System.Collections.Generic.List<string>(); |
49 | 49 | ||
50 | public LSO_Parser(string _FileName, TypeBuilder _typeBuilder) | 50 | public LSO_Parser(string _FileName, TypeBuilder _typeBuilder) |
51 | { | 51 | { |
52 | FileName = _FileName; | 52 | FileName = _FileName; |
53 | typeBuilder = _typeBuilder; | 53 | typeBuilder = _typeBuilder; |
54 | } | 54 | } |
55 | 55 | ||
56 | internal void OpenFile() | 56 | internal void OpenFile() |
57 | { | 57 | { |
58 | // Open | 58 | // Open |
59 | Common.SendToDebug("Opening filename: " + FileName); | 59 | Common.SendToDebug("Opening filename: " + FileName); |
60 | fs = File.Open(FileName, FileMode.Open, FileAccess.Read, FileShare.Read); | 60 | fs = File.Open(FileName, FileMode.Open, FileAccess.Read, FileShare.Read); |
61 | br = new BinaryReader(fs, Encoding.BigEndianUnicode); | 61 | br = new BinaryReader(fs, Encoding.BigEndianUnicode); |
62 | 62 | ||
63 | } | 63 | } |
64 | internal void CloseFile() | 64 | internal void CloseFile() |
65 | { | 65 | { |
66 | 66 | ||
67 | // Close | 67 | // Close |
68 | br.Close(); | 68 | br.Close(); |
69 | fs.Close(); | 69 | fs.Close(); |
70 | } | 70 | } |
71 | 71 | ||
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Parse LSO file. | 74 | /// Parse LSO file. |
75 | /// </summary> | 75 | /// </summary> |
76 | public void Parse() | 76 | public void Parse() |
77 | { | 77 | { |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack. | 81 | // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack. |
82 | 82 | ||
83 | 83 | ||
84 | // HEADER BLOCK | 84 | // HEADER BLOCK |
85 | Common.SendToDebug("Reading HEADER BLOCK at: 0"); | 85 | Common.SendToDebug("Reading HEADER BLOCK at: 0"); |
86 | fs.Seek(0, SeekOrigin.Begin); | 86 | fs.Seek(0, SeekOrigin.Begin); |
87 | myHeader = new LSO_Struct.Header(); | 87 | myHeader = new LSO_Struct.Header(); |
88 | myHeader.TM = BitConverter.ToUInt32(br_read(4), 0); | 88 | myHeader.TM = BitConverter.ToUInt32(br_read(4), 0); |
89 | myHeader.IP = BitConverter.ToUInt32(br_read(4), 0); | 89 | myHeader.IP = BitConverter.ToUInt32(br_read(4), 0); |
90 | myHeader.VN = BitConverter.ToUInt32(br_read(4), 0); | 90 | myHeader.VN = BitConverter.ToUInt32(br_read(4), 0); |
91 | myHeader.BP = BitConverter.ToUInt32(br_read(4), 0); | 91 | myHeader.BP = BitConverter.ToUInt32(br_read(4), 0); |
92 | myHeader.SP = BitConverter.ToUInt32(br_read(4), 0); | 92 | myHeader.SP = BitConverter.ToUInt32(br_read(4), 0); |
93 | myHeader.HR = BitConverter.ToUInt32(br_read(4), 0); | 93 | myHeader.HR = BitConverter.ToUInt32(br_read(4), 0); |
94 | myHeader.HP = BitConverter.ToUInt32(br_read(4), 0); | 94 | myHeader.HP = BitConverter.ToUInt32(br_read(4), 0); |
95 | myHeader.CS = BitConverter.ToUInt32(br_read(4), 0); | 95 | myHeader.CS = BitConverter.ToUInt32(br_read(4), 0); |
96 | myHeader.NS = BitConverter.ToUInt32(br_read(4), 0); | 96 | myHeader.NS = BitConverter.ToUInt32(br_read(4), 0); |
97 | myHeader.CE = BitConverter.ToUInt32(br_read(4), 0); | 97 | myHeader.CE = BitConverter.ToUInt32(br_read(4), 0); |
98 | myHeader.IE = BitConverter.ToUInt32(br_read(4), 0); | 98 | myHeader.IE = BitConverter.ToUInt32(br_read(4), 0); |
99 | myHeader.ER = BitConverter.ToUInt32(br_read(4), 0); | 99 | myHeader.ER = BitConverter.ToUInt32(br_read(4), 0); |
100 | myHeader.FR = BitConverter.ToUInt32(br_read(4), 0); | 100 | myHeader.FR = BitConverter.ToUInt32(br_read(4), 0); |
101 | myHeader.SLR = BitConverter.ToUInt32(br_read(4), 0); | 101 | myHeader.SLR = BitConverter.ToUInt32(br_read(4), 0); |
102 | myHeader.GVR = BitConverter.ToUInt32(br_read(4), 0); | 102 | myHeader.GVR = BitConverter.ToUInt32(br_read(4), 0); |
103 | myHeader.GFR = BitConverter.ToUInt32(br_read(4), 0); | 103 | myHeader.GFR = BitConverter.ToUInt32(br_read(4), 0); |
104 | myHeader.PR = BitConverter.ToUInt32(br_read(4), 0); | 104 | myHeader.PR = BitConverter.ToUInt32(br_read(4), 0); |
105 | myHeader.ESR = BitConverter.ToUInt32(br_read(4), 0); | 105 | myHeader.ESR = BitConverter.ToUInt32(br_read(4), 0); |
106 | myHeader.SR = BitConverter.ToUInt32(br_read(4), 0); | 106 | myHeader.SR = BitConverter.ToUInt32(br_read(4), 0); |
107 | myHeader.NCE = BitConverter.ToUInt64(br_read(8), 0); | 107 | myHeader.NCE = BitConverter.ToUInt64(br_read(8), 0); |
108 | myHeader.NIE = BitConverter.ToUInt64(br_read(8), 0); | 108 | myHeader.NIE = BitConverter.ToUInt64(br_read(8), 0); |
109 | myHeader.NER = BitConverter.ToUInt64(br_read(8), 0); | 109 | myHeader.NER = BitConverter.ToUInt64(br_read(8), 0); |
110 | 110 | ||
111 | // Print Header Block to debug | 111 | // Print Header Block to debug |
112 | Common.SendToDebug("TM - Top of memory (size): " + myHeader.TM); | 112 | Common.SendToDebug("TM - Top of memory (size): " + myHeader.TM); |
113 | Common.SendToDebug("IP - Instruction Pointer (0=not running): " + myHeader.IP); | 113 | Common.SendToDebug("IP - Instruction Pointer (0=not running): " + myHeader.IP); |
114 | Common.SendToDebug("VN - Version number: " + myHeader.VN); | 114 | Common.SendToDebug("VN - Version number: " + myHeader.VN); |
115 | Common.SendToDebug("BP - Local Frame Pointer: " + myHeader.BP); | 115 | Common.SendToDebug("BP - Local Frame Pointer: " + myHeader.BP); |
116 | Common.SendToDebug("SP - Stack Pointer: " + myHeader.SP); | 116 | Common.SendToDebug("SP - Stack Pointer: " + myHeader.SP); |
117 | Common.SendToDebug("HR - Heap Register: " + myHeader.HR); | 117 | Common.SendToDebug("HR - Heap Register: " + myHeader.HR); |
118 | Common.SendToDebug("HP - Heap Pointer: " + myHeader.HP); | 118 | Common.SendToDebug("HP - Heap Pointer: " + myHeader.HP); |
119 | Common.SendToDebug("CS - Current State: " + myHeader.CS); | 119 | Common.SendToDebug("CS - Current State: " + myHeader.CS); |
120 | Common.SendToDebug("NS - Next State: " + myHeader.NS); | 120 | Common.SendToDebug("NS - Next State: " + myHeader.NS); |
121 | Common.SendToDebug("CE - Current Events: " + myHeader.CE); | 121 | Common.SendToDebug("CE - Current Events: " + myHeader.CE); |
122 | Common.SendToDebug("IE - In Event: " + myHeader.IE); | 122 | Common.SendToDebug("IE - In Event: " + myHeader.IE); |
123 | Common.SendToDebug("ER - Event Register: " + myHeader.ER); | 123 | Common.SendToDebug("ER - Event Register: " + myHeader.ER); |
124 | Common.SendToDebug("FR - Fault Register: " + myHeader.FR); | 124 | Common.SendToDebug("FR - Fault Register: " + myHeader.FR); |
125 | Common.SendToDebug("SLR - Sleep Register: " + myHeader.SLR); | 125 | Common.SendToDebug("SLR - Sleep Register: " + myHeader.SLR); |
126 | Common.SendToDebug("GVR - Global Variable Register: " + myHeader.GVR); | 126 | Common.SendToDebug("GVR - Global Variable Register: " + myHeader.GVR); |
127 | Common.SendToDebug("GFR - Global Function Register: " + myHeader.GFR); | 127 | Common.SendToDebug("GFR - Global Function Register: " + myHeader.GFR); |
128 | Common.SendToDebug("PR - Parameter Register: " + myHeader.PR); | 128 | Common.SendToDebug("PR - Parameter Register: " + myHeader.PR); |
129 | Common.SendToDebug("ESR - Energy Supply Register: " + myHeader.ESR); | 129 | Common.SendToDebug("ESR - Energy Supply Register: " + myHeader.ESR); |
130 | Common.SendToDebug("SR - State Register: " + myHeader.SR); | 130 | Common.SendToDebug("SR - State Register: " + myHeader.SR); |
131 | Common.SendToDebug("NCE - 64-bit Current Events: " + myHeader.NCE); | 131 | Common.SendToDebug("NCE - 64-bit Current Events: " + myHeader.NCE); |
132 | Common.SendToDebug("NIE - 64-bit In Events: " + myHeader.NIE); | 132 | Common.SendToDebug("NIE - 64-bit In Events: " + myHeader.NIE); |
133 | Common.SendToDebug("NER - 64-bit Event Register: " + myHeader.NER); | 133 | Common.SendToDebug("NER - 64-bit Event Register: " + myHeader.NER); |
134 | Common.SendToDebug("Read position when exiting HEADER BLOCK: " + fs.Position); | 134 | Common.SendToDebug("Read position when exiting HEADER BLOCK: " + fs.Position); |
135 | 135 | ||
136 | // STATIC BLOCK | 136 | // STATIC BLOCK |
137 | Common.SendToDebug("Reading STATIC BLOCK at: " + myHeader.GVR); | 137 | Common.SendToDebug("Reading STATIC BLOCK at: " + myHeader.GVR); |
138 | fs.Seek(myHeader.GVR, SeekOrigin.Begin); | 138 | fs.Seek(myHeader.GVR, SeekOrigin.Begin); |
139 | int StaticBlockCount = 0; | 139 | int StaticBlockCount = 0; |
140 | // Read function blocks until we hit GFR | 140 | // Read function blocks until we hit GFR |
141 | while (fs.Position < myHeader.GFR) | 141 | while (fs.Position < myHeader.GFR) |
142 | { | 142 | { |
143 | StaticBlockCount++; | 143 | StaticBlockCount++; |
144 | long startReadPos = fs.Position; | 144 | long startReadPos = fs.Position; |
145 | Common.SendToDebug("Reading Static Block " + StaticBlockCount + " at: " + startReadPos); | 145 | Common.SendToDebug("Reading Static Block " + StaticBlockCount + " at: " + startReadPos); |
146 | 146 | ||
147 | //fs.Seek(myHeader.GVR, SeekOrigin.Begin); | 147 | //fs.Seek(myHeader.GVR, SeekOrigin.Begin); |
148 | LSO_Struct.StaticBlock myStaticBlock = new LSO_Struct.StaticBlock(); | 148 | LSO_Struct.StaticBlock myStaticBlock = new LSO_Struct.StaticBlock(); |
149 | myStaticBlock.Static_Chunk_Header_Size = BitConverter.ToUInt32(br_read(4), 0); | 149 | myStaticBlock.Static_Chunk_Header_Size = BitConverter.ToUInt32(br_read(4), 0); |
150 | myStaticBlock.ObjectType = br_read(1)[0]; | 150 | myStaticBlock.ObjectType = br_read(1)[0]; |
151 | Common.SendToDebug("Static Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myStaticBlock.ObjectType).ToString()); | 151 | Common.SendToDebug("Static Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myStaticBlock.ObjectType).ToString()); |
152 | myStaticBlock.Unknown = br_read(1)[0]; | 152 | myStaticBlock.Unknown = br_read(1)[0]; |
153 | // Size of datatype varies -- what about strings? | 153 | // Size of datatype varies -- what about strings? |
154 | if (myStaticBlock.ObjectType != 0) | 154 | if (myStaticBlock.ObjectType != 0) |
155 | myStaticBlock.BlockVariable = br_read(getObjectSize(myStaticBlock.ObjectType)); | 155 | myStaticBlock.BlockVariable = br_read(getObjectSize(myStaticBlock.ObjectType)); |
156 | 156 | ||
157 | StaticBlocks.Add((UInt32)startReadPos, myStaticBlock); | 157 | StaticBlocks.Add((UInt32)startReadPos, myStaticBlock); |
158 | 158 | ||
159 | } | 159 | } |
160 | Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount); | 160 | Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount); |
161 | 161 | ||
162 | 162 | ||
163 | // FUNCTION BLOCK | 163 | // FUNCTION BLOCK |
164 | // Always right after STATIC BLOCK | 164 | // Always right after STATIC BLOCK |
165 | LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock(); | 165 | LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock(); |
166 | if (myHeader.GFR == myHeader.SR) | 166 | if (myHeader.GFR == myHeader.SR) |
167 | { | 167 | { |
168 | // If GFR and SR are at same position then there is no fuction block | 168 | // If GFR and SR are at same position then there is no fuction block |
169 | Common.SendToDebug("No FUNCTION BLOCK found"); | 169 | Common.SendToDebug("No FUNCTION BLOCK found"); |
170 | } | 170 | } |
171 | else | 171 | else |
172 | { | 172 | { |
173 | Common.SendToDebug("Reading FUNCTION BLOCK at: " + myHeader.GFR); | 173 | Common.SendToDebug("Reading FUNCTION BLOCK at: " + myHeader.GFR); |
174 | fs.Seek(myHeader.GFR, SeekOrigin.Begin); | 174 | fs.Seek(myHeader.GFR, SeekOrigin.Begin); |
175 | myFunctionBlock.FunctionCount = BitConverter.ToUInt32(br_read(4), 0); | 175 | myFunctionBlock.FunctionCount = BitConverter.ToUInt32(br_read(4), 0); |
176 | Common.SendToDebug("Number of functions in Fuction Block: " + myFunctionBlock.FunctionCount); | 176 | Common.SendToDebug("Number of functions in Fuction Block: " + myFunctionBlock.FunctionCount); |
177 | if (myFunctionBlock.FunctionCount > 0) | 177 | if (myFunctionBlock.FunctionCount > 0) |
178 | { | 178 | { |
179 | myFunctionBlock.CodeChunkPointer = new UInt32[myFunctionBlock.FunctionCount]; | 179 | myFunctionBlock.CodeChunkPointer = new UInt32[myFunctionBlock.FunctionCount]; |
180 | for (int i = 0; i < myFunctionBlock.FunctionCount; i++) | 180 | for (int i = 0; i < myFunctionBlock.FunctionCount; i++) |
181 | { | 181 | { |
182 | Common.SendToDebug("Reading function " + i + " at: " + fs.Position); | 182 | Common.SendToDebug("Reading function " + i + " at: " + fs.Position); |
183 | // TODO: ADD TO FUNCTION LIST (How do we identify it later?) | 183 | // TODO: ADD TO FUNCTION LIST (How do we identify it later?) |
184 | // Note! Absolute position | 184 | // Note! Absolute position |
185 | myFunctionBlock.CodeChunkPointer[i] = BitConverter.ToUInt32(br_read(4), 0) + myHeader.GFR; | 185 | myFunctionBlock.CodeChunkPointer[i] = BitConverter.ToUInt32(br_read(4), 0) + myHeader.GFR; |
186 | Common.SendToDebug("Fuction " + i + " code chunk position: " + myFunctionBlock.CodeChunkPointer[i]); | 186 | Common.SendToDebug("Fuction " + i + " code chunk position: " + myFunctionBlock.CodeChunkPointer[i]); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | } | 189 | } |
190 | 190 | ||
191 | 191 | ||
192 | // STATE FRAME BLOCK | 192 | // STATE FRAME BLOCK |
193 | // Always right after FUNCTION BLOCK | 193 | // Always right after FUNCTION BLOCK |
194 | Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR); | 194 | Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR); |
195 | fs.Seek(myHeader.SR, SeekOrigin.Begin); | 195 | fs.Seek(myHeader.SR, SeekOrigin.Begin); |
196 | LSO_Struct.StateFrameBlock myStateFrameBlock = new LSO_Struct.StateFrameBlock(); | 196 | LSO_Struct.StateFrameBlock myStateFrameBlock = new LSO_Struct.StateFrameBlock(); |
197 | myStateFrameBlock.StateCount = BitConverter.ToUInt32(br_read(4), 0); | 197 | myStateFrameBlock.StateCount = BitConverter.ToUInt32(br_read(4), 0); |
198 | if (myStateFrameBlock.StateCount > 0) | 198 | if (myStateFrameBlock.StateCount > 0) |
199 | { | 199 | { |
200 | // Initialize array | 200 | // Initialize array |
201 | myStateFrameBlock.StatePointer = new LSO_Struct.StatePointerBlock[myStateFrameBlock.StateCount]; | 201 | myStateFrameBlock.StatePointer = new LSO_Struct.StatePointerBlock[myStateFrameBlock.StateCount]; |
202 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) | 202 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) |
203 | { | 203 | { |
204 | Common.SendToDebug("Reading STATE POINTER BLOCK " + (i + 1) + " at: " + fs.Position); | 204 | Common.SendToDebug("Reading STATE POINTER BLOCK " + (i + 1) + " at: " + fs.Position); |
205 | // Position is relative to state frame | 205 | // Position is relative to state frame |
206 | myStateFrameBlock.StatePointer[i].Location = myHeader.SR + BitConverter.ToUInt32(br_read(4), 0); | 206 | myStateFrameBlock.StatePointer[i].Location = myHeader.SR + BitConverter.ToUInt32(br_read(4), 0); |
207 | myStateFrameBlock.StatePointer[i].EventMask = new System.Collections.BitArray(br_read(8)); | 207 | myStateFrameBlock.StatePointer[i].EventMask = new System.Collections.BitArray(br_read(8)); |
208 | Common.SendToDebug("Pointer: " + myStateFrameBlock.StatePointer[i].Location); | 208 | Common.SendToDebug("Pointer: " + myStateFrameBlock.StatePointer[i].Location); |
209 | Common.SendToDebug("Total potential EventMask bits: " + myStateFrameBlock.StatePointer[i].EventMask.Count); | 209 | Common.SendToDebug("Total potential EventMask bits: " + myStateFrameBlock.StatePointer[i].EventMask.Count); |
210 | 210 | ||
211 | //// Read STATE BLOCK | 211 | //// Read STATE BLOCK |
212 | //long CurPos = fs.Position; | 212 | //long CurPos = fs.Position; |
213 | //fs.Seek(CurPos, SeekOrigin.Begin); | 213 | //fs.Seek(CurPos, SeekOrigin.Begin); |
214 | 214 | ||
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | 218 | ||
219 | // STATE BLOCK | 219 | // STATE BLOCK |
220 | // For each StateFrameBlock there is one StateBlock with multiple event handlers | 220 | // For each StateFrameBlock there is one StateBlock with multiple event handlers |
221 | 221 | ||
222 | if (myStateFrameBlock.StateCount > 0) | 222 | if (myStateFrameBlock.StateCount > 0) |
223 | { | 223 | { |
224 | // Go through all State Frame Pointers found | 224 | // Go through all State Frame Pointers found |
225 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) | 225 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) |
226 | { | 226 | { |
227 | 227 | ||
228 | fs.Seek(myStateFrameBlock.StatePointer[i].Location, SeekOrigin.Begin); | 228 | fs.Seek(myStateFrameBlock.StatePointer[i].Location, SeekOrigin.Begin); |
229 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " at: " + fs.Position); | 229 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " at: " + fs.Position); |
230 | 230 | ||
231 | // READ: STATE BLOCK HEADER | 231 | // READ: STATE BLOCK HEADER |
232 | myStateFrameBlock.StatePointer[i].StateBlock = new LSO_Struct.StateBlock(); | 232 | myStateFrameBlock.StatePointer[i].StateBlock = new LSO_Struct.StateBlock(); |
233 | myStateFrameBlock.StatePointer[i].StateBlock.StartPos = (UInt32)fs.Position; // Note | 233 | myStateFrameBlock.StatePointer[i].StateBlock.StartPos = (UInt32)fs.Position; // Note |
234 | myStateFrameBlock.StatePointer[i].StateBlock.HeaderSize = BitConverter.ToUInt32(br_read(4), 0); | 234 | myStateFrameBlock.StatePointer[i].StateBlock.HeaderSize = BitConverter.ToUInt32(br_read(4), 0); |
235 | myStateFrameBlock.StatePointer[i].StateBlock.Unknown = br_read(1)[0]; | 235 | myStateFrameBlock.StatePointer[i].StateBlock.Unknown = br_read(1)[0]; |
236 | myStateFrameBlock.StatePointer[i].StateBlock.EndPos = (UInt32)fs.Position; // Note | 236 | myStateFrameBlock.StatePointer[i].StateBlock.EndPos = (UInt32)fs.Position; // Note |
237 | Common.SendToDebug("State block Start Pos: " + myStateFrameBlock.StatePointer[i].StateBlock.StartPos); | 237 | Common.SendToDebug("State block Start Pos: " + myStateFrameBlock.StatePointer[i].StateBlock.StartPos); |
238 | Common.SendToDebug("State block Header Size: " + myStateFrameBlock.StatePointer[i].StateBlock.HeaderSize); | 238 | Common.SendToDebug("State block Header Size: " + myStateFrameBlock.StatePointer[i].StateBlock.HeaderSize); |
239 | Common.SendToDebug("State block Header End Pos: " + myStateFrameBlock.StatePointer[i].StateBlock.EndPos); | 239 | Common.SendToDebug("State block Header End Pos: " + myStateFrameBlock.StatePointer[i].StateBlock.EndPos); |
240 | 240 | ||
241 | // We need to count number of bits flagged in EventMask? | 241 | // We need to count number of bits flagged in EventMask? |
242 | 242 | ||
243 | 243 | ||
244 | // for each bit in myStateFrameBlock.StatePointer[i].EventMask | 244 | // for each bit in myStateFrameBlock.StatePointer[i].EventMask |
245 | 245 | ||
246 | // ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE | 246 | // ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE |
247 | //TODO: Create event hooks | 247 | //TODO: Create event hooks |
248 | myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers = new LSO_Struct.StateBlockHandler[myStateFrameBlock.StatePointer[i].EventMask.Count - 1]; | 248 | myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers = new LSO_Struct.StateBlockHandler[myStateFrameBlock.StatePointer[i].EventMask.Count - 1]; |
249 | for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++) | 249 | for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++) |
250 | { | 250 | { |
251 | 251 | ||
252 | if (myStateFrameBlock.StatePointer[i].EventMask.Get(ii) == true) | 252 | if (myStateFrameBlock.StatePointer[i].EventMask.Get(ii) == true) |
253 | { | 253 | { |
254 | // We got an event | 254 | // We got an event |
255 | // READ: STATE BLOCK HANDLER | 255 | // READ: STATE BLOCK HANDLER |
256 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " HANDLER matching EVENT MASK " + ii + " (" + ((LSO_Enums.Event_Mask_Values)ii).ToString() + ") at: " + fs.Position); | 256 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " HANDLER matching EVENT MASK " + ii + " (" + ((LSO_Enums.Event_Mask_Values)ii).ToString() + ") at: " + fs.Position); |
257 | myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer = myStateFrameBlock.StatePointer[i].StateBlock.EndPos + BitConverter.ToUInt32(br_read(4), 0); | 257 | myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer = myStateFrameBlock.StatePointer[i].StateBlock.EndPos + BitConverter.ToUInt32(br_read(4), 0); |
258 | myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CallFrameSize = BitConverter.ToUInt32(br_read(4), 0); | 258 | myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CallFrameSize = BitConverter.ToUInt32(br_read(4), 0); |
259 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " HANDLER EVENT MASK " + ii + " (" + ((LSO_Enums.Event_Mask_Values)ii).ToString() + ") Code Chunk Pointer: " + myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer); | 259 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " HANDLER EVENT MASK " + ii + " (" + ((LSO_Enums.Event_Mask_Values)ii).ToString() + ") Code Chunk Pointer: " + myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer); |
260 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " HANDLER EVENT MASK " + ii + " (" + ((LSO_Enums.Event_Mask_Values)ii).ToString() + ") Call Frame Size: " + myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CallFrameSize); | 260 | Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " HANDLER EVENT MASK " + ii + " (" + ((LSO_Enums.Event_Mask_Values)ii).ToString() + ") Call Frame Size: " + myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CallFrameSize); |
261 | } | 261 | } |
262 | } | 262 | } |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | 268 | ||
269 | //// READ FUNCTION CODE CHUNKS | 269 | //// READ FUNCTION CODE CHUNKS |
270 | //// Functions + Function start pos (GFR) | 270 | //// Functions + Function start pos (GFR) |
271 | //// TODO: Somehow be able to identify and reference this | 271 | //// TODO: Somehow be able to identify and reference this |
272 | //LSO_Struct.CodeChunk[] myFunctionCodeChunk; | 272 | //LSO_Struct.CodeChunk[] myFunctionCodeChunk; |
273 | //if (myFunctionBlock.FunctionCount > 0) | 273 | //if (myFunctionBlock.FunctionCount > 0) |
274 | //{ | 274 | //{ |
275 | // myFunctionCodeChunk = new LSO_Struct.CodeChunk[myFunctionBlock.FunctionCount]; | 275 | // myFunctionCodeChunk = new LSO_Struct.CodeChunk[myFunctionBlock.FunctionCount]; |
276 | // for (int i = 0; i < myFunctionBlock.FunctionCount; i++) | 276 | // for (int i = 0; i < myFunctionBlock.FunctionCount; i++) |
277 | // { | 277 | // { |
278 | // Common.SendToDebug("Reading Function Code Chunk " + i); | 278 | // Common.SendToDebug("Reading Function Code Chunk " + i); |
279 | // myFunctionCodeChunk[i] = GetCodeChunk((UInt32)myFunctionBlock.CodeChunkPointer[i]); | 279 | // myFunctionCodeChunk[i] = GetCodeChunk((UInt32)myFunctionBlock.CodeChunkPointer[i]); |
280 | // } | 280 | // } |
281 | 281 | ||
282 | //} | 282 | //} |
283 | // READ EVENT CODE CHUNKS | 283 | // READ EVENT CODE CHUNKS |
284 | LSO_Struct.CodeChunk[] myEventCodeChunk; | 284 | LSO_Struct.CodeChunk[] myEventCodeChunk; |
285 | if (myStateFrameBlock.StateCount > 0) | 285 | if (myStateFrameBlock.StateCount > 0) |
286 | { | 286 | { |
287 | myEventCodeChunk = new LSO_Struct.CodeChunk[myStateFrameBlock.StateCount]; | 287 | myEventCodeChunk = new LSO_Struct.CodeChunk[myStateFrameBlock.StateCount]; |
288 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) | 288 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) |
289 | { | 289 | { |
290 | // TODO: Somehow organize events and functions so they can be found again, | 290 | // TODO: Somehow organize events and functions so they can be found again, |
291 | // two level search ain't no good | 291 | // two level search ain't no good |
292 | for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++) | 292 | for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++) |
293 | { | 293 | { |
294 | 294 | ||
295 | 295 | ||
296 | if (myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer > 0) | 296 | if (myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer > 0) |
297 | { | 297 | { |
298 | Common.SendToDebug("Reading Event Code Chunk state " + i + ", event " + (LSO_Enums.Event_Mask_Values)ii); | 298 | Common.SendToDebug("Reading Event Code Chunk state " + i + ", event " + (LSO_Enums.Event_Mask_Values)ii); |
299 | 299 | ||
300 | 300 | ||
301 | // Override a Method / Function | 301 | // Override a Method / Function |
302 | string eventname = i + "_event_" + (LSO_Enums.Event_Mask_Values)ii; | 302 | string eventname = i + "_event_" + (LSO_Enums.Event_Mask_Values)ii; |
303 | Common.SendToDebug("Event Name: " + eventname); | 303 | Common.SendToDebug("Event Name: " + eventname); |
304 | if (Common.IL_ProcessCodeChunks) | 304 | if (Common.IL_ProcessCodeChunks) |
305 | { | 305 | { |
306 | EventList.Add(eventname); | 306 | EventList.Add(eventname); |
307 | 307 | ||
308 | // JUMP TO CODE PROCESSOR | 308 | // JUMP TO CODE PROCESSOR |
309 | ProcessCodeChunk(myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer, typeBuilder, eventname); | 309 | ProcessCodeChunk(myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer, typeBuilder, eventname); |
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | } | 313 | } |
314 | 314 | ||
315 | } | 315 | } |
316 | 316 | ||
317 | } | 317 | } |
318 | 318 | ||
319 | 319 | ||
320 | 320 | ||
321 | 321 | ||
322 | if (Common.IL_CreateFunctionList) | 322 | if (Common.IL_CreateFunctionList) |
323 | IL_INSERT_FUNCTIONLIST(); | 323 | IL_INSERT_FUNCTIONLIST(); |
324 | 324 | ||
325 | } | 325 | } |
326 | 326 | ||
327 | internal LSO_Struct.HeapBlock GetHeap(UInt32 pos) | 327 | internal LSO_Struct.HeapBlock GetHeap(UInt32 pos) |
328 | { | 328 | { |
329 | // HEAP BLOCK | 329 | // HEAP BLOCK |
330 | // TODO:? Special read for strings/keys (null terminated) and lists (pointers to other HEAP entries) | 330 | // TODO:? Special read for strings/keys (null terminated) and lists (pointers to other HEAP entries) |
331 | Common.SendToDebug("Reading HEAP BLOCK at: " + pos); | 331 | Common.SendToDebug("Reading HEAP BLOCK at: " + pos); |
332 | fs.Seek(pos, SeekOrigin.Begin); | 332 | fs.Seek(pos, SeekOrigin.Begin); |
333 | 333 | ||
334 | LSO_Struct.HeapBlock myHeapBlock = new LSO_Struct.HeapBlock(); | 334 | LSO_Struct.HeapBlock myHeapBlock = new LSO_Struct.HeapBlock(); |
335 | myHeapBlock.DataBlockSize = BitConverter.ToInt32(br_read(4), 0); | 335 | myHeapBlock.DataBlockSize = BitConverter.ToInt32(br_read(4), 0); |
336 | myHeapBlock.ObjectType = br_read(1)[0]; | 336 | myHeapBlock.ObjectType = br_read(1)[0]; |
337 | myHeapBlock.ReferenceCount = BitConverter.ToUInt16(br_read(2), 0); | 337 | myHeapBlock.ReferenceCount = BitConverter.ToUInt16(br_read(2), 0); |
338 | //myHeapBlock.Data = br_read(getObjectSize(myHeapBlock.ObjectType)); | 338 | //myHeapBlock.Data = br_read(getObjectSize(myHeapBlock.ObjectType)); |
339 | // Don't read it reversed | 339 | // Don't read it reversed |
340 | myHeapBlock.Data = new byte[myHeapBlock.DataBlockSize - 1]; | 340 | myHeapBlock.Data = new byte[myHeapBlock.DataBlockSize - 1]; |
341 | br.Read(myHeapBlock.Data, 0, myHeapBlock.DataBlockSize - 1); | 341 | br.Read(myHeapBlock.Data, 0, myHeapBlock.DataBlockSize - 1); |
342 | 342 | ||
343 | 343 | ||
344 | Common.SendToDebug("Heap Block Data Block Size: " + myHeapBlock.DataBlockSize); | 344 | Common.SendToDebug("Heap Block Data Block Size: " + myHeapBlock.DataBlockSize); |
345 | Common.SendToDebug("Heap Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myHeapBlock.ObjectType).ToString()); | 345 | Common.SendToDebug("Heap Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myHeapBlock.ObjectType).ToString()); |
346 | Common.SendToDebug("Heap Block Reference Count: " + myHeapBlock.ReferenceCount); | 346 | Common.SendToDebug("Heap Block Reference Count: " + myHeapBlock.ReferenceCount); |
347 | 347 | ||
348 | return myHeapBlock; | 348 | return myHeapBlock; |
349 | } | 349 | } |
350 | private byte[] br_read(int len) | 350 | private byte[] br_read(int len) |
351 | { | 351 | { |
352 | if (len <= 0) | 352 | if (len <= 0) |
353 | return null; | 353 | return null; |
354 | 354 | ||
355 | try | 355 | try |
356 | { | 356 | { |
357 | byte[] bytes = new byte[len]; | 357 | byte[] bytes = new byte[len]; |
358 | for (int i = len - 1; i > -1; i--) | 358 | for (int i = len - 1; i > -1; i--) |
359 | bytes[i] = br.ReadByte(); | 359 | bytes[i] = br.ReadByte(); |
360 | return bytes; | 360 | return bytes; |
361 | } | 361 | } |
362 | catch (Exception e) | 362 | catch (Exception e) |
363 | { | 363 | { |
364 | Common.SendToDebug("Exception: " + e.ToString()); | 364 | Common.SendToDebug("Exception: " + e.ToString()); |
365 | throw (e); | 365 | throw (e); |
366 | } | 366 | } |
367 | } | 367 | } |
368 | //private byte[] br_read_smallendian(int len) | 368 | //private byte[] br_read_smallendian(int len) |
369 | //{ | 369 | //{ |
370 | // byte[] bytes = new byte[len]; | 370 | // byte[] bytes = new byte[len]; |
371 | // br.Read(bytes,0, len); | 371 | // br.Read(bytes,0, len); |
372 | // return bytes; | 372 | // return bytes; |
373 | //} | 373 | //} |
374 | private Type getLLObjectType(byte objectCode) | 374 | private Type getLLObjectType(byte objectCode) |
375 | { | 375 | { |
376 | switch ((LSO_Enums.Variable_Type_Codes)objectCode) | 376 | switch ((LSO_Enums.Variable_Type_Codes)objectCode) |
377 | { | 377 | { |
378 | case LSO_Enums.Variable_Type_Codes.Void: return typeof(void); | 378 | case LSO_Enums.Variable_Type_Codes.Void: return typeof(void); |
379 | case LSO_Enums.Variable_Type_Codes.Integer: return typeof(UInt32); | 379 | case LSO_Enums.Variable_Type_Codes.Integer: return typeof(UInt32); |
380 | case LSO_Enums.Variable_Type_Codes.Float: return typeof(float); | 380 | case LSO_Enums.Variable_Type_Codes.Float: return typeof(float); |
381 | case LSO_Enums.Variable_Type_Codes.String: return typeof(string); | 381 | case LSO_Enums.Variable_Type_Codes.String: return typeof(string); |
382 | case LSO_Enums.Variable_Type_Codes.Key: return typeof(string); | 382 | case LSO_Enums.Variable_Type_Codes.Key: return typeof(string); |
383 | case LSO_Enums.Variable_Type_Codes.Vector: return typeof(LSO_Enums.Vector); | 383 | case LSO_Enums.Variable_Type_Codes.Vector: return typeof(LSO_Enums.Vector); |
384 | case LSO_Enums.Variable_Type_Codes.Rotation: return typeof(LSO_Enums.Rotation); | 384 | case LSO_Enums.Variable_Type_Codes.Rotation: return typeof(LSO_Enums.Rotation); |
385 | case LSO_Enums.Variable_Type_Codes.List: | 385 | case LSO_Enums.Variable_Type_Codes.List: |
386 | Common.SendToDebug("TODO: List datatype not implemented yet!"); | 386 | Common.SendToDebug("TODO: List datatype not implemented yet!"); |
387 | return typeof(System.Collections.ArrayList); | 387 | return typeof(System.Collections.ArrayList); |
388 | case LSO_Enums.Variable_Type_Codes.Null: | 388 | case LSO_Enums.Variable_Type_Codes.Null: |
389 | Common.SendToDebug("TODO: Datatype null is not implemented, using string instead.!"); | 389 | Common.SendToDebug("TODO: Datatype null is not implemented, using string instead.!"); |
390 | return typeof(string); | 390 | return typeof(string); |
391 | default: | 391 | default: |
392 | Common.SendToDebug("Lookup of LSL datatype " + objectCode + " to .Net datatype failed: Unknown LSL datatype. Defaulting to object."); | 392 | Common.SendToDebug("Lookup of LSL datatype " + objectCode + " to .Net datatype failed: Unknown LSL datatype. Defaulting to object."); |
393 | return typeof(object); | 393 | return typeof(object); |
394 | } | 394 | } |
395 | } | 395 | } |
396 | private int getObjectSize(byte ObjectType) | 396 | private int getObjectSize(byte ObjectType) |
397 | { | 397 | { |
398 | switch ((LSO_Enums.Variable_Type_Codes)ObjectType) | 398 | switch ((LSO_Enums.Variable_Type_Codes)ObjectType) |
399 | { | 399 | { |
400 | case LSO_Enums.Variable_Type_Codes.Integer: | 400 | case LSO_Enums.Variable_Type_Codes.Integer: |
401 | case LSO_Enums.Variable_Type_Codes.Float: | 401 | case LSO_Enums.Variable_Type_Codes.Float: |
402 | case LSO_Enums.Variable_Type_Codes.String: | 402 | case LSO_Enums.Variable_Type_Codes.String: |
403 | case LSO_Enums.Variable_Type_Codes.Key: | 403 | case LSO_Enums.Variable_Type_Codes.Key: |
404 | case LSO_Enums.Variable_Type_Codes.List: | 404 | case LSO_Enums.Variable_Type_Codes.List: |
405 | return 4; | 405 | return 4; |
406 | case LSO_Enums.Variable_Type_Codes.Vector: | 406 | case LSO_Enums.Variable_Type_Codes.Vector: |
407 | return 12; | 407 | return 12; |
408 | case LSO_Enums.Variable_Type_Codes.Rotation: | 408 | case LSO_Enums.Variable_Type_Codes.Rotation: |
409 | return 16; | 409 | return 16; |
410 | default: | 410 | default: |
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
413 | } | 413 | } |
414 | private string Read_String() | 414 | private string Read_String() |
415 | { | 415 | { |
416 | string ret = ""; | 416 | string ret = ""; |
417 | byte reader = br_read(1)[0]; | 417 | byte reader = br_read(1)[0]; |
418 | while (reader != 0x000) | 418 | while (reader != 0x000) |
419 | { | 419 | { |
420 | ret += (char)reader; | 420 | ret += (char)reader; |
421 | reader = br_read(1)[0]; | 421 | reader = br_read(1)[0]; |
422 | } | 422 | } |
423 | return ret; | 423 | return ret; |
424 | } | 424 | } |
425 | 425 | ||
426 | /// <summary> | 426 | /// <summary> |
427 | /// Reads a code chunk and creates IL | 427 | /// Reads a code chunk and creates IL |
428 | /// </summary> | 428 | /// </summary> |
429 | /// <param name="pos">Absolute position in file. REMEMBER TO ADD myHeader.GFR!</param> | 429 | /// <param name="pos">Absolute position in file. REMEMBER TO ADD myHeader.GFR!</param> |
430 | /// <param name="typeBuilder">TypeBuilder for assembly</param> | 430 | /// <param name="typeBuilder">TypeBuilder for assembly</param> |
431 | /// <param name="eventname">Name of event (function) to generate</param> | 431 | /// <param name="eventname">Name of event (function) to generate</param> |
432 | private void ProcessCodeChunk(UInt32 pos, TypeBuilder typeBuilder, string eventname) | 432 | private void ProcessCodeChunk(UInt32 pos, TypeBuilder typeBuilder, string eventname) |
433 | { | 433 | { |
434 | 434 | ||
435 | LSO_Struct.CodeChunk myCodeChunk = new LSO_Struct.CodeChunk(); | 435 | LSO_Struct.CodeChunk myCodeChunk = new LSO_Struct.CodeChunk(); |
436 | 436 | ||
437 | Common.SendToDebug("Reading Function Code Chunk at: " + pos); | 437 | Common.SendToDebug("Reading Function Code Chunk at: " + pos); |
438 | fs.Seek(pos, SeekOrigin.Begin); | 438 | fs.Seek(pos, SeekOrigin.Begin); |
439 | myCodeChunk.CodeChunkHeaderSize = BitConverter.ToUInt32(br_read(4), 0); | 439 | myCodeChunk.CodeChunkHeaderSize = BitConverter.ToUInt32(br_read(4), 0); |
440 | Common.SendToDebug("CodeChunk Header Size: " + myCodeChunk.CodeChunkHeaderSize); | 440 | Common.SendToDebug("CodeChunk Header Size: " + myCodeChunk.CodeChunkHeaderSize); |
441 | // Read until null | 441 | // Read until null |
442 | myCodeChunk.Comment = Read_String(); | 442 | myCodeChunk.Comment = Read_String(); |
443 | Common.SendToDebug("Function comment: " + myCodeChunk.Comment); | 443 | Common.SendToDebug("Function comment: " + myCodeChunk.Comment); |
444 | myCodeChunk.ReturnTypePos = br_read(1)[0]; | 444 | myCodeChunk.ReturnTypePos = br_read(1)[0]; |
445 | myCodeChunk.ReturnType = GetStaticBlock((long)myCodeChunk.ReturnTypePos + (long)myHeader.GVR); | 445 | myCodeChunk.ReturnType = GetStaticBlock((long)myCodeChunk.ReturnTypePos + (long)myHeader.GVR); |
446 | Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " + ((LSO_Enums.Variable_Type_Codes)myCodeChunk.ReturnType.ObjectType).ToString()); | 446 | Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " + ((LSO_Enums.Variable_Type_Codes)myCodeChunk.ReturnType.ObjectType).ToString()); |
447 | 447 | ||
448 | 448 | ||
449 | // TODO: How to determine number of codechunks -- does this method work? | 449 | // TODO: How to determine number of codechunks -- does this method work? |
450 | myCodeChunk.CodeChunkArguments = new System.Collections.Generic.List<LSO_Struct.CodeChunkArgument>(); | 450 | myCodeChunk.CodeChunkArguments = new System.Collections.Generic.List<LSO_Struct.CodeChunkArgument>(); |
451 | byte reader = br_read(1)[0]; | 451 | byte reader = br_read(1)[0]; |
452 | reader = br_read(1)[0]; | 452 | reader = br_read(1)[0]; |
453 | 453 | ||
454 | // NOTE ON CODE CHUNK ARGUMENTS | 454 | // NOTE ON CODE CHUNK ARGUMENTS |
455 | // This determins type definition | 455 | // This determins type definition |
456 | int ccount = 0; | 456 | int ccount = 0; |
457 | while (reader != 0x000) | 457 | while (reader != 0x000) |
458 | { | 458 | { |
459 | ccount++; | 459 | ccount++; |
460 | Common.SendToDebug("Reading Code Chunk Argument " + ccount); | 460 | Common.SendToDebug("Reading Code Chunk Argument " + ccount); |
461 | LSO_Struct.CodeChunkArgument CCA = new LSO_Struct.CodeChunkArgument(); | 461 | LSO_Struct.CodeChunkArgument CCA = new LSO_Struct.CodeChunkArgument(); |
462 | CCA.FunctionReturnTypePos = reader; | 462 | CCA.FunctionReturnTypePos = reader; |
463 | reader = br_read(1)[0]; | 463 | reader = br_read(1)[0]; |
464 | CCA.NullString = reader; | 464 | CCA.NullString = reader; |
465 | CCA.FunctionReturnType = GetStaticBlock(CCA.FunctionReturnTypePos + myHeader.GVR); | 465 | CCA.FunctionReturnType = GetStaticBlock(CCA.FunctionReturnTypePos + myHeader.GVR); |
466 | myCodeChunk.CodeChunkArguments.Add(CCA); | 466 | myCodeChunk.CodeChunkArguments.Add(CCA); |
467 | Common.SendToDebug("Code Chunk Argument " + ccount + " type #" + CCA.FunctionReturnType.ObjectType + ": " + (LSO_Enums.Variable_Type_Codes)CCA.FunctionReturnType.ObjectType); | 467 | Common.SendToDebug("Code Chunk Argument " + ccount + " type #" + CCA.FunctionReturnType.ObjectType + ": " + (LSO_Enums.Variable_Type_Codes)CCA.FunctionReturnType.ObjectType); |
468 | } | 468 | } |
469 | // Create string array | 469 | // Create string array |
470 | Type[] MethodArgs = new Type[myCodeChunk.CodeChunkArguments.Count]; | 470 | Type[] MethodArgs = new Type[myCodeChunk.CodeChunkArguments.Count]; |
471 | for (int _ic = 0; _ic < myCodeChunk.CodeChunkArguments.Count; _ic++) | 471 | for (int _ic = 0; _ic < myCodeChunk.CodeChunkArguments.Count; _ic++) |
472 | { | 472 | { |
473 | MethodArgs[_ic] = getLLObjectType(myCodeChunk.CodeChunkArguments[_ic].FunctionReturnType.ObjectType); | 473 | MethodArgs[_ic] = getLLObjectType(myCodeChunk.CodeChunkArguments[_ic].FunctionReturnType.ObjectType); |
474 | Common.SendToDebug("Method argument " + _ic + ": " + getLLObjectType(myCodeChunk.CodeChunkArguments[_ic].FunctionReturnType.ObjectType).ToString()); | 474 | Common.SendToDebug("Method argument " + _ic + ": " + getLLObjectType(myCodeChunk.CodeChunkArguments[_ic].FunctionReturnType.ObjectType).ToString()); |
475 | } | 475 | } |
476 | // End marker is 0x000 | 476 | // End marker is 0x000 |
477 | myCodeChunk.EndMarker = reader; | 477 | myCodeChunk.EndMarker = reader; |
478 | 478 | ||
479 | 479 | ||
480 | // | 480 | // |
481 | // Emit: START OF METHOD (FUNCTION) | 481 | // Emit: START OF METHOD (FUNCTION) |
482 | // | 482 | // |
483 | 483 | ||
484 | Common.SendToDebug("CLR:" + eventname + ":MethodBuilder methodBuilder = typeBuilder.DefineMethod..."); | 484 | Common.SendToDebug("CLR:" + eventname + ":MethodBuilder methodBuilder = typeBuilder.DefineMethod..."); |
485 | MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname, | 485 | MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname, |
486 | MethodAttributes.Public, | 486 | MethodAttributes.Public, |
487 | typeof(void), | 487 | typeof(void), |
488 | new Type[] { typeof(object) }); | 488 | new Type[] { typeof(object) }); |
489 | //MethodArgs); | 489 | //MethodArgs); |
490 | //typeof(void), //getLLObjectType(myCodeChunk.ReturnType), | 490 | //typeof(void), //getLLObjectType(myCodeChunk.ReturnType), |
491 | // new Type[] { typeof(object) }, //); | 491 | // new Type[] { typeof(object) }, //); |
492 | 492 | ||
493 | //Common.SendToDebug("CLR:" + eventname + ":typeBuilder.DefineMethodOverride(methodBuilder..."); | 493 | //Common.SendToDebug("CLR:" + eventname + ":typeBuilder.DefineMethodOverride(methodBuilder..."); |
494 | //typeBuilder.DefineMethodOverride(methodBuilder, | 494 | //typeBuilder.DefineMethodOverride(methodBuilder, |
495 | // typeof(LSL_CLRInterface.LSLScript).GetMethod(eventname)); | 495 | // typeof(LSL_CLRInterface.LSLScript).GetMethod(eventname)); |
496 | 496 | ||
497 | // Create the IL generator | 497 | // Create the IL generator |
498 | 498 | ||
499 | Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();"); | 499 | Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();"); |
500 | ILGenerator il = methodBuilder.GetILGenerator(); | 500 | ILGenerator il = methodBuilder.GetILGenerator(); |
501 | 501 | ||
502 | 502 | ||
503 | if (Common.IL_UseTryCatch) | 503 | if (Common.IL_UseTryCatch) |
504 | IL_INSERT_TRY(il, eventname); | 504 | IL_INSERT_TRY(il, eventname); |
505 | 505 | ||
506 | 506 | ||
507 | 507 | ||
508 | // Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!"); | 508 | // Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!"); |
509 | //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); | 509 | //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); |
510 | //il.Emit(OpCodes.Call, typeof(Console).GetMethod | 510 | //il.Emit(OpCodes.Call, typeof(Console).GetMethod |
511 | // ("WriteLine", new Type[] { typeof(string) })); | 511 | // ("WriteLine", new Type[] { typeof(string) })); |
512 | 512 | ||
513 | //Common.SendToDebug("STARTUP: il.Emit(OpCodes.Ldc_I4_S, 0);"); | 513 | //Common.SendToDebug("STARTUP: il.Emit(OpCodes.Ldc_I4_S, 0);"); |
514 | 514 | ||
515 | //il.Emit(OpCodes.Ldc_I4_S, 0); | 515 | //il.Emit(OpCodes.Ldc_I4_S, 0); |
516 | for (int _ic = 0; _ic < myCodeChunk.CodeChunkArguments.Count; _ic++) | 516 | for (int _ic = 0; _ic < myCodeChunk.CodeChunkArguments.Count; _ic++) |
517 | { | 517 | { |
518 | Common.SendToDebug("PARAMS: il.Emit(OpCodes.Ldarg, " + _ic + ");"); | 518 | Common.SendToDebug("PARAMS: il.Emit(OpCodes.Ldarg, " + _ic + ");"); |
519 | il.Emit(OpCodes.Ldarg, _ic); | 519 | il.Emit(OpCodes.Ldarg, _ic); |
520 | } | 520 | } |
521 | 521 | ||
522 | 522 | ||
523 | 523 | ||
524 | // | 524 | // |
525 | // CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL | 525 | // CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL |
526 | // | 526 | // |
527 | bool FoundRet = false; | 527 | bool FoundRet = false; |
528 | while (FoundRet == false) | 528 | while (FoundRet == false) |
529 | { | 529 | { |
530 | FoundRet = LSL_PROCESS_OPCODE(il); | 530 | FoundRet = LSL_PROCESS_OPCODE(il); |
531 | } | 531 | } |
532 | 532 | ||
533 | 533 | ||
534 | if (Common.IL_UseTryCatch) | 534 | if (Common.IL_UseTryCatch) |
535 | IL_INSERT_END_TRY(il, eventname); | 535 | IL_INSERT_END_TRY(il, eventname); |
536 | 536 | ||
537 | // Emit: RETURN FROM METHOD | 537 | // Emit: RETURN FROM METHOD |
538 | il.Emit(OpCodes.Ret); | 538 | il.Emit(OpCodes.Ret); |
539 | 539 | ||
540 | return; | 540 | return; |
541 | 541 | ||
542 | } | 542 | } |
543 | 543 | ||
544 | private void IL_INSERT_FUNCTIONLIST() | 544 | private void IL_INSERT_FUNCTIONLIST() |
545 | { | 545 | { |
546 | 546 | ||
547 | Common.SendToDebug("Creating function list"); | 547 | Common.SendToDebug("Creating function list"); |
548 | 548 | ||
549 | 549 | ||
550 | string eventname = "GetFunctions"; | 550 | string eventname = "GetFunctions"; |
551 | 551 | ||
552 | Common.SendToDebug("Creating IL " + eventname); | 552 | Common.SendToDebug("Creating IL " + eventname); |
553 | // Define a private String field. | 553 | // Define a private String field. |
554 | //FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public); | 554 | //FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public); |
555 | 555 | ||
556 | 556 | ||
557 | //FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private); | 557 | //FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private); |
558 | 558 | ||
559 | 559 | ||
560 | 560 | ||
561 | MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname, | 561 | MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname, |
562 | MethodAttributes.Public, | 562 | MethodAttributes.Public, |
563 | typeof(string[]), | 563 | typeof(string[]), |
564 | null); | 564 | null); |
565 | 565 | ||
566 | //typeBuilder.DefineMethodOverride(methodBuilder, | 566 | //typeBuilder.DefineMethodOverride(methodBuilder, |
567 | // typeof(LSL_CLRInterface.LSLScript).GetMethod(eventname)); | 567 | // typeof(LSL_CLRInterface.LSLScript).GetMethod(eventname)); |
568 | 568 | ||
569 | ILGenerator il = methodBuilder.GetILGenerator(); | 569 | ILGenerator il = methodBuilder.GetILGenerator(); |
570 | 570 | ||
571 | 571 | ||
572 | 572 | ||
573 | 573 | ||
574 | // IL_INSERT_TRY(il, eventname); | 574 | // IL_INSERT_TRY(il, eventname); |
575 | 575 | ||
576 | // // Push string to stack | 576 | // // Push string to stack |
577 | // il.Emit(OpCodes.Ldstr, "Inside " + eventname); | 577 | // il.Emit(OpCodes.Ldstr, "Inside " + eventname); |
578 | 578 | ||
579 | //// Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!"); | 579 | //// Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!"); |
580 | //il.Emit(OpCodes.Call, typeof(Console).GetMethod | 580 | //il.Emit(OpCodes.Call, typeof(Console).GetMethod |
581 | // ("WriteLine", new Type[] { typeof(string) })); | 581 | // ("WriteLine", new Type[] { typeof(string) })); |
582 | 582 | ||
583 | //initIL.Emit(OpCodes.Newobj, typeof(string[])); | 583 | //initIL.Emit(OpCodes.Newobj, typeof(string[])); |
584 | 584 | ||
585 | //string[] MyArray = new string[2] { "TestItem1" , "TestItem2" }; | 585 | //string[] MyArray = new string[2] { "TestItem1" , "TestItem2" }; |
586 | 586 | ||
587 | ////il.Emit(OpCodes.Ldarg_0); | 587 | ////il.Emit(OpCodes.Ldarg_0); |
588 | 588 | ||
589 | il.DeclareLocal(typeof(string[])); | 589 | il.DeclareLocal(typeof(string[])); |
590 | 590 | ||
591 | ////il.Emit(OpCodes.Ldarg_0); | 591 | ////il.Emit(OpCodes.Ldarg_0); |
592 | il.Emit(OpCodes.Ldc_I4, EventList.Count); // Specify array length | 592 | il.Emit(OpCodes.Ldc_I4, EventList.Count); // Specify array length |
593 | il.Emit(OpCodes.Newarr, typeof(String)); // create new string array | 593 | il.Emit(OpCodes.Newarr, typeof(String)); // create new string array |
594 | il.Emit(OpCodes.Stloc_0); // Store array as local variable 0 in stack | 594 | il.Emit(OpCodes.Stloc_0); // Store array as local variable 0 in stack |
595 | ////SetFunctionList | 595 | ////SetFunctionList |
596 | 596 | ||
597 | for (int lv = 0; lv < EventList.Count; lv++) | 597 | for (int lv = 0; lv < EventList.Count; lv++) |
598 | { | 598 | { |
599 | il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack | 599 | il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack |
600 | il.Emit(OpCodes.Ldc_I4, lv); // Push index position | 600 | il.Emit(OpCodes.Ldc_I4, lv); // Push index position |
601 | il.Emit(OpCodes.Ldstr, EventList[lv]); // Push value | 601 | il.Emit(OpCodes.Ldstr, EventList[lv]); // Push value |
602 | il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value | 602 | il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value |
603 | 603 | ||
604 | //il.Emit(OpCodes.Ldarg_0); | 604 | //il.Emit(OpCodes.Ldarg_0); |
605 | //il.Emit(OpCodes.Ldstr, EventList[lv]); // Push value | 605 | //il.Emit(OpCodes.Ldstr, EventList[lv]); // Push value |
606 | //il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) })); | 606 | //il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) })); |
607 | 607 | ||
608 | } | 608 | } |
609 | 609 | ||
610 | 610 | ||
611 | 611 | ||
612 | // IL_INSERT_END_TRY(il, eventname); | 612 | // IL_INSERT_END_TRY(il, eventname); |
613 | 613 | ||
614 | 614 | ||
615 | il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack | 615 | il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack |
616 | // il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) })); | 616 | // il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) })); |
617 | 617 | ||
618 | il.Emit(OpCodes.Ret); // Return | 618 | il.Emit(OpCodes.Ret); // Return |
619 | 619 | ||
620 | } | 620 | } |
621 | 621 | ||
622 | 622 | ||
623 | private void IL_INSERT_TRY(ILGenerator il, string eventname) | 623 | private void IL_INSERT_TRY(ILGenerator il, string eventname) |
624 | { | 624 | { |
625 | /* | 625 | /* |
626 | * CLR TRY | 626 | * CLR TRY |
627 | */ | 627 | */ |
628 | //Common.SendToDebug("CLR:" + eventname + ":il.BeginExceptionBlock()"); | 628 | //Common.SendToDebug("CLR:" + eventname + ":il.BeginExceptionBlock()"); |
629 | il.BeginExceptionBlock(); | 629 | il.BeginExceptionBlock(); |
630 | 630 | ||
631 | // Push "Hello World!" string to stack | 631 | // Push "Hello World!" string to stack |
632 | //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Ldstr..."); | 632 | //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Ldstr..."); |
633 | //il.Emit(OpCodes.Ldstr, "Starting CLR dynamic execution of: " + eventname); | 633 | //il.Emit(OpCodes.Ldstr, "Starting CLR dynamic execution of: " + eventname); |
634 | 634 | ||
635 | } | 635 | } |
636 | 636 | ||
637 | private void IL_INSERT_END_TRY(ILGenerator il, string eventname) | 637 | private void IL_INSERT_END_TRY(ILGenerator il, string eventname) |
638 | { | 638 | { |
639 | /* | 639 | /* |
640 | * CATCH | 640 | * CATCH |
641 | */ | 641 | */ |
642 | Common.SendToDebug("CLR:" + eventname + ":il.BeginCatchBlock(typeof(Exception));"); | 642 | Common.SendToDebug("CLR:" + eventname + ":il.BeginCatchBlock(typeof(Exception));"); |
643 | il.BeginCatchBlock(typeof(Exception)); | 643 | il.BeginCatchBlock(typeof(Exception)); |
644 | 644 | ||
645 | // Push "Hello World!" string to stack | 645 | // Push "Hello World!" string to stack |
646 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Ldstr..."); | 646 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Ldstr..."); |
647 | il.Emit(OpCodes.Ldstr, "Execption executing dynamic CLR function " + eventname + ": "); | 647 | il.Emit(OpCodes.Ldstr, "Execption executing dynamic CLR function " + eventname + ": "); |
648 | 648 | ||
649 | //call void [mscorlib]System.Console::WriteLine(string) | 649 | //call void [mscorlib]System.Console::WriteLine(string) |
650 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); | 650 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); |
651 | il.Emit(OpCodes.Call, typeof(Console).GetMethod | 651 | il.Emit(OpCodes.Call, typeof(Console).GetMethod |
652 | ("Write", new Type[] { typeof(string) })); | 652 | ("Write", new Type[] { typeof(string) })); |
653 | 653 | ||
654 | //callvirt instance string [mscorlib]System.Exception::get_Message() | 654 | //callvirt instance string [mscorlib]System.Exception::get_Message() |
655 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Callvirt..."); | 655 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Callvirt..."); |
656 | il.Emit(OpCodes.Callvirt, typeof(Exception).GetMethod | 656 | il.Emit(OpCodes.Callvirt, typeof(Exception).GetMethod |
657 | ("get_Message")); | 657 | ("get_Message")); |
658 | 658 | ||
659 | //call void [mscorlib]System.Console::WriteLine(string) | 659 | //call void [mscorlib]System.Console::WriteLine(string) |
660 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); | 660 | Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); |
661 | il.Emit(OpCodes.Call, typeof(Console).GetMethod | 661 | il.Emit(OpCodes.Call, typeof(Console).GetMethod |
662 | ("WriteLine", new Type[] { typeof(string) })); | 662 | ("WriteLine", new Type[] { typeof(string) })); |
663 | 663 | ||
664 | /* | 664 | /* |
665 | * CLR END TRY | 665 | * CLR END TRY |
666 | */ | 666 | */ |
667 | //Common.SendToDebug("CLR:" + eventname + ":il.EndExceptionBlock();"); | 667 | //Common.SendToDebug("CLR:" + eventname + ":il.EndExceptionBlock();"); |
668 | il.EndExceptionBlock(); | 668 | il.EndExceptionBlock(); |
669 | } | 669 | } |
670 | 670 | ||
671 | private LSO_Struct.StaticBlock GetStaticBlock(long pos) | 671 | private LSO_Struct.StaticBlock GetStaticBlock(long pos) |
672 | { | 672 | { |
673 | long FirstPos = fs.Position; | 673 | long FirstPos = fs.Position; |
674 | try | 674 | try |
675 | { | 675 | { |
676 | UInt32 position = (UInt32)pos; | 676 | UInt32 position = (UInt32)pos; |
677 | // STATIC BLOCK | 677 | // STATIC BLOCK |
678 | Common.SendToDebug("Reading STATIC BLOCK at: " + position); | 678 | Common.SendToDebug("Reading STATIC BLOCK at: " + position); |
679 | fs.Seek(position, SeekOrigin.Begin); | 679 | fs.Seek(position, SeekOrigin.Begin); |
680 | 680 | ||
681 | if (StaticBlocks.ContainsKey(position) == true) | 681 | if (StaticBlocks.ContainsKey(position) == true) |
682 | { | 682 | { |
683 | Common.SendToDebug("Found cached STATIC BLOCK"); | 683 | Common.SendToDebug("Found cached STATIC BLOCK"); |
684 | 684 | ||
685 | 685 | ||
686 | 686 | ||
687 | return StaticBlocks[pos]; | 687 | return StaticBlocks[pos]; |
688 | } | 688 | } |
689 | 689 | ||
690 | //int StaticBlockCount = 0; | 690 | //int StaticBlockCount = 0; |
691 | // Read function blocks until we hit GFR | 691 | // Read function blocks until we hit GFR |
692 | //while (fs.Position < myHeader.GFR) | 692 | //while (fs.Position < myHeader.GFR) |
693 | //{ | 693 | //{ |
694 | //StaticBlockCount++; | 694 | //StaticBlockCount++; |
695 | 695 | ||
696 | //Common.SendToDebug("Reading Static Block at: " + position); | 696 | //Common.SendToDebug("Reading Static Block at: " + position); |
697 | 697 | ||
698 | //fs.Seek(myHeader.GVR, SeekOrigin.Begin); | 698 | //fs.Seek(myHeader.GVR, SeekOrigin.Begin); |
699 | LSO_Struct.StaticBlock myStaticBlock = new LSO_Struct.StaticBlock(); | 699 | LSO_Struct.StaticBlock myStaticBlock = new LSO_Struct.StaticBlock(); |
700 | myStaticBlock.Static_Chunk_Header_Size = BitConverter.ToUInt32(br_read(4), 0); | 700 | myStaticBlock.Static_Chunk_Header_Size = BitConverter.ToUInt32(br_read(4), 0); |
701 | myStaticBlock.ObjectType = br_read(1)[0]; | 701 | myStaticBlock.ObjectType = br_read(1)[0]; |
702 | Common.SendToDebug("Static Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myStaticBlock.ObjectType).ToString()); | 702 | Common.SendToDebug("Static Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myStaticBlock.ObjectType).ToString()); |
703 | myStaticBlock.Unknown = br_read(1)[0]; | 703 | myStaticBlock.Unknown = br_read(1)[0]; |
704 | // Size of datatype varies | 704 | // Size of datatype varies |
705 | if (myStaticBlock.ObjectType != 0) | 705 | if (myStaticBlock.ObjectType != 0) |
706 | myStaticBlock.BlockVariable = br_read(getObjectSize(myStaticBlock.ObjectType)); | 706 | myStaticBlock.BlockVariable = br_read(getObjectSize(myStaticBlock.ObjectType)); |
707 | 707 | ||
708 | StaticBlocks.Add(position, myStaticBlock); | 708 | StaticBlocks.Add(position, myStaticBlock); |
709 | //} | 709 | //} |
710 | Common.SendToDebug("Done reading Static Block."); | 710 | Common.SendToDebug("Done reading Static Block."); |
711 | return myStaticBlock; | 711 | return myStaticBlock; |
712 | } | 712 | } |
713 | finally | 713 | finally |
714 | { | 714 | { |
715 | // Go back to original read pos | 715 | // Go back to original read pos |
716 | fs.Seek(FirstPos, SeekOrigin.Begin); | 716 | fs.Seek(FirstPos, SeekOrigin.Begin); |
717 | } | 717 | } |
718 | 718 | ||
719 | } | 719 | } |
720 | 720 | ||
721 | } | 721 | } |
722 | } | 722 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Struct.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Struct.cs index 53d1318..baeda38 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Struct.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSO/LSO_Struct.cs | |||
@@ -1,135 +1,135 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | 29 | ||
30 | using System; | 30 | using System; |
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Text; | 32 | using System.Text; |
33 | 33 | ||
34 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO | 34 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO |
35 | { | 35 | { |
36 | static class LSO_Struct | 36 | static class LSO_Struct |
37 | { | 37 | { |
38 | 38 | ||
39 | public struct Header | 39 | public struct Header |
40 | { | 40 | { |
41 | public UInt32 TM; | 41 | public UInt32 TM; |
42 | public UInt32 IP; | 42 | public UInt32 IP; |
43 | public UInt32 VN; | 43 | public UInt32 VN; |
44 | public UInt32 BP; | 44 | public UInt32 BP; |
45 | public UInt32 SP; | 45 | public UInt32 SP; |
46 | public UInt32 HR; | 46 | public UInt32 HR; |
47 | public UInt32 HP; | 47 | public UInt32 HP; |
48 | public UInt32 CS; | 48 | public UInt32 CS; |
49 | public UInt32 NS; | 49 | public UInt32 NS; |
50 | public UInt32 CE; | 50 | public UInt32 CE; |
51 | public UInt32 IE; | 51 | public UInt32 IE; |
52 | public UInt32 ER; | 52 | public UInt32 ER; |
53 | public UInt32 FR; | 53 | public UInt32 FR; |
54 | public UInt32 SLR; | 54 | public UInt32 SLR; |
55 | public UInt32 GVR; | 55 | public UInt32 GVR; |
56 | public UInt32 GFR; | 56 | public UInt32 GFR; |
57 | public UInt32 PR; | 57 | public UInt32 PR; |
58 | public UInt32 ESR; | 58 | public UInt32 ESR; |
59 | public UInt32 SR; | 59 | public UInt32 SR; |
60 | public UInt64 NCE; | 60 | public UInt64 NCE; |
61 | public UInt64 NIE; | 61 | public UInt64 NIE; |
62 | public UInt64 NER; | 62 | public UInt64 NER; |
63 | } | 63 | } |
64 | 64 | ||
65 | public struct StaticBlock | 65 | public struct StaticBlock |
66 | { | 66 | { |
67 | public UInt32 Static_Chunk_Header_Size; | 67 | public UInt32 Static_Chunk_Header_Size; |
68 | public byte ObjectType; | 68 | public byte ObjectType; |
69 | public byte Unknown; | 69 | public byte Unknown; |
70 | public byte[] BlockVariable; | 70 | public byte[] BlockVariable; |
71 | } | 71 | } |
72 | /* Not actually a structure | 72 | /* Not actually a structure |
73 | public struct StaticBlockVariable | 73 | public struct StaticBlockVariable |
74 | { | 74 | { |
75 | public UInt32 Integer1; | 75 | public UInt32 Integer1; |
76 | public UInt32 Float1; | 76 | public UInt32 Float1; |
77 | public UInt32 HeapPointer_String; | 77 | public UInt32 HeapPointer_String; |
78 | public UInt32 HeapPointer_Key; | 78 | public UInt32 HeapPointer_Key; |
79 | public byte[] Vector_12; | 79 | public byte[] Vector_12; |
80 | public byte[] Rotation_16; | 80 | public byte[] Rotation_16; |
81 | public UInt32 Pointer_List_Structure; | 81 | public UInt32 Pointer_List_Structure; |
82 | } */ | 82 | } */ |
83 | public struct HeapBlock | 83 | public struct HeapBlock |
84 | { | 84 | { |
85 | public Int32 DataBlockSize; | 85 | public Int32 DataBlockSize; |
86 | public byte ObjectType; | 86 | public byte ObjectType; |
87 | public UInt16 ReferenceCount; | 87 | public UInt16 ReferenceCount; |
88 | public byte[] Data; | 88 | public byte[] Data; |
89 | } | 89 | } |
90 | public struct StateFrameBlock | 90 | public struct StateFrameBlock |
91 | { | 91 | { |
92 | public UInt32 StateCount; | 92 | public UInt32 StateCount; |
93 | public StatePointerBlock[] StatePointer; | 93 | public StatePointerBlock[] StatePointer; |
94 | } | 94 | } |
95 | public struct StatePointerBlock | 95 | public struct StatePointerBlock |
96 | { | 96 | { |
97 | public UInt32 Location; | 97 | public UInt32 Location; |
98 | public System.Collections.BitArray EventMask; | 98 | public System.Collections.BitArray EventMask; |
99 | public StateBlock StateBlock; | 99 | public StateBlock StateBlock; |
100 | } | 100 | } |
101 | public struct StateBlock | 101 | public struct StateBlock |
102 | { | 102 | { |
103 | public UInt32 StartPos; | 103 | public UInt32 StartPos; |
104 | public UInt32 EndPos; | 104 | public UInt32 EndPos; |
105 | public UInt32 HeaderSize; | 105 | public UInt32 HeaderSize; |
106 | public byte Unknown; | 106 | public byte Unknown; |
107 | public StateBlockHandler[] StateBlockHandlers; | 107 | public StateBlockHandler[] StateBlockHandlers; |
108 | } | 108 | } |
109 | public struct StateBlockHandler | 109 | public struct StateBlockHandler |
110 | { | 110 | { |
111 | public UInt32 CodeChunkPointer; | 111 | public UInt32 CodeChunkPointer; |
112 | public UInt32 CallFrameSize; | 112 | public UInt32 CallFrameSize; |
113 | } | 113 | } |
114 | public struct FunctionBlock | 114 | public struct FunctionBlock |
115 | { | 115 | { |
116 | public UInt32 FunctionCount; | 116 | public UInt32 FunctionCount; |
117 | public UInt32[] CodeChunkPointer; | 117 | public UInt32[] CodeChunkPointer; |
118 | } | 118 | } |
119 | public struct CodeChunk | 119 | public struct CodeChunk |
120 | { | 120 | { |
121 | public UInt32 CodeChunkHeaderSize; | 121 | public UInt32 CodeChunkHeaderSize; |
122 | public string Comment; | 122 | public string Comment; |
123 | public System.Collections.Generic.List<CodeChunkArgument> CodeChunkArguments; | 123 | public System.Collections.Generic.List<CodeChunkArgument> CodeChunkArguments; |
124 | public byte EndMarker; | 124 | public byte EndMarker; |
125 | public byte ReturnTypePos; | 125 | public byte ReturnTypePos; |
126 | public StaticBlock ReturnType; | 126 | public StaticBlock ReturnType; |
127 | } | 127 | } |
128 | public struct CodeChunkArgument | 128 | public struct CodeChunkArgument |
129 | { | 129 | { |
130 | public byte FunctionReturnTypePos; | 130 | public byte FunctionReturnTypePos; |
131 | public byte NullString; | 131 | public byte NullString; |
132 | public StaticBlock FunctionReturnType; | 132 | public StaticBlock FunctionReturnType; |
133 | } | 133 | } |
134 | } | 134 | } |
135 | } | 135 | } |
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 8f9f4e9..c98da48 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 | |||
@@ -1,770 +1,770 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | using OpenSim.Region.Environment.Scenes; | 5 | using OpenSim.Region.Environment.Scenes; |
6 | using OpenSim.Region.Environment.Scenes.Scripting; | 6 | using OpenSim.Region.Environment.Scenes.Scripting; |
7 | using OpenSim.Region.Environment.Interfaces; | 7 | using OpenSim.Region.Environment.Interfaces; |
8 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | 8 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; |
9 | using OpenSim.Region.ScriptEngine.Common; | 9 | using OpenSim.Region.ScriptEngine.Common; |
10 | using OpenSim.Framework.Console; | 10 | using OpenSim.Framework.Console; |
11 | using OpenSim.Framework.Utilities; | 11 | using OpenSim.Framework.Utilities; |
12 | using System.Runtime.Remoting.Lifetime; | 12 | using System.Runtime.Remoting.Lifetime; |
13 | 13 | ||
14 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | 14 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler |
15 | { | 15 | { |
16 | 16 | ||
17 | /// <summary> | 17 | /// <summary> |
18 | /// Contains all LSL ll-functions. This class will be in Default AppDomain. | 18 | /// Contains all LSL ll-functions. This class will be in Default AppDomain. |
19 | /// </summary> | 19 | /// </summary> |
20 | public class LSL_BuiltIn_Commands: MarshalByRefObject, LSL_BuiltIn_Commands_Interface | 20 | public class LSL_BuiltIn_Commands: MarshalByRefObject, LSL_BuiltIn_Commands_Interface |
21 | { | 21 | { |
22 | 22 | ||
23 | private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | 23 | private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); |
24 | private ScriptEngine m_ScriptEngine; | 24 | private ScriptEngine m_ScriptEngine; |
25 | private IScriptHost m_host; | 25 | private IScriptHost m_host; |
26 | private uint m_localID; | 26 | private uint m_localID; |
27 | private LLUUID m_itemID; | 27 | private LLUUID m_itemID; |
28 | 28 | ||
29 | public LSL_BuiltIn_Commands(ScriptEngine ScriptEngine, IScriptHost host, uint localID, LLUUID itemID) | 29 | public LSL_BuiltIn_Commands(ScriptEngine ScriptEngine, IScriptHost host, uint localID, LLUUID itemID) |
30 | { | 30 | { |
31 | m_ScriptEngine = ScriptEngine; | 31 | m_ScriptEngine = ScriptEngine; |
32 | m_host = host; | 32 | m_host = host; |
33 | m_localID = localID; | 33 | m_localID = localID; |
34 | m_itemID = itemID; | 34 | m_itemID = itemID; |
35 | 35 | ||
36 | 36 | ||
37 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); | 37 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); |
38 | } | 38 | } |
39 | 39 | ||
40 | 40 | ||
41 | private string m_state = "default"; | 41 | private string m_state = "default"; |
42 | 42 | ||
43 | public string State() | 43 | public string State() |
44 | { | 44 | { |
45 | return m_state; | 45 | return m_state; |
46 | } | 46 | } |
47 | 47 | ||
48 | // Object never expires | 48 | // Object never expires |
49 | public override Object InitializeLifetimeService() | 49 | public override Object InitializeLifetimeService() |
50 | { | 50 | { |
51 | //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); | 51 | //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); |
52 | // return null; | 52 | // return null; |
53 | ILease lease = (ILease)base.InitializeLifetimeService(); | 53 | ILease lease = (ILease)base.InitializeLifetimeService(); |
54 | 54 | ||
55 | if (lease.CurrentState == LeaseState.Initial) | 55 | if (lease.CurrentState == LeaseState.Initial) |
56 | { | 56 | { |
57 | lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); | 57 | lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); |
58 | // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); | 58 | // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); |
59 | // lease.RenewOnCallTime = TimeSpan.FromSeconds(2); | 59 | // lease.RenewOnCallTime = TimeSpan.FromSeconds(2); |
60 | } | 60 | } |
61 | return lease; | 61 | return lease; |
62 | } | 62 | } |
63 | 63 | ||
64 | 64 | ||
65 | public Scene World | 65 | public Scene World |
66 | { | 66 | { |
67 | get { return m_ScriptEngine.World; } | 67 | get { return m_ScriptEngine.World; } |
68 | } | 68 | } |
69 | 69 | ||
70 | //These are the implementations of the various ll-functions used by the LSL scripts. | 70 | //These are the implementations of the various ll-functions used by the LSL scripts. |
71 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 | 71 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 |
72 | public double llSin(double f) { return (double)Math.Sin(f); } | 72 | public double llSin(double f) { return (double)Math.Sin(f); } |
73 | public double llCos(double f) { return (double)Math.Cos(f); } | 73 | public double llCos(double f) { return (double)Math.Cos(f); } |
74 | public double llTan(double f) { return (double)Math.Tan(f); } | 74 | public double llTan(double f) { return (double)Math.Tan(f); } |
75 | public double llAtan2(double x, double y) { return (double)Math.Atan2(y, x); } | 75 | public double llAtan2(double x, double y) { return (double)Math.Atan2(y, x); } |
76 | public double llSqrt(double f) { return (double)Math.Sqrt(f); } | 76 | public double llSqrt(double f) { return (double)Math.Sqrt(f); } |
77 | public double llPow(double fbase, double fexponent) { return (double)Math.Pow(fbase, fexponent); } | 77 | public double llPow(double fbase, double fexponent) { return (double)Math.Pow(fbase, fexponent); } |
78 | public int llAbs(int i) { return (int)Math.Abs(i); } | 78 | public int llAbs(int i) { return (int)Math.Abs(i); } |
79 | public double llFabs(double f) { return (double)Math.Abs(f); } | 79 | public double llFabs(double f) { return (double)Math.Abs(f); } |
80 | 80 | ||
81 | public double llFrand(double mag) | 81 | public double llFrand(double mag) |
82 | { | 82 | { |
83 | lock (Util.RandomClass) | 83 | lock (Util.RandomClass) |
84 | { | 84 | { |
85 | return Util.RandomClass.Next((int)mag); | 85 | return Util.RandomClass.Next((int)mag); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | public int llFloor(double f) { return (int)Math.Floor(f); } | 89 | public int llFloor(double f) { return (int)Math.Floor(f); } |
90 | public int llCeil(double f) { return (int)Math.Ceiling(f); } | 90 | public int llCeil(double f) { return (int)Math.Ceiling(f); } |
91 | public int llRound(double f) { return (int)Math.Round(f, 3); } | 91 | public int llRound(double f) { return (int)Math.Round(f, 3); } |
92 | 92 | ||
93 | //This next group are vector operations involving squaring and square root. ckrinke | 93 | //This next group are vector operations involving squaring and square root. ckrinke |
94 | public double llVecMag(LSL_Types.Vector3 v) | 94 | public double llVecMag(LSL_Types.Vector3 v) |
95 | { | 95 | { |
96 | return (v.X*v.X + v.Y*v.Y + v.Z*v.Z); | 96 | return (v.X*v.X + v.Y*v.Y + v.Z*v.Z); |
97 | } | 97 | } |
98 | 98 | ||
99 | public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) | 99 | public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) |
100 | { | 100 | { |
101 | double mag = v.X * v.X + v.Y * v.Y + v.Z * v.Z; | 101 | double mag = v.X * v.X + v.Y * v.Y + v.Z * v.Z; |
102 | LSL_Types.Vector3 nor = new LSL_Types.Vector3(); | 102 | LSL_Types.Vector3 nor = new LSL_Types.Vector3(); |
103 | nor.X = v.X / mag; nor.Y = v.Y / mag; nor.Z = v.Z / mag; | 103 | nor.X = v.X / mag; nor.Y = v.Y / mag; nor.Z = v.Z / mag; |
104 | return nor; | 104 | return nor; |
105 | } | 105 | } |
106 | 106 | ||
107 | public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b) | 107 | public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b) |
108 | { | 108 | { |
109 | double dx = a.X - b.X; double dy = a.Y - b.Y; double dz = a.Z - b.Z; | 109 | double dx = a.X - b.X; double dy = a.Y - b.Y; double dz = a.Z - b.Z; |
110 | return Math.Sqrt(dx * dx + dy * dy + dz * dz); | 110 | return Math.Sqrt(dx * dx + dy * dy + dz * dz); |
111 | } | 111 | } |
112 | 112 | ||
113 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke | 113 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke |
114 | public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) | 114 | public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) |
115 | { | 115 | { |
116 | //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke | 116 | //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke |
117 | LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.X * r.X, r.Y * r.Y, r.Z * r.Z, r.R * r.R); | 117 | LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.X * r.X, r.Y * r.Y, r.Z * r.Z, r.R * r.R); |
118 | double m = (t.X + t.Y + t.Z + t.R); | 118 | double m = (t.X + t.Y + t.Z + t.R); |
119 | if (m == 0) return new LSL_Types.Vector3(); | 119 | if (m == 0) return new LSL_Types.Vector3(); |
120 | double n = 2 * (r.Y * r.R + r.X * r.Z); | 120 | double n = 2 * (r.Y * r.R + r.X * r.Z); |
121 | double p = m * m - n * n; | 121 | double p = m * m - n * n; |
122 | if (p > 0) | 122 | if (p > 0) |
123 | return new LSL_Types.Vector3(Math.Atan2(2.0 * (r.X*r.R - r.Y*r.Z),(-t.X - t.Y + t.Z + t.R)), | 123 | return new LSL_Types.Vector3(Math.Atan2(2.0 * (r.X*r.R - r.Y*r.Z),(-t.X - t.Y + t.Z + t.R)), |
124 | Math.Atan2(n,Math.Sqrt(p)), Math.Atan2(2.0 * (r.Z*r.R - r.X*r.Y),( t.X - t.Y - t.Z + t.R))); | 124 | Math.Atan2(n,Math.Sqrt(p)), Math.Atan2(2.0 * (r.Z*r.R - r.X*r.Y),( t.X - t.Y - t.Z + t.R))); |
125 | else if(n>0) | 125 | else if(n>0) |
126 | return new LSL_Types.Vector3( 0.0, Math.PI/2, Math.Atan2((r.Z*r.R + r.X*r.Y), 0.5 - t.X - t.Z)); | 126 | return new LSL_Types.Vector3( 0.0, Math.PI/2, Math.Atan2((r.Z*r.R + r.X*r.Y), 0.5 - t.X - t.Z)); |
127 | else | 127 | else |
128 | return new LSL_Types.Vector3( 0.0, -Math.PI/2, Math.Atan2((r.Z*r.R + r.X*r.Y), 0.5 - t.X - t.Z)); | 128 | return new LSL_Types.Vector3( 0.0, -Math.PI/2, Math.Atan2((r.Z*r.R + r.X*r.Y), 0.5 - t.X - t.Z)); |
129 | } | 129 | } |
130 | 130 | ||
131 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) | 131 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) |
132 | { | 132 | { |
133 | //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07 | 133 | //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07 |
134 | float err = 0.00001f; | 134 | float err = 0.00001f; |
135 | double ax = Math.Sin(v.X / 2); double aw = Math.Cos(v.X / 2); | 135 | double ax = Math.Sin(v.X / 2); double aw = Math.Cos(v.X / 2); |
136 | double by = Math.Sin(v.Y / 2); double bw = Math.Cos(v.Y / 2); | 136 | double by = Math.Sin(v.Y / 2); double bw = Math.Cos(v.Y / 2); |
137 | double cz = Math.Sin(v.Z / 2); double cw = Math.Cos(v.Z / 2); | 137 | double cz = Math.Sin(v.Z / 2); double cw = Math.Cos(v.Z / 2); |
138 | LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw); | 138 | LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw); |
139 | LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw); | 139 | LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw); |
140 | LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw); | 140 | LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw); |
141 | LSL_Types.Quaternion a = new LSL_Types.Quaternion(); | 141 | LSL_Types.Quaternion a = new LSL_Types.Quaternion(); |
142 | //This multiplication doesnt compile, yet. a = a1 * a2 * a3; | 142 | //This multiplication doesnt compile, yet. a = a1 * a2 * a3; |
143 | LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax * bw * cw + aw * by * cz, | 143 | LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax * bw * cw + aw * by * cz, |
144 | aw * by * cw - ax * bw * cz, aw * bw * cz + ax * by * cw, aw * bw * cw - ax * by * cz); | 144 | aw * by * cw - ax * bw * cz, aw * bw * cz + ax * by * cw, aw * bw * cw - ax * by * cz); |
145 | LSL_Types.Quaternion c = new LSL_Types.Quaternion(); | 145 | LSL_Types.Quaternion c = new LSL_Types.Quaternion(); |
146 | //This addition doesnt compile yet c = a + b; | 146 | //This addition doesnt compile yet c = a + b; |
147 | LSL_Types.Quaternion d = new LSL_Types.Quaternion(); | 147 | LSL_Types.Quaternion d = new LSL_Types.Quaternion(); |
148 | //This addition doesnt compile yet d = a - b; | 148 | //This addition doesnt compile yet d = a - b; |
149 | if ((Math.Abs(c.X) > err && Math.Abs(d.X) > err) || | 149 | if ((Math.Abs(c.X) > err && Math.Abs(d.X) > err) || |
150 | (Math.Abs(c.Y) > err && Math.Abs(d.Y) > err) || | 150 | (Math.Abs(c.Y) > err && Math.Abs(d.Y) > err) || |
151 | (Math.Abs(c.Z) > err && Math.Abs(d.Z) > err) || | 151 | (Math.Abs(c.Z) > err && Math.Abs(d.Z) > err) || |
152 | (Math.Abs(c.R) > err && Math.Abs(d.R) > err)) | 152 | (Math.Abs(c.R) > err && Math.Abs(d.R) > err)) |
153 | { | 153 | { |
154 | //return a new Quaternion that is null until I figure this out | 154 | //return a new Quaternion that is null until I figure this out |
155 | // return b; | 155 | // return b; |
156 | // return a; | 156 | // return a; |
157 | } | 157 | } |
158 | return new LSL_Types.Quaternion(); | 158 | return new LSL_Types.Quaternion(); |
159 | } | 159 | } |
160 | 160 | ||
161 | public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) { return new LSL_Types.Quaternion(); } | 161 | public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) { return new LSL_Types.Quaternion(); } |
162 | public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) { return new LSL_Types.Vector3(); } | 162 | public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) { return new LSL_Types.Vector3(); } |
163 | public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) { return new LSL_Types.Vector3(); } | 163 | public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) { return new LSL_Types.Vector3(); } |
164 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) { return new LSL_Types.Vector3(); } | 164 | public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) { return new LSL_Types.Vector3(); } |
165 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 start, LSL_Types.Vector3 end) { return new LSL_Types.Quaternion(); } | 165 | public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 start, LSL_Types.Vector3 end) { return new LSL_Types.Quaternion(); } |
166 | 166 | ||
167 | public void llWhisper(int channelID, string text) | 167 | public void llWhisper(int channelID, string text) |
168 | { | 168 | { |
169 | //type for whisper is 0 | 169 | //type for whisper is 0 |
170 | World.SimChat(Helpers.StringToField(text), | 170 | World.SimChat(Helpers.StringToField(text), |
171 | 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 171 | 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
172 | } | 172 | } |
173 | 173 | ||
174 | public void llSay(int channelID, string text) | 174 | public void llSay(int channelID, string text) |
175 | { | 175 | { |
176 | //type for say is 1 | 176 | //type for say is 1 |
177 | 177 | ||
178 | World.SimChat(Helpers.StringToField(text), | 178 | World.SimChat(Helpers.StringToField(text), |
179 | 1, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 179 | 1, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
180 | } | 180 | } |
181 | 181 | ||
182 | public void llShout(int channelID, string text) | 182 | public void llShout(int channelID, string text) |
183 | { | 183 | { |
184 | //type for shout is 2 | 184 | //type for shout is 2 |
185 | World.SimChat(Helpers.StringToField(text), | 185 | World.SimChat(Helpers.StringToField(text), |
186 | 2, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 186 | 2, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
187 | } | 187 | } |
188 | 188 | ||
189 | public int llListen(int channelID, string name, string ID, string msg) { return 0; } | 189 | public int llListen(int channelID, string name, string ID, string msg) { return 0; } |
190 | public void llListenControl(int number, int active) { return; } | 190 | public void llListenControl(int number, int active) { return; } |
191 | public void llListenRemove(int number) { return; } | 191 | public void llListenRemove(int number) { return; } |
192 | public void llSensor(string name, string id, int type, double range, double arc) { return; } | 192 | public void llSensor(string name, string id, int type, double range, double arc) { return; } |
193 | public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { return; } | 193 | public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) { return; } |
194 | public void llSensorRemove() { return; } | 194 | public void llSensorRemove() { return; } |
195 | public string llDetectedName(int number) { return ""; } | 195 | public string llDetectedName(int number) { return ""; } |
196 | public string llDetectedKey(int number) { return ""; } | 196 | public string llDetectedKey(int number) { return ""; } |
197 | public string llDetectedOwner(int number) { return ""; } | 197 | public string llDetectedOwner(int number) { return ""; } |
198 | public int llDetectedType(int number) { return 0; } | 198 | public int llDetectedType(int number) { return 0; } |
199 | public LSL_Types.Vector3 llDetectedPos(int number) { return new LSL_Types.Vector3(); } | 199 | public LSL_Types.Vector3 llDetectedPos(int number) { return new LSL_Types.Vector3(); } |
200 | public LSL_Types.Vector3 llDetectedVel(int number) { return new LSL_Types.Vector3(); } | 200 | public LSL_Types.Vector3 llDetectedVel(int number) { return new LSL_Types.Vector3(); } |
201 | public LSL_Types.Vector3 llDetectedGrab(int number) { return new LSL_Types.Vector3(); } | 201 | public LSL_Types.Vector3 llDetectedGrab(int number) { return new LSL_Types.Vector3(); } |
202 | public LSL_Types.Quaternion llDetectedRot(int number) { return new LSL_Types.Quaternion(); } | 202 | public LSL_Types.Quaternion llDetectedRot(int number) { return new LSL_Types.Quaternion(); } |
203 | public int llDetectedGroup(int number) { return 0; } | 203 | public int llDetectedGroup(int number) { return 0; } |
204 | public int llDetectedLinkNumber(int number) { return 0; } | 204 | public int llDetectedLinkNumber(int number) { return 0; } |
205 | public void llDie() { return; } | 205 | public void llDie() { return; } |
206 | public double llGround(LSL_Types.Vector3 offset) { return 0; } | 206 | public double llGround(LSL_Types.Vector3 offset) { return 0; } |
207 | public double llCloud(LSL_Types.Vector3 offset) { return 0; } | 207 | public double llCloud(LSL_Types.Vector3 offset) { return 0; } |
208 | public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } | 208 | public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } |
209 | public void llSetStatus(int status, int value) { return; } | 209 | public void llSetStatus(int status, int value) { return; } |
210 | public int llGetStatus(int status) { return 0; } | 210 | public int llGetStatus(int status) { return 0; } |
211 | public void llSetScale(LSL_Types.Vector3 scale) { return; } | 211 | public void llSetScale(LSL_Types.Vector3 scale) { return; } |
212 | public LSL_Types.Vector3 llGetScale() { return new LSL_Types.Vector3(); } | 212 | public LSL_Types.Vector3 llGetScale() { return new LSL_Types.Vector3(); } |
213 | public void llSetColor(LSL_Types.Vector3 color, int face) { return; } | 213 | public void llSetColor(LSL_Types.Vector3 color, int face) { return; } |
214 | public double llGetAlpha(int face) { return 0; } | 214 | public double llGetAlpha(int face) { return 0; } |
215 | public void llSetAlpha(double alpha, int face) { return; } | 215 | public void llSetAlpha(double alpha, int face) { return; } |
216 | public LSL_Types.Vector3 llGetColor(int face) { return new LSL_Types.Vector3(); } | 216 | public LSL_Types.Vector3 llGetColor(int face) { return new LSL_Types.Vector3(); } |
217 | public void llSetTexture(string texture, int face) { return; } | 217 | public void llSetTexture(string texture, int face) { return; } |
218 | public void llScaleTexture(double u, double v, int face) { return; } | 218 | public void llScaleTexture(double u, double v, int face) { return; } |
219 | public void llOffsetTexture(double u, double v, int face) { return; } | 219 | public void llOffsetTexture(double u, double v, int face) { return; } |
220 | public void llRotateTexture(double rotation, int face) { return; } | 220 | public void llRotateTexture(double rotation, int face) { return; } |
221 | 221 | ||
222 | public string llGetTexture(int face) | 222 | public string llGetTexture(int face) |
223 | { | 223 | { |
224 | return ""; | 224 | return ""; |
225 | } | 225 | } |
226 | 226 | ||
227 | public void llSetPos(LSL_Types.Vector3 pos) { return; } | 227 | public void llSetPos(LSL_Types.Vector3 pos) { return; } |
228 | 228 | ||
229 | public LSL_Types.Vector3 llGetPos() | 229 | public LSL_Types.Vector3 llGetPos() |
230 | { | 230 | { |
231 | throw new NotImplementedException("llGetPos"); | 231 | throw new NotImplementedException("llGetPos"); |
232 | // return m_host.AbsolutePosition; | 232 | // return m_host.AbsolutePosition; |
233 | } | 233 | } |
234 | 234 | ||
235 | public LSL_Types.Vector3 llGetLocalPos() { return new LSL_Types.Vector3(); } | 235 | public LSL_Types.Vector3 llGetLocalPos() { return new LSL_Types.Vector3(); } |
236 | public void llSetRot(LSL_Types.Quaternion rot) { } | 236 | public void llSetRot(LSL_Types.Quaternion rot) { } |
237 | public LSL_Types.Quaternion llGetRot() { return new LSL_Types.Quaternion(); } | 237 | public LSL_Types.Quaternion llGetRot() { return new LSL_Types.Quaternion(); } |
238 | public LSL_Types.Quaternion llGetLocalRot() { return new LSL_Types.Quaternion(); } | 238 | public LSL_Types.Quaternion llGetLocalRot() { return new LSL_Types.Quaternion(); } |
239 | public void llSetForce(LSL_Types.Vector3 force, int local) { } | 239 | public void llSetForce(LSL_Types.Vector3 force, int local) { } |
240 | public LSL_Types.Vector3 llGetForce() { return new LSL_Types.Vector3(); } | 240 | public LSL_Types.Vector3 llGetForce() { return new LSL_Types.Vector3(); } |
241 | public int llTarget(LSL_Types.Vector3 position, double range) { return 0; } | 241 | public int llTarget(LSL_Types.Vector3 position, double range) { return 0; } |
242 | public void llTargetRemove(int number) { } | 242 | public void llTargetRemove(int number) { } |
243 | public int llRotTarget(LSL_Types.Quaternion rot, double error) { return 0; } | 243 | public int llRotTarget(LSL_Types.Quaternion rot, double error) { return 0; } |
244 | public void llRotTargetRemove(int number) { } | 244 | public void llRotTargetRemove(int number) { } |
245 | public void llMoveToTarget(LSL_Types.Vector3 target, double tau) { } | 245 | public void llMoveToTarget(LSL_Types.Vector3 target, double tau) { } |
246 | public void llStopMoveToTarget() { } | 246 | public void llStopMoveToTarget() { } |
247 | public void llApplyImpulse(LSL_Types.Vector3 force, int local) { } | 247 | public void llApplyImpulse(LSL_Types.Vector3 force, int local) { } |
248 | public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) { } | 248 | public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) { } |
249 | public void llSetTorque(LSL_Types.Vector3 torque, int local) { } | 249 | public void llSetTorque(LSL_Types.Vector3 torque, int local) { } |
250 | public LSL_Types.Vector3 llGetTorque() { return new LSL_Types.Vector3(); } | 250 | public LSL_Types.Vector3 llGetTorque() { return new LSL_Types.Vector3(); } |
251 | public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local) { } | 251 | public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local) { } |
252 | public LSL_Types.Vector3 llGetVel() { return new LSL_Types.Vector3(); } | 252 | public LSL_Types.Vector3 llGetVel() { return new LSL_Types.Vector3(); } |
253 | public LSL_Types.Vector3 llGetAccel() { return new LSL_Types.Vector3(); } | 253 | public LSL_Types.Vector3 llGetAccel() { return new LSL_Types.Vector3(); } |
254 | public LSL_Types.Vector3 llGetOmega() { return new LSL_Types.Vector3(); } | 254 | public LSL_Types.Vector3 llGetOmega() { return new LSL_Types.Vector3(); } |
255 | public double llGetTimeOfDay() { return 0; } | 255 | public double llGetTimeOfDay() { return 0; } |
256 | 256 | ||
257 | public double llGetWallclock() | 257 | public double llGetWallclock() |
258 | { | 258 | { |
259 | return DateTime.Now.TimeOfDay.TotalSeconds; | 259 | return DateTime.Now.TimeOfDay.TotalSeconds; |
260 | } | 260 | } |
261 | 261 | ||
262 | public double llGetTime() { return 0; } | 262 | public double llGetTime() { return 0; } |
263 | public void llResetTime() { } | 263 | public void llResetTime() { } |
264 | public double llGetAndResetTime() { return 0; } | 264 | public double llGetAndResetTime() { return 0; } |
265 | public void llSound() { } | 265 | public void llSound() { } |
266 | public void llPlaySound(string sound, double volume) { } | 266 | public void llPlaySound(string sound, double volume) { } |
267 | public void llLoopSound(string sound, double volume) { } | 267 | public void llLoopSound(string sound, double volume) { } |
268 | public void llLoopSoundMaster(string sound, double volume) { } | 268 | public void llLoopSoundMaster(string sound, double volume) { } |
269 | public void llLoopSoundSlave(string sound, double volume) { } | 269 | public void llLoopSoundSlave(string sound, double volume) { } |
270 | public void llPlaySoundSlave(string sound, double volume) { } | 270 | public void llPlaySoundSlave(string sound, double volume) { } |
271 | public void llTriggerSound(string sound, double volume) { } | 271 | public void llTriggerSound(string sound, double volume) { } |
272 | public void llStopSound() { } | 272 | public void llStopSound() { } |
273 | public void llPreloadSound(string sound) { } | 273 | public void llPreloadSound(string sound) { } |
274 | 274 | ||
275 | public string llGetSubString(string src, int start, int end) | 275 | public string llGetSubString(string src, int start, int end) |
276 | { | 276 | { |
277 | return src.Substring(start, end); | 277 | return src.Substring(start, end); |
278 | } | 278 | } |
279 | 279 | ||
280 | public string llDeleteSubString(string src, int start, int end) {return "";} | 280 | public string llDeleteSubString(string src, int start, int end) {return "";} |
281 | public string llInsertString(string dst, int position, string src) { return ""; } | 281 | public string llInsertString(string dst, int position, string src) { return ""; } |
282 | 282 | ||
283 | public string llToUpper(string src) | 283 | public string llToUpper(string src) |
284 | { | 284 | { |
285 | return src.ToUpper(); | 285 | return src.ToUpper(); |
286 | } | 286 | } |
287 | 287 | ||
288 | public string llToLower(string src) | 288 | public string llToLower(string src) |
289 | { | 289 | { |
290 | return src.ToLower(); | 290 | return src.ToLower(); |
291 | } | 291 | } |
292 | 292 | ||
293 | public int llGiveMoney(string destination, int amount) { return 0; } | 293 | public int llGiveMoney(string destination, int amount) { return 0; } |
294 | public void llMakeExplosion() { } | 294 | public void llMakeExplosion() { } |
295 | public void llMakeFountain() { } | 295 | public void llMakeFountain() { } |
296 | public void llMakeSmoke() { } | 296 | public void llMakeSmoke() { } |
297 | public void llMakeFire() { } | 297 | public void llMakeFire() { } |
298 | public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { } | 298 | public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { } |
299 | public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { } | 299 | public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { } |
300 | public void llStopLookAt() { } | 300 | public void llStopLookAt() { } |
301 | 301 | ||
302 | public void llSetTimerEvent(double sec) | 302 | public void llSetTimerEvent(double sec) |
303 | { | 303 | { |
304 | // Setting timer repeat | 304 | // Setting timer repeat |
305 | m_ScriptEngine.m_LSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec); | 305 | m_ScriptEngine.m_LSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec); |
306 | } | 306 | } |
307 | 307 | ||
308 | public void llSleep(double sec) | 308 | public void llSleep(double sec) |
309 | { | 309 | { |
310 | System.Threading.Thread.Sleep((int)(sec * 1000)); | 310 | System.Threading.Thread.Sleep((int)(sec * 1000)); |
311 | } | 311 | } |
312 | 312 | ||
313 | public double llGetMass() { return 0; } | 313 | public double llGetMass() { return 0; } |
314 | public void llCollisionFilter(string name, string id, int accept) { } | 314 | public void llCollisionFilter(string name, string id, int accept) { } |
315 | public void llTakeControls(int controls, int accept, int pass_on) { } | 315 | public void llTakeControls(int controls, int accept, int pass_on) { } |
316 | public void llReleaseControls() { } | 316 | public void llReleaseControls() { } |
317 | public void llAttachToAvatar(int attachment) { } | 317 | public void llAttachToAvatar(int attachment) { } |
318 | public void llDetachFromAvatar() { } | 318 | public void llDetachFromAvatar() { } |
319 | public void llTakeCamera() { } | 319 | public void llTakeCamera() { } |
320 | public void llReleaseCamera() { } | 320 | public void llReleaseCamera() { } |
321 | 321 | ||
322 | public string llGetOwner() | 322 | public string llGetOwner() |
323 | { | 323 | { |
324 | return m_host.ObjectOwner.ToStringHyphenated(); | 324 | return m_host.ObjectOwner.ToStringHyphenated(); |
325 | } | 325 | } |
326 | 326 | ||
327 | public void llInstantMessage(string user, string message) { } | 327 | public void llInstantMessage(string user, string message) { } |
328 | public void llEmail(string address, string subject, string message) { } | 328 | public void llEmail(string address, string subject, string message) { } |
329 | public void llGetNextEmail(string address, string subject) { } | 329 | public void llGetNextEmail(string address, string subject) { } |
330 | 330 | ||
331 | public string llGetKey() | 331 | public string llGetKey() |
332 | { | 332 | { |
333 | return m_host.UUID.ToStringHyphenated(); | 333 | return m_host.UUID.ToStringHyphenated(); |
334 | } | 334 | } |
335 | 335 | ||
336 | public void llSetBuoyancy(double buoyancy) { } | 336 | public void llSetBuoyancy(double buoyancy) { } |
337 | public void llSetHoverHeight(double height, int water, double tau) { } | 337 | public void llSetHoverHeight(double height, int water, double tau) { } |
338 | public void llStopHover() { } | 338 | public void llStopHover() { } |
339 | public void llMinEventDelay(double delay) { } | 339 | public void llMinEventDelay(double delay) { } |
340 | public void llSoundPreload() { } | 340 | public void llSoundPreload() { } |
341 | public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping) { } | 341 | public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping) { } |
342 | 342 | ||
343 | public int llStringLength(string str) | 343 | public int llStringLength(string str) |
344 | { | 344 | { |
345 | if (str.Length > 0) | 345 | if (str.Length > 0) |
346 | { | 346 | { |
347 | return str.Length; | 347 | return str.Length; |
348 | } | 348 | } |
349 | else | 349 | else |
350 | { | 350 | { |
351 | return 0; | 351 | return 0; |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | public void llStartAnimation(string anim) { } | 355 | public void llStartAnimation(string anim) { } |
356 | public void llStopAnimation(string anim) { } | 356 | public void llStopAnimation(string anim) { } |
357 | public void llPointAt() { } | 357 | public void llPointAt() { } |
358 | public void llStopPointAt() { } | 358 | public void llStopPointAt() { } |
359 | public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) { } | 359 | public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) { } |
360 | public int llGetStartParameter() { return 0; } | 360 | public int llGetStartParameter() { return 0; } |
361 | public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos) { } | 361 | public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos) { } |
362 | public void llRequestPermissions(string agent, int perm) { } | 362 | public void llRequestPermissions(string agent, int perm) { } |
363 | public string llGetPermissionsKey() { return ""; } | 363 | public string llGetPermissionsKey() { return ""; } |
364 | public int llGetPermissions() { return 0; } | 364 | public int llGetPermissions() { return 0; } |
365 | public int llGetLinkNumber() { return 0; } | 365 | public int llGetLinkNumber() { return 0; } |
366 | public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) { } | 366 | public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) { } |
367 | public void llCreateLink(string target, int parent) { } | 367 | public void llCreateLink(string target, int parent) { } |
368 | public void llBreakLink(int linknum) { } | 368 | public void llBreakLink(int linknum) { } |
369 | public void llBreakAllLinks() { } | 369 | public void llBreakAllLinks() { } |
370 | public string llGetLinkKey(int linknum) { return ""; } | 370 | public string llGetLinkKey(int linknum) { return ""; } |
371 | public void llGetLinkName(int linknum) { } | 371 | public void llGetLinkName(int linknum) { } |
372 | public int llGetInventoryNumber(int type) { return 0; } | 372 | public int llGetInventoryNumber(int type) { return 0; } |
373 | public string llGetInventoryName(int type, int number) { return ""; } | 373 | public string llGetInventoryName(int type, int number) { return ""; } |
374 | public void llSetScriptState(string name, int run) { } | 374 | public void llSetScriptState(string name, int run) { } |
375 | public double llGetEnergy() { return 1.0f; } | 375 | public double llGetEnergy() { return 1.0f; } |
376 | public void llGiveInventory(string destination, string inventory) { } | 376 | public void llGiveInventory(string destination, string inventory) { } |
377 | public void llRemoveInventory(string item) { } | 377 | public void llRemoveInventory(string item) { } |
378 | 378 | ||
379 | public void llSetText(string text, LSL_Types.Vector3 color, double alpha) | 379 | public void llSetText(string text, LSL_Types.Vector3 color, double alpha) |
380 | { | 380 | { |
381 | // TEMP DISABLED UNTIL WE CAN AGREE UPON VECTOR/ROTATION FORMAT | 381 | // TEMP DISABLED UNTIL WE CAN AGREE UPON VECTOR/ROTATION FORMAT |
382 | //m_host.SetText(text, color, alpha); | 382 | //m_host.SetText(text, color, alpha); |
383 | } | 383 | } |
384 | 384 | ||
385 | public double llWater(LSL_Types.Vector3 offset) { return 0; } | 385 | public double llWater(LSL_Types.Vector3 offset) { return 0; } |
386 | public void llPassTouches(int pass) { } | 386 | public void llPassTouches(int pass) { } |
387 | public string llRequestAgentData(string id, int data) { return ""; } | 387 | public string llRequestAgentData(string id, int data) { return ""; } |
388 | public string llRequestInventoryData(string name) { return ""; } | 388 | public string llRequestInventoryData(string name) { return ""; } |
389 | public void llSetDamage(double damage) { } | 389 | public void llSetDamage(double damage) { } |
390 | public void llTeleportAgentHome(string agent) { } | 390 | public void llTeleportAgentHome(string agent) { } |
391 | public void llModifyLand(int action, int brush) { } | 391 | public void llModifyLand(int action, int brush) { } |
392 | public void llCollisionSound(string impact_sound, double impact_volume) { } | 392 | public void llCollisionSound(string impact_sound, double impact_volume) { } |
393 | public void llCollisionSprite(string impact_sprite) { } | 393 | public void llCollisionSprite(string impact_sprite) { } |
394 | public string llGetAnimation(string id) { return ""; } | 394 | public string llGetAnimation(string id) { return ""; } |
395 | public void llResetScript() { } | 395 | public void llResetScript() { } |
396 | public void llMessageLinked(int linknum, int num, string str, string id) { } | 396 | public void llMessageLinked(int linknum, int num, string str, string id) { } |
397 | public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) { } | 397 | public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) { } |
398 | public void llPassCollisions(int pass) { } | 398 | public void llPassCollisions(int pass) { } |
399 | public string llGetScriptName() { return ""; } | 399 | public string llGetScriptName() { return ""; } |
400 | 400 | ||
401 | public int llGetNumberOfSides() { return 0; } | 401 | public int llGetNumberOfSides() { return 0; } |
402 | 402 | ||
403 | public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) { return new LSL_Types.Quaternion(); } | 403 | public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) { return new LSL_Types.Quaternion(); } |
404 | public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) { return new LSL_Types.Vector3(); } | 404 | public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) { return new LSL_Types.Vector3(); } |
405 | public void llRot2Angle() { } | 405 | public void llRot2Angle() { } |
406 | 406 | ||
407 | public double llAcos(double val) | 407 | public double llAcos(double val) |
408 | { | 408 | { |
409 | return (double)Math.Acos(val); | 409 | return (double)Math.Acos(val); |
410 | } | 410 | } |
411 | 411 | ||
412 | public double llAsin(double val) | 412 | public double llAsin(double val) |
413 | { | 413 | { |
414 | return (double)Math.Asin(val); | 414 | return (double)Math.Asin(val); |
415 | } | 415 | } |
416 | 416 | ||
417 | public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) { return 0; } | 417 | public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) { return 0; } |
418 | public string llGetInventoryKey(string name) { return ""; } | 418 | public string llGetInventoryKey(string name) { return ""; } |
419 | public void llAllowInventoryDrop(int add) { } | 419 | public void llAllowInventoryDrop(int add) { } |
420 | public LSL_Types.Vector3 llGetSunDirection() { return new LSL_Types.Vector3(); } | 420 | public LSL_Types.Vector3 llGetSunDirection() { return new LSL_Types.Vector3(); } |
421 | public LSL_Types.Vector3 llGetTextureOffset(int face) { return new LSL_Types.Vector3(); } | 421 | public LSL_Types.Vector3 llGetTextureOffset(int face) { return new LSL_Types.Vector3(); } |
422 | public LSL_Types.Vector3 llGetTextureScale(int side) { return new LSL_Types.Vector3(); } | 422 | public LSL_Types.Vector3 llGetTextureScale(int side) { return new LSL_Types.Vector3(); } |
423 | public double llGetTextureRot(int side) { return 0; } | 423 | public double llGetTextureRot(int side) { return 0; } |
424 | 424 | ||
425 | public int llSubStringIndex(string source, string pattern) | 425 | public int llSubStringIndex(string source, string pattern) |
426 | { | 426 | { |
427 | return source.IndexOf(pattern); | 427 | return source.IndexOf(pattern); |
428 | } | 428 | } |
429 | 429 | ||
430 | public string llGetOwnerKey(string id) | 430 | public string llGetOwnerKey(string id) |
431 | { | 431 | { |
432 | return ""; | 432 | return ""; |
433 | } | 433 | } |
434 | 434 | ||
435 | public LSL_Types.Vector3 llGetCenterOfMass() { return new LSL_Types.Vector3(); } | 435 | public LSL_Types.Vector3 llGetCenterOfMass() { return new LSL_Types.Vector3(); } |
436 | 436 | ||
437 | public List<string> llListSort(List<string> src, int stride, int ascending) | 437 | public List<string> llListSort(List<string> src, int stride, int ascending) |
438 | { | 438 | { |
439 | //List<string> nlist = src.Sort(); | 439 | //List<string> nlist = src.Sort(); |
440 | 440 | ||
441 | //if (ascending == 0) | 441 | //if (ascending == 0) |
442 | //{ | 442 | //{ |
443 | //nlist.Reverse(); | 443 | //nlist.Reverse(); |
444 | //} | 444 | //} |
445 | 445 | ||
446 | //return nlist; | 446 | //return nlist; |
447 | return new List<string>(); ; | 447 | return new List<string>(); ; |
448 | } | 448 | } |
449 | 449 | ||
450 | public int llGetListLength(List<string> src) | 450 | public int llGetListLength(List<string> src) |
451 | { | 451 | { |
452 | return src.Count; | 452 | return src.Count; |
453 | } | 453 | } |
454 | 454 | ||
455 | public int llList2Integer(List<string> src, int index) | 455 | public int llList2Integer(List<string> src, int index) |
456 | { | 456 | { |
457 | return Convert.ToInt32(src[index]); | 457 | return Convert.ToInt32(src[index]); |
458 | } | 458 | } |
459 | 459 | ||
460 | public double llList2double(List<string> src, int index) | 460 | public double llList2double(List<string> src, int index) |
461 | { | 461 | { |
462 | return Convert.ToDouble(src[index]); | 462 | return Convert.ToDouble(src[index]); |
463 | } | 463 | } |
464 | 464 | ||
465 | public float llList2Float(List<string> src, int index) | 465 | public float llList2Float(List<string> src, int index) |
466 | { | 466 | { |
467 | return Convert.ToSingle(src[index]); | 467 | return Convert.ToSingle(src[index]); |
468 | } | 468 | } |
469 | 469 | ||
470 | public string llList2String(List<string> src, int index) | 470 | public string llList2String(List<string> src, int index) |
471 | { | 471 | { |
472 | return src[index]; | 472 | return src[index]; |
473 | } | 473 | } |
474 | 474 | ||
475 | public string llList2Key(List<string> src, int index) | 475 | public string llList2Key(List<string> src, int index) |
476 | { | 476 | { |
477 | //return OpenSim.Framework.Types.ToStringHyphenated(src[index]); | 477 | //return OpenSim.Framework.Types.ToStringHyphenated(src[index]); |
478 | return ""; | 478 | return ""; |
479 | } | 479 | } |
480 | 480 | ||
481 | public LSL_Types.Vector3 llList2Vector(List<string> src, int index) | 481 | public LSL_Types.Vector3 llList2Vector(List<string> src, int index) |
482 | { return new LSL_Types.Vector3(); } | 482 | { return new LSL_Types.Vector3(); } |
483 | public LSL_Types.Quaternion llList2Rot(List<string> src, int index) | 483 | public LSL_Types.Quaternion llList2Rot(List<string> src, int index) |
484 | { return new LSL_Types.Quaternion(); } | 484 | { return new LSL_Types.Quaternion(); } |
485 | public List<string> llList2List(List<string> src, int start, int end) | 485 | public List<string> llList2List(List<string> src, int start, int end) |
486 | { return new List<string>(); } | 486 | { return new List<string>(); } |
487 | public List<string> llDeleteSubList(List<string> src, int start, int end) | 487 | public List<string> llDeleteSubList(List<string> src, int start, int end) |
488 | { return new List<string>(); } | 488 | { return new List<string>(); } |
489 | public int llGetListEntryType(List<string> src, int index) { return 0; } | 489 | public int llGetListEntryType(List<string> src, int index) { return 0; } |
490 | public string llList2CSV(List<string> src) { return ""; } | 490 | public string llList2CSV(List<string> src) { return ""; } |
491 | public List<string> llCSV2List(string src) | 491 | public List<string> llCSV2List(string src) |
492 | { return new List<string>(); } | 492 | { return new List<string>(); } |
493 | public List<string> llListRandomize(List<string> src, int stride) | 493 | public List<string> llListRandomize(List<string> src, int stride) |
494 | { return new List<string>(); } | 494 | { return new List<string>(); } |
495 | public List<string> llList2ListStrided(List<string> src, int start, int end, int stride) | 495 | public List<string> llList2ListStrided(List<string> src, int start, int end, int stride) |
496 | { return new List<string>(); } | 496 | { return new List<string>(); } |
497 | 497 | ||
498 | public LSL_Types.Vector3 llGetRegionCorner() | 498 | public LSL_Types.Vector3 llGetRegionCorner() |
499 | { | 499 | { |
500 | return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0); | 500 | return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0); |
501 | } | 501 | } |
502 | 502 | ||
503 | public List<string> llListInsertList(List<string> dest, List<string> src, int start) | 503 | public List<string> llListInsertList(List<string> dest, List<string> src, int start) |
504 | { return new List<string>(); } | 504 | { return new List<string>(); } |
505 | public int llListFindList(List<string> src, List<string> test) { return 0; } | 505 | public int llListFindList(List<string> src, List<string> test) { return 0; } |
506 | 506 | ||
507 | public string llGetObjectName() | 507 | public string llGetObjectName() |
508 | { | 508 | { |
509 | return m_host.Name; | 509 | return m_host.Name; |
510 | } | 510 | } |
511 | 511 | ||
512 | public void llSetObjectName(string name) | 512 | public void llSetObjectName(string name) |
513 | { | 513 | { |
514 | m_host.Name = name; | 514 | m_host.Name = name; |
515 | } | 515 | } |
516 | 516 | ||
517 | public string llGetDate() | 517 | public string llGetDate() |
518 | { | 518 | { |
519 | DateTime date = DateTime.Now.ToUniversalTime(); | 519 | DateTime date = DateTime.Now.ToUniversalTime(); |
520 | string result = date.ToString("yyyy-MM-dd"); | 520 | string result = date.ToString("yyyy-MM-dd"); |
521 | return result; | 521 | return result; |
522 | } | 522 | } |
523 | 523 | ||
524 | public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) { return 0; } | 524 | public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) { return 0; } |
525 | public int llGetAgentInfo(string id) { return 0; } | 525 | public int llGetAgentInfo(string id) { return 0; } |
526 | public void llAdjustSoundVolume(double volume) { } | 526 | public void llAdjustSoundVolume(double volume) { } |
527 | public void llSetSoundQueueing(int queue) { } | 527 | public void llSetSoundQueueing(int queue) { } |
528 | public void llSetSoundRadius(double radius) { } | 528 | public void llSetSoundRadius(double radius) { } |
529 | public string llKey2Name(string id) { return ""; } | 529 | public string llKey2Name(string id) { return ""; } |
530 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) { } | 530 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) { } |
531 | public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west) { } | 531 | public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west) { } |
532 | public void llEjectFromLand(string pest) { } | 532 | public void llEjectFromLand(string pest) { } |
533 | 533 | ||
534 | public void llParseString2List() { } | 534 | public void llParseString2List() { } |
535 | 535 | ||
536 | public int llOverMyLand(string id) { return 0; } | 536 | public int llOverMyLand(string id) { return 0; } |
537 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) { return ""; } | 537 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) { return ""; } |
538 | public string llGetNotecardLine(string name, int line) { return ""; } | 538 | public string llGetNotecardLine(string name, int line) { return ""; } |
539 | public LSL_Types.Vector3 llGetAgentSize(string id) { return new LSL_Types.Vector3(); } | 539 | public LSL_Types.Vector3 llGetAgentSize(string id) { return new LSL_Types.Vector3(); } |
540 | public int llSameGroup(string agent) { return 0; } | 540 | public int llSameGroup(string agent) { return 0; } |
541 | public void llUnSit(string id) { } | 541 | public void llUnSit(string id) { } |
542 | public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } | 542 | public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } |
543 | public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } | 543 | public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } |
544 | public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } | 544 | public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } |
545 | public int llGetAttached() { return 0; } | 545 | public int llGetAttached() { return 0; } |
546 | public int llGetFreeMemory() { return 0; } | 546 | public int llGetFreeMemory() { return 0; } |
547 | 547 | ||
548 | public string llGetRegionName() | 548 | public string llGetRegionName() |
549 | { | 549 | { |
550 | return World.RegionInfo.RegionName; | 550 | return World.RegionInfo.RegionName; |
551 | } | 551 | } |
552 | 552 | ||
553 | public double llGetRegionTimeDilation() { return 1.0f; } | 553 | public double llGetRegionTimeDilation() { return 1.0f; } |
554 | public double llGetRegionFPS() { return 10.0f; } | 554 | public double llGetRegionFPS() { return 10.0f; } |
555 | public void llParticleSystem(List<Object> rules) { } | 555 | public void llParticleSystem(List<Object> rules) { } |
556 | public void llGroundRepel(double height, int water, double tau) { } | 556 | public void llGroundRepel(double height, int water, double tau) { } |
557 | public void llGiveInventoryList() { } | 557 | public void llGiveInventoryList() { } |
558 | public void llSetVehicleType(int type) { } | 558 | public void llSetVehicleType(int type) { } |
559 | public void llSetVehicledoubleParam(int param, double value) { } | 559 | public void llSetVehicledoubleParam(int param, double value) { } |
560 | public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec) { } | 560 | public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec) { } |
561 | public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot) { } | 561 | public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot) { } |
562 | public void llSetVehicleFlags(int flags) { } | 562 | public void llSetVehicleFlags(int flags) { } |
563 | public void llRemoveVehicleFlags(int flags) { } | 563 | public void llRemoveVehicleFlags(int flags) { } |
564 | public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot) { } | 564 | public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot) { } |
565 | public string llAvatarOnSitTarget() { return ""; } | 565 | public string llAvatarOnSitTarget() { return ""; } |
566 | public void llAddToLandPassList(string avatar, double hours) { } | 566 | public void llAddToLandPassList(string avatar, double hours) { } |
567 | 567 | ||
568 | public void llSetTouchText(string text) | 568 | public void llSetTouchText(string text) |
569 | { | 569 | { |
570 | m_host.TouchName = text; | 570 | m_host.TouchName = text; |
571 | } | 571 | } |
572 | 572 | ||
573 | public void llSetSitText(string text) | 573 | public void llSetSitText(string text) |
574 | { | 574 | { |
575 | m_host.SitName = text; | 575 | m_host.SitName = text; |
576 | } | 576 | } |
577 | 577 | ||
578 | public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) { } | 578 | public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) { } |
579 | public void llSetCameraAtOffset(LSL_Types.Vector3 offset) { } | 579 | public void llSetCameraAtOffset(LSL_Types.Vector3 offset) { } |
580 | public void llDumpList2String() { } | 580 | public void llDumpList2String() { } |
581 | public void llScriptDanger(LSL_Types.Vector3 pos) { } | 581 | public void llScriptDanger(LSL_Types.Vector3 pos) { } |
582 | public void llDialog(string avatar, string message, List<string> buttons, int chat_channel) { } | 582 | public void llDialog(string avatar, string message, List<string> buttons, int chat_channel) { } |
583 | public void llVolumeDetect(int detect) { } | 583 | public void llVolumeDetect(int detect) { } |
584 | public void llResetOtherScript(string name) { } | 584 | public void llResetOtherScript(string name) { } |
585 | 585 | ||
586 | public int llGetScriptState(string name) | 586 | public int llGetScriptState(string name) |
587 | { | 587 | { |
588 | return 0; | 588 | return 0; |
589 | } | 589 | } |
590 | 590 | ||
591 | public void llRemoteLoadScript() { } | 591 | public void llRemoteLoadScript() { } |
592 | public void llSetRemoteScriptAccessPin(int pin) { } | 592 | public void llSetRemoteScriptAccessPin(int pin) { } |
593 | public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { } | 593 | public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { } |
594 | public void llOpenRemoteDataChannel() { } | 594 | public void llOpenRemoteDataChannel() { } |
595 | public string llSendRemoteData(string channel, string dest, int idata, string sdata) { return ""; } | 595 | public string llSendRemoteData(string channel, string dest, int idata, string sdata) { return ""; } |
596 | public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) { } | 596 | public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) { } |
597 | public void llCloseRemoteDataChannel(string channel) { } | 597 | public void llCloseRemoteDataChannel(string channel) { } |
598 | 598 | ||
599 | public string llMD5String(string src, int nonce) | 599 | public string llMD5String(string src, int nonce) |
600 | { | 600 | { |
601 | return Util.Md5Hash(src + ":" + nonce.ToString()); | 601 | return Util.Md5Hash(src + ":" + nonce.ToString()); |
602 | } | 602 | } |
603 | 603 | ||
604 | public void llSetPrimitiveParams(List<string> rules) { } | 604 | public void llSetPrimitiveParams(List<string> rules) { } |
605 | public string llStringToBase64(string str) { return ""; } | 605 | public string llStringToBase64(string str) { return ""; } |
606 | public string llBase64ToString(string str) { return ""; } | 606 | public string llBase64ToString(string str) { return ""; } |
607 | public void llXorBase64Strings() { } | 607 | public void llXorBase64Strings() { } |
608 | public void llRemoteDataSetRegion() { } | 608 | public void llRemoteDataSetRegion() { } |
609 | public double llLog10(double val) { return (double)Math.Log10(val); } | 609 | public double llLog10(double val) { return (double)Math.Log10(val); } |
610 | public double llLog(double val) { return (double)Math.Log(val); } | 610 | public double llLog(double val) { return (double)Math.Log(val); } |
611 | public List<string> llGetAnimationList(string id) { return new List<string>(); } | 611 | public List<string> llGetAnimationList(string id) { return new List<string>(); } |
612 | public void llSetParcelMusicURL(string url) { } | 612 | public void llSetParcelMusicURL(string url) { } |
613 | 613 | ||
614 | public LSL_Types.Vector3 llGetRootPosition() | 614 | public LSL_Types.Vector3 llGetRootPosition() |
615 | { | 615 | { |
616 | throw new NotImplementedException("llGetRootPosition"); | 616 | throw new NotImplementedException("llGetRootPosition"); |
617 | //return m_root.AbsolutePosition; | 617 | //return m_root.AbsolutePosition; |
618 | } | 618 | } |
619 | 619 | ||
620 | public LSL_Types.Quaternion llGetRootRotation() | 620 | public LSL_Types.Quaternion llGetRootRotation() |
621 | { | 621 | { |
622 | return new LSL_Types.Quaternion(); | 622 | return new LSL_Types.Quaternion(); |
623 | } | 623 | } |
624 | 624 | ||
625 | public string llGetObjectDesc() | 625 | public string llGetObjectDesc() |
626 | { | 626 | { |
627 | return m_host.Description; | 627 | return m_host.Description; |
628 | } | 628 | } |
629 | 629 | ||
630 | public void llSetObjectDesc(string desc) | 630 | public void llSetObjectDesc(string desc) |
631 | { | 631 | { |
632 | m_host.Description = desc; | 632 | m_host.Description = desc; |
633 | } | 633 | } |
634 | 634 | ||
635 | public string llGetCreator() | 635 | public string llGetCreator() |
636 | { | 636 | { |
637 | return m_host.ObjectCreator.ToStringHyphenated(); | 637 | return m_host.ObjectCreator.ToStringHyphenated(); |
638 | } | 638 | } |
639 | 639 | ||
640 | public string llGetTimestamp() { return ""; } | 640 | public string llGetTimestamp() { return ""; } |
641 | public void llSetLinkAlpha(int linknumber, double alpha, int face) { } | 641 | public void llSetLinkAlpha(int linknumber, double alpha, int face) { } |
642 | public int llGetNumberOfPrims() { return 0; } | 642 | public int llGetNumberOfPrims() { return 0; } |
643 | public string llGetNumberOfNotecardLines(string name) { return ""; } | 643 | public string llGetNumberOfNotecardLines(string name) { return ""; } |
644 | public List<string> llGetBoundingBox(string obj) { return new List<string>(); } | 644 | public List<string> llGetBoundingBox(string obj) { return new List<string>(); } |
645 | public LSL_Types.Vector3 llGetGeometricCenter() { return new LSL_Types.Vector3(); } | 645 | public LSL_Types.Vector3 llGetGeometricCenter() { return new LSL_Types.Vector3(); } |
646 | public void llGetPrimitiveParams() { } | 646 | public void llGetPrimitiveParams() { } |
647 | public string llIntegerToBase64(int number) { return ""; } | 647 | public string llIntegerToBase64(int number) { return ""; } |
648 | public int llBase64ToInteger(string str) { return 0; } | 648 | public int llBase64ToInteger(string str) { return 0; } |
649 | 649 | ||
650 | public double llGetGMTclock() | 650 | public double llGetGMTclock() |
651 | { | 651 | { |
652 | return DateTime.UtcNow.TimeOfDay.TotalSeconds; | 652 | return DateTime.UtcNow.TimeOfDay.TotalSeconds; |
653 | } | 653 | } |
654 | 654 | ||
655 | public string llGetSimulatorHostname() | 655 | public string llGetSimulatorHostname() |
656 | { | 656 | { |
657 | return System.Environment.MachineName; | 657 | return System.Environment.MachineName; |
658 | } | 658 | } |
659 | 659 | ||
660 | public void llSetLocalRot(LSL_Types.Quaternion rot) { } | 660 | public void llSetLocalRot(LSL_Types.Quaternion rot) { } |
661 | public List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers) | 661 | public List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers) |
662 | { return new List<string>(); } | 662 | { return new List<string>(); } |
663 | public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Quaternion rot, int param) { } | 663 | public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Quaternion rot, int param) { } |
664 | 664 | ||
665 | public int llGetObjectPermMask(int mask) { return 0; } | 665 | public int llGetObjectPermMask(int mask) { return 0; } |
666 | 666 | ||
667 | public void llSetObjectPermMask(int mask, int value) { } | 667 | public void llSetObjectPermMask(int mask, int value) { } |
668 | 668 | ||
669 | public void llGetInventoryPermMask(string item, int mask) { } | 669 | public void llGetInventoryPermMask(string item, int mask) { } |
670 | public void llSetInventoryPermMask(string item, int mask, int value) { } | 670 | public void llSetInventoryPermMask(string item, int mask, int value) { } |
671 | public string llGetInventoryCreator(string item) { return ""; } | 671 | public string llGetInventoryCreator(string item) { return ""; } |
672 | public void llOwnerSay(string msg) { } | 672 | public void llOwnerSay(string msg) { } |
673 | public void llRequestSimulatorData(string simulator, int data) { } | 673 | public void llRequestSimulatorData(string simulator, int data) { } |
674 | public void llForceMouselook(int mouselook) { } | 674 | public void llForceMouselook(int mouselook) { } |
675 | public double llGetObjectMass(string id) { return 0; } | 675 | public double llGetObjectMass(string id) { return 0; } |
676 | public void llListReplaceList() { } | 676 | public void llListReplaceList() { } |
677 | 677 | ||
678 | public void llLoadURL(string avatar_id, string message, string url) | 678 | public void llLoadURL(string avatar_id, string message, string url) |
679 | { | 679 | { |
680 | LLUUID avatarId = new LLUUID(avatar_id); | 680 | LLUUID avatarId = new LLUUID(avatar_id); |
681 | m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, url); | 681 | m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, url); |
682 | } | 682 | } |
683 | 683 | ||
684 | public void llParcelMediaCommandList(List<string> commandList) { } | 684 | public void llParcelMediaCommandList(List<string> commandList) { } |
685 | public void llParcelMediaQuery() { } | 685 | public void llParcelMediaQuery() { } |
686 | 686 | ||
687 | public int llModPow(int a, int b, int c) | 687 | public int llModPow(int a, int b, int c) |
688 | { | 688 | { |
689 | Int64 tmp = 0; | 689 | Int64 tmp = 0; |
690 | Int64 val = Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp); | 690 | Int64 val = Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp); |
691 | return Convert.ToInt32(tmp); | 691 | return Convert.ToInt32(tmp); |
692 | } | 692 | } |
693 | 693 | ||
694 | public int llGetInventoryType(string name) { return 0; } | 694 | public int llGetInventoryType(string name) { return 0; } |
695 | 695 | ||
696 | public void llSetPayPrice(int price, List<string> quick_pay_buttons) { } | 696 | public void llSetPayPrice(int price, List<string> quick_pay_buttons) { } |
697 | public LSL_Types.Vector3 llGetCameraPos() { return new LSL_Types.Vector3(); } | 697 | public LSL_Types.Vector3 llGetCameraPos() { return new LSL_Types.Vector3(); } |
698 | public LSL_Types.Quaternion llGetCameraRot() { return new LSL_Types.Quaternion(); } | 698 | public LSL_Types.Quaternion llGetCameraRot() { return new LSL_Types.Quaternion(); } |
699 | public void llSetPrimURL() { } | 699 | public void llSetPrimURL() { } |
700 | public void llRefreshPrimURL() { } | 700 | public void llRefreshPrimURL() { } |
701 | 701 | ||
702 | public string llEscapeURL(string url) | 702 | public string llEscapeURL(string url) |
703 | { | 703 | { |
704 | try | 704 | try |
705 | { | 705 | { |
706 | return Uri.EscapeUriString(url); | 706 | return Uri.EscapeUriString(url); |
707 | } | 707 | } |
708 | catch (Exception ex) | 708 | catch (Exception ex) |
709 | { | 709 | { |
710 | return "llEscapeURL: " + ex.ToString(); | 710 | return "llEscapeURL: " + ex.ToString(); |
711 | } | 711 | } |
712 | } | 712 | } |
713 | 713 | ||
714 | public string llUnescapeURL(string url) | 714 | public string llUnescapeURL(string url) |
715 | { | 715 | { |
716 | try | 716 | try |
717 | { | 717 | { |
718 | return Uri.UnescapeDataString(url); | 718 | return Uri.UnescapeDataString(url); |
719 | } | 719 | } |
720 | catch (Exception ex) | 720 | catch (Exception ex) |
721 | { | 721 | { |
722 | return "llUnescapeURL: " + ex.ToString(); | 722 | return "llUnescapeURL: " + ex.ToString(); |
723 | } | 723 | } |
724 | } | 724 | } |
725 | public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at) { } | 725 | public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at) { } |
726 | public void llAddToLandBanList(string avatar, double hours) { } | 726 | public void llAddToLandBanList(string avatar, double hours) { } |
727 | public void llRemoveFromLandPassList(string avatar) { } | 727 | public void llRemoveFromLandPassList(string avatar) { } |
728 | public void llRemoveFromLandBanList(string avatar) { } | 728 | public void llRemoveFromLandBanList(string avatar) { } |
729 | public void llSetCameraParams(List<string> rules) { } | 729 | public void llSetCameraParams(List<string> rules) { } |
730 | public void llClearCameraParams() { } | 730 | public void llClearCameraParams() { } |
731 | public double llListStatistics(int operation, List<string> src) { return 0; } | 731 | public double llListStatistics(int operation, List<string> src) { return 0; } |
732 | 732 | ||
733 | public int llGetUnixTime() | 733 | public int llGetUnixTime() |
734 | { | 734 | { |
735 | return Util.UnixTimeSinceEpoch(); | 735 | return Util.UnixTimeSinceEpoch(); |
736 | } | 736 | } |
737 | 737 | ||
738 | public int llGetParcelFlags(LSL_Types.Vector3 pos) { return 0; } | 738 | public int llGetParcelFlags(LSL_Types.Vector3 pos) { return 0; } |
739 | public int llGetRegionFlags() { return 0; } | 739 | public int llGetRegionFlags() { return 0; } |
740 | public string llXorBase64StringsCorrect(string str1, string str2) { return ""; } | 740 | public string llXorBase64StringsCorrect(string str1, string str2) { return ""; } |
741 | public void llHTTPRequest() { } | 741 | public void llHTTPRequest() { } |
742 | public void llResetLandBanList() { } | 742 | public void llResetLandBanList() { } |
743 | public void llResetLandPassList() { } | 743 | public void llResetLandPassList() { } |
744 | public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { return 0; } | 744 | public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { return 0; } |
745 | public List<string> llGetParcelPrimOwners(LSL_Types.Vector3 pos) { return new List<string>(); } | 745 | public List<string> llGetParcelPrimOwners(LSL_Types.Vector3 pos) { return new List<string>(); } |
746 | public int llGetObjectPrimCount(string object_id) { return 0; } | 746 | public int llGetObjectPrimCount(string object_id) { return 0; } |
747 | public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) { return 0; } | 747 | public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) { return 0; } |
748 | public List<string> llGetParcelDetails(LSL_Types.Vector3 pos, List<string> param) { return new List<string>(); } | 748 | public List<string> llGetParcelDetails(LSL_Types.Vector3 pos, List<string> param) { return new List<string>(); } |
749 | 749 | ||
750 | // | 750 | // |
751 | // OpenSim functions | 751 | // OpenSim functions |
752 | // | 752 | // |
753 | public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer) | 753 | public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer) |
754 | { | 754 | { |
755 | if (dynamicID == "") | 755 | if (dynamicID == "") |
756 | { | 756 | { |
757 | IDynamicTextureManager textureManager = this.World.RequestModuleInterface<IDynamicTextureManager>(); | 757 | IDynamicTextureManager textureManager = this.World.RequestModuleInterface<IDynamicTextureManager>(); |
758 | LLUUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.SimUUID, this.m_host.UUID, contentType, url, extraParams, timer); | 758 | LLUUID createdTexture = textureManager.AddDynamicTextureURL(World.RegionInfo.SimUUID, this.m_host.UUID, contentType, url, extraParams, timer); |
759 | return createdTexture.ToStringHyphenated(); | 759 | return createdTexture.ToStringHyphenated(); |
760 | } | 760 | } |
761 | else | 761 | else |
762 | { | 762 | { |
763 | //TODO update existing dynamic textures | 763 | //TODO update existing dynamic textures |
764 | } | 764 | } |
765 | 765 | ||
766 | return LLUUID.Zero.ToStringHyphenated(); | 766 | return LLUUID.Zero.ToStringHyphenated(); |
767 | } | 767 | } |
768 | 768 | ||
769 | } | 769 | } |
770 | } | 770 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index 979865c..d4f0327 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs | |||
@@ -1,131 +1,131 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | using OpenSim.Framework.Interfaces; | 33 | using OpenSim.Framework.Interfaces; |
34 | using OpenSim.Region.Environment.Scenes.Scripting; | 34 | using OpenSim.Region.Environment.Scenes.Scripting; |
35 | 35 | ||
36 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 36 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. | 39 | /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. |
40 | /// </summary> | 40 | /// </summary> |
41 | [Serializable] | 41 | [Serializable] |
42 | class EventManager | 42 | class EventManager |
43 | { | 43 | { |
44 | private ScriptEngine myScriptEngine; | 44 | private ScriptEngine myScriptEngine; |
45 | //public IScriptHost TEMP_OBJECT_ID; | 45 | //public IScriptHost TEMP_OBJECT_ID; |
46 | public EventManager(ScriptEngine _ScriptEngine) | 46 | public EventManager(ScriptEngine _ScriptEngine) |
47 | { | 47 | { |
48 | myScriptEngine = _ScriptEngine; | 48 | myScriptEngine = _ScriptEngine; |
49 | // TODO: HOOK EVENTS UP TO SERVER! | 49 | // TODO: HOOK EVENTS UP TO SERVER! |
50 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Start"); | 50 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Start"); |
51 | // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager | 51 | // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager |
52 | 52 | ||
53 | // Hook up a test event to our test form | 53 | // Hook up a test event to our test form |
54 | myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); | 54 | myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); |
55 | myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); | 55 | myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); |
56 | myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); | 56 | myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); |
57 | myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript); | 57 | myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript); |
58 | 58 | ||
59 | } | 59 | } |
60 | 60 | ||
61 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 61 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
62 | { | 62 | { |
63 | // Add to queue for all scripts in ObjectID object | 63 | // Add to queue for all scripts in ObjectID object |
64 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); | 64 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); |
65 | //Console.WriteLine("touch_start localID: " + localID); | 65 | //Console.WriteLine("touch_start localID: " + localID); |
66 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] { (int)1 }); | 66 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] { (int)1 }); |
67 | } | 67 | } |
68 | public void OnRezScript(uint localID, LLUUID itemID, string script) | 68 | public void OnRezScript(uint localID, LLUUID itemID, string script) |
69 | { | 69 | { |
70 | //myScriptEngine.myScriptManager.StartScript( | 70 | //myScriptEngine.myScriptManager.StartScript( |
71 | // Path.Combine("ScriptEngines", "Default.lsl"), | 71 | // Path.Combine("ScriptEngines", "Default.lsl"), |
72 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() | 72 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() |
73 | //); | 73 | //); |
74 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length); | 74 | Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length); |
75 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); | 75 | myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); |
76 | } | 76 | } |
77 | public void OnRemoveScript(uint localID, LLUUID itemID) | 77 | public void OnRemoveScript(uint localID, LLUUID itemID) |
78 | { | 78 | { |
79 | //myScriptEngine.myScriptManager.StartScript( | 79 | //myScriptEngine.myScriptManager.StartScript( |
80 | // Path.Combine("ScriptEngines", "Default.lsl"), | 80 | // Path.Combine("ScriptEngines", "Default.lsl"), |
81 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() | 81 | // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() |
82 | //); | 82 | //); |
83 | Console.WriteLine("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); | 83 | Console.WriteLine("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); |
84 | myScriptEngine.m_ScriptManager.StopScript( | 84 | myScriptEngine.m_ScriptManager.StopScript( |
85 | localID, | 85 | localID, |
86 | itemID | 86 | itemID |
87 | ); | 87 | ); |
88 | 88 | ||
89 | } | 89 | } |
90 | 90 | ||
91 | // TODO: Replace placeholders below | 91 | // TODO: Replace placeholders below |
92 | // These needs to be hooked up to OpenSim during init of this class | 92 | // These needs to be hooked up to OpenSim during init of this class |
93 | // then queued in EventQueueManager. | 93 | // then queued in EventQueueManager. |
94 | // When queued in EventQueueManager they need to be LSL compatible (name and params) | 94 | // When queued in EventQueueManager they need to be LSL compatible (name and params) |
95 | 95 | ||
96 | //public void state_entry() { } // | 96 | //public void state_entry() { } // |
97 | public void state_exit() { } | 97 | public void state_exit() { } |
98 | //public void touch_start() { } | 98 | //public void touch_start() { } |
99 | public void touch() { } | 99 | public void touch() { } |
100 | public void touch_end() { } | 100 | public void touch_end() { } |
101 | public void collision_start() { } | 101 | public void collision_start() { } |
102 | public void collision() { } | 102 | public void collision() { } |
103 | public void collision_end() { } | 103 | public void collision_end() { } |
104 | public void land_collision_start() { } | 104 | public void land_collision_start() { } |
105 | public void land_collision() { } | 105 | public void land_collision() { } |
106 | public void land_collision_end() { } | 106 | public void land_collision_end() { } |
107 | public void timer() { } | 107 | public void timer() { } |
108 | public void listen() { } | 108 | public void listen() { } |
109 | public void on_rez() { } | 109 | public void on_rez() { } |
110 | public void sensor() { } | 110 | public void sensor() { } |
111 | public void no_sensor() { } | 111 | public void no_sensor() { } |
112 | public void control() { } | 112 | public void control() { } |
113 | public void money() { } | 113 | public void money() { } |
114 | public void email() { } | 114 | public void email() { } |
115 | public void at_target() { } | 115 | public void at_target() { } |
116 | public void not_at_target() { } | 116 | public void not_at_target() { } |
117 | public void at_rot_target() { } | 117 | public void at_rot_target() { } |
118 | public void not_at_rot_target() { } | 118 | public void not_at_rot_target() { } |
119 | public void run_time_permissions() { } | 119 | public void run_time_permissions() { } |
120 | public void changed() { } | 120 | public void changed() { } |
121 | public void attach() { } | 121 | public void attach() { } |
122 | public void dataserver() { } | 122 | public void dataserver() { } |
123 | public void link_message() { } | 123 | public void link_message() { } |
124 | public void moving_start() { } | 124 | public void moving_start() { } |
125 | public void moving_end() { } | 125 | public void moving_end() { } |
126 | public void object_rez() { } | 126 | public void object_rez() { } |
127 | public void remote_data() { } | 127 | public void remote_data() { } |
128 | public void http_response() { } | 128 | public void http_response() { } |
129 | 129 | ||
130 | } | 130 | } |
131 | } | 131 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs index 3dc5d77..955e978 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs | |||
@@ -1,321 +1,321 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using OpenSim.Region.Environment.Scenes.Scripting; | 34 | using OpenSim.Region.Environment.Scenes.Scripting; |
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 36 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
37 | 37 | ||
38 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 38 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// EventQueueManager handles event queues | 41 | /// EventQueueManager handles event queues |
42 | /// Events are queued and executed in separate thread | 42 | /// Events are queued and executed in separate thread |
43 | /// </summary> | 43 | /// </summary> |
44 | [Serializable] | 44 | [Serializable] |
45 | class EventQueueManager | 45 | class EventQueueManager |
46 | { | 46 | { |
47 | /// <summary> | 47 | /// <summary> |
48 | /// List of threads processing event queue | 48 | /// List of threads processing event queue |
49 | /// </summary> | 49 | /// </summary> |
50 | private List<Thread> eventQueueThreads = new List<Thread>(); | 50 | private List<Thread> eventQueueThreads = new List<Thread>(); |
51 | private object queueLock = new object(); // Mutex lock object | 51 | private object queueLock = new object(); // Mutex lock object |
52 | /// <summary> | 52 | /// <summary> |
53 | /// How many ms to sleep if queue is empty | 53 | /// How many ms to sleep if queue is empty |
54 | /// </summary> | 54 | /// </summary> |
55 | private int nothingToDoSleepms = 50; | 55 | private int nothingToDoSleepms = 50; |
56 | /// <summary> | 56 | /// <summary> |
57 | /// How many threads to process queue with | 57 | /// How many threads to process queue with |
58 | /// </summary> | 58 | /// </summary> |
59 | private int numberOfThreads = 2; | 59 | private int numberOfThreads = 2; |
60 | /// <summary> | 60 | /// <summary> |
61 | /// Queue containing events waiting to be executed | 61 | /// Queue containing events waiting to be executed |
62 | /// </summary> | 62 | /// </summary> |
63 | private Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); | 63 | private Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); |
64 | /// <summary> | 64 | /// <summary> |
65 | /// Queue item structure | 65 | /// Queue item structure |
66 | /// </summary> | 66 | /// </summary> |
67 | private struct QueueItemStruct | 67 | private struct QueueItemStruct |
68 | { | 68 | { |
69 | public uint localID; | 69 | public uint localID; |
70 | public LLUUID itemID; | 70 | public LLUUID itemID; |
71 | public string functionName; | 71 | public string functionName; |
72 | public object[] param; | 72 | public object[] param; |
73 | } | 73 | } |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// List of localID locks for mutex processing of script events | 76 | /// List of localID locks for mutex processing of script events |
77 | /// </summary> | 77 | /// </summary> |
78 | private List<uint> objectLocks = new List<uint>(); | 78 | private List<uint> objectLocks = new List<uint>(); |
79 | private object tryLockLock = new object(); // Mutex lock object | 79 | private object tryLockLock = new object(); // Mutex lock object |
80 | 80 | ||
81 | private ScriptEngine m_ScriptEngine; | 81 | private ScriptEngine m_ScriptEngine; |
82 | public EventQueueManager(ScriptEngine _ScriptEngine) | 82 | public EventQueueManager(ScriptEngine _ScriptEngine) |
83 | { | 83 | { |
84 | m_ScriptEngine = _ScriptEngine; | 84 | m_ScriptEngine = _ScriptEngine; |
85 | 85 | ||
86 | // | 86 | // |
87 | // Start event queue processing threads (worker threads) | 87 | // Start event queue processing threads (worker threads) |
88 | // | 88 | // |
89 | for (int ThreadCount = 0; ThreadCount <= numberOfThreads; ThreadCount++) | 89 | for (int ThreadCount = 0; ThreadCount <= numberOfThreads; ThreadCount++) |
90 | { | 90 | { |
91 | Thread EventQueueThread = new Thread(EventQueueThreadLoop); | 91 | Thread EventQueueThread = new Thread(EventQueueThreadLoop); |
92 | eventQueueThreads.Add(EventQueueThread); | 92 | eventQueueThreads.Add(EventQueueThread); |
93 | EventQueueThread.IsBackground = true; | 93 | EventQueueThread.IsBackground = true; |
94 | EventQueueThread.Priority = ThreadPriority.BelowNormal; | 94 | EventQueueThread.Priority = ThreadPriority.BelowNormal; |
95 | EventQueueThread.Name = "EventQueueManagerThread_" + ThreadCount; | 95 | EventQueueThread.Name = "EventQueueManagerThread_" + ThreadCount; |
96 | EventQueueThread.Start(); | 96 | EventQueueThread.Start(); |
97 | } | 97 | } |
98 | } | 98 | } |
99 | ~EventQueueManager() | 99 | ~EventQueueManager() |
100 | { | 100 | { |
101 | 101 | ||
102 | // Kill worker threads | 102 | // Kill worker threads |
103 | foreach (Thread EventQueueThread in new System.Collections.ArrayList(eventQueueThreads)) | 103 | foreach (Thread EventQueueThread in new System.Collections.ArrayList(eventQueueThreads)) |
104 | { | 104 | { |
105 | if (EventQueueThread != null && EventQueueThread.IsAlive == true) | 105 | if (EventQueueThread != null && EventQueueThread.IsAlive == true) |
106 | { | 106 | { |
107 | try | 107 | try |
108 | { | 108 | { |
109 | EventQueueThread.Abort(); | 109 | EventQueueThread.Abort(); |
110 | EventQueueThread.Join(); | 110 | EventQueueThread.Join(); |
111 | } | 111 | } |
112 | catch (Exception) | 112 | catch (Exception) |
113 | { | 113 | { |
114 | //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString()); | 114 | //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString()); |
115 | } | 115 | } |
116 | } | 116 | } |
117 | } | 117 | } |
118 | eventQueueThreads.Clear(); | 118 | eventQueueThreads.Clear(); |
119 | // Todo: Clean up our queues | 119 | // Todo: Clean up our queues |
120 | eventQueue.Clear(); | 120 | eventQueue.Clear(); |
121 | 121 | ||
122 | } | 122 | } |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// Queue processing thread loop | 125 | /// Queue processing thread loop |
126 | /// </summary> | 126 | /// </summary> |
127 | private void EventQueueThreadLoop() | 127 | private void EventQueueThreadLoop() |
128 | { | 128 | { |
129 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned"); | 129 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned"); |
130 | try | 130 | try |
131 | { | 131 | { |
132 | QueueItemStruct BlankQIS = new QueueItemStruct(); | 132 | QueueItemStruct BlankQIS = new QueueItemStruct(); |
133 | while (true) | 133 | while (true) |
134 | { | 134 | { |
135 | try | 135 | try |
136 | { | 136 | { |
137 | QueueItemStruct QIS = BlankQIS; | 137 | QueueItemStruct QIS = BlankQIS; |
138 | bool GotItem = false; | 138 | bool GotItem = false; |
139 | 139 | ||
140 | if (eventQueue.Count == 0) | 140 | if (eventQueue.Count == 0) |
141 | { | 141 | { |
142 | // Nothing to do? Sleep a bit waiting for something to do | 142 | // Nothing to do? Sleep a bit waiting for something to do |
143 | Thread.Sleep(nothingToDoSleepms); | 143 | Thread.Sleep(nothingToDoSleepms); |
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | // Something in queue, process | 147 | // Something in queue, process |
148 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName); | 148 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName); |
149 | 149 | ||
150 | // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD | 150 | // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD |
151 | lock (queueLock) | 151 | lock (queueLock) |
152 | { | 152 | { |
153 | GotItem = false; | 153 | GotItem = false; |
154 | for (int qc = 0; qc < eventQueue.Count; qc++) | 154 | for (int qc = 0; qc < eventQueue.Count; qc++) |
155 | { | 155 | { |
156 | // Get queue item | 156 | // Get queue item |
157 | QIS = eventQueue.Dequeue(); | 157 | QIS = eventQueue.Dequeue(); |
158 | 158 | ||
159 | // Check if object is being processed by someone else | 159 | // Check if object is being processed by someone else |
160 | if (TryLock(QIS.localID) == false) | 160 | if (TryLock(QIS.localID) == false) |
161 | { | 161 | { |
162 | // Object is already being processed, requeue it | 162 | // Object is already being processed, requeue it |
163 | eventQueue.Enqueue(QIS); | 163 | eventQueue.Enqueue(QIS); |
164 | } | 164 | } |
165 | else | 165 | else |
166 | { | 166 | { |
167 | // We have lock on an object and can process it | 167 | // We have lock on an object and can process it |
168 | GotItem = true; | 168 | GotItem = true; |
169 | break; | 169 | break; |
170 | } | 170 | } |
171 | } // go through queue | 171 | } // go through queue |
172 | } // lock | 172 | } // lock |
173 | 173 | ||
174 | if (GotItem == true) | 174 | if (GotItem == true) |
175 | { | 175 | { |
176 | // Execute function | 176 | // Execute function |
177 | try | 177 | try |
178 | { | 178 | { |
179 | m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID, QIS.functionName, QIS.param); | 179 | m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID, QIS.functionName, QIS.param); |
180 | } | 180 | } |
181 | catch (Exception e) | 181 | catch (Exception e) |
182 | { | 182 | { |
183 | // DISPLAY ERROR INWORLD | 183 | // DISPLAY ERROR INWORLD |
184 | string text = "Error executing script function \"" + QIS.functionName + "\":\r\n"; | 184 | string text = "Error executing script function \"" + QIS.functionName + "\":\r\n"; |
185 | if (e.InnerException != null) | 185 | if (e.InnerException != null) |
186 | { // Send inner exception | 186 | { // Send inner exception |
187 | text += e.InnerException.Message.ToString(); | 187 | text += e.InnerException.Message.ToString(); |
188 | } | 188 | } |
189 | else | 189 | else |
190 | { // Send normal | 190 | { // Send normal |
191 | text += e.Message.ToString(); | 191 | text += e.Message.ToString(); |
192 | } | 192 | } |
193 | try | 193 | try |
194 | { | 194 | { |
195 | if (text.Length > 1500) | 195 | if (text.Length > 1500) |
196 | text = text.Substring(0, 1500); | 196 | text = text.Substring(0, 1500); |
197 | IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); | 197 | IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); |
198 | //if (m_host != null) | 198 | //if (m_host != null) |
199 | //{ | 199 | //{ |
200 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text), 1, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 200 | m_ScriptEngine.World.SimChat(Helpers.StringToField(text), 1, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
201 | } catch { | 201 | } catch { |
202 | //} | 202 | //} |
203 | //else | 203 | //else |
204 | //{ | 204 | //{ |
205 | // T oconsole | 205 | // T oconsole |
206 | Console.WriteLine("Unable to send text in-world:\r\n" + text); | 206 | Console.WriteLine("Unable to send text in-world:\r\n" + text); |
207 | } | 207 | } |
208 | 208 | ||
209 | } | 209 | } |
210 | finally | 210 | finally |
211 | { | 211 | { |
212 | ReleaseLock(QIS.localID); | 212 | ReleaseLock(QIS.localID); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | } // Something in queue | 216 | } // Something in queue |
217 | } catch (ThreadAbortException tae) { | 217 | } catch (ThreadAbortException tae) { |
218 | throw tae; | 218 | throw tae; |
219 | } catch (Exception e) { | 219 | } catch (Exception e) { |
220 | Console.WriteLine("Exception in EventQueueThreadLoop: " + e.ToString()); | 220 | Console.WriteLine("Exception in EventQueueThreadLoop: " + e.ToString()); |
221 | } | 221 | } |
222 | } // while | 222 | } // while |
223 | } // try | 223 | } // try |
224 | catch (ThreadAbortException) | 224 | catch (ThreadAbortException) |
225 | { | 225 | { |
226 | //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message); | 226 | //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message); |
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | /// <summary> | 230 | /// <summary> |
231 | /// Try to get a mutex lock on localID | 231 | /// Try to get a mutex lock on localID |
232 | /// </summary> | 232 | /// </summary> |
233 | /// <param name="localID"></param> | 233 | /// <param name="localID"></param> |
234 | /// <returns></returns> | 234 | /// <returns></returns> |
235 | private bool TryLock(uint localID) | 235 | private bool TryLock(uint localID) |
236 | { | 236 | { |
237 | lock (tryLockLock) | 237 | lock (tryLockLock) |
238 | { | 238 | { |
239 | if (objectLocks.Contains(localID) == true) | 239 | if (objectLocks.Contains(localID) == true) |
240 | { | 240 | { |
241 | return false; | 241 | return false; |
242 | } | 242 | } |
243 | else | 243 | else |
244 | { | 244 | { |
245 | objectLocks.Add(localID); | 245 | objectLocks.Add(localID); |
246 | return true; | 246 | return true; |
247 | } | 247 | } |
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||
251 | /// <summary> | 251 | /// <summary> |
252 | /// Release mutex lock on localID | 252 | /// Release mutex lock on localID |
253 | /// </summary> | 253 | /// </summary> |
254 | /// <param name="localID"></param> | 254 | /// <param name="localID"></param> |
255 | private void ReleaseLock(uint localID) | 255 | private void ReleaseLock(uint localID) |
256 | { | 256 | { |
257 | lock (tryLockLock) | 257 | lock (tryLockLock) |
258 | { | 258 | { |
259 | if (objectLocks.Contains(localID) == true) | 259 | if (objectLocks.Contains(localID) == true) |
260 | { | 260 | { |
261 | objectLocks.Remove(localID); | 261 | objectLocks.Remove(localID); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | /// <summary> | 267 | /// <summary> |
268 | /// Add event to event execution queue | 268 | /// Add event to event execution queue |
269 | /// </summary> | 269 | /// </summary> |
270 | /// <param name="localID"></param> | 270 | /// <param name="localID"></param> |
271 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 271 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
272 | /// <param name="param">Array of parameters to match event mask</param> | 272 | /// <param name="param">Array of parameters to match event mask</param> |
273 | public void AddToObjectQueue(uint localID, string FunctionName, object[] param) | 273 | public void AddToObjectQueue(uint localID, string FunctionName, object[] param) |
274 | { | 274 | { |
275 | // Determine all scripts in Object and add to their queue | 275 | // Determine all scripts in Object and add to their queue |
276 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); | 276 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); |
277 | 277 | ||
278 | 278 | ||
279 | // Do we have any scripts in this object at all? If not, return | 279 | // Do we have any scripts in this object at all? If not, return |
280 | if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false) | 280 | if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false) |
281 | { | 281 | { |
282 | //Console.WriteLine("Event \"" + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); | 282 | //Console.WriteLine("Event \"" + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); |
283 | return; | 283 | return; |
284 | } | 284 | } |
285 | 285 | ||
286 | Dictionary<LLUUID, LSL_BaseClass>.KeyCollection scriptKeys = m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID); | 286 | Dictionary<LLUUID, LSL_BaseClass>.KeyCollection scriptKeys = m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID); |
287 | 287 | ||
288 | foreach ( LLUUID itemID in scriptKeys ) | 288 | foreach ( LLUUID itemID in scriptKeys ) |
289 | { | 289 | { |
290 | // Add to each script in that object | 290 | // Add to each script in that object |
291 | // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? | 291 | // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? |
292 | AddToScriptQueue(localID, itemID, FunctionName, param); | 292 | AddToScriptQueue(localID, itemID, FunctionName, param); |
293 | } | 293 | } |
294 | 294 | ||
295 | } | 295 | } |
296 | 296 | ||
297 | /// <summary> | 297 | /// <summary> |
298 | /// Add event to event execution queue | 298 | /// Add event to event execution queue |
299 | /// </summary> | 299 | /// </summary> |
300 | /// <param name="localID"></param> | 300 | /// <param name="localID"></param> |
301 | /// <param name="itemID"></param> | 301 | /// <param name="itemID"></param> |
302 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 302 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
303 | /// <param name="param">Array of parameters to match event mask</param> | 303 | /// <param name="param">Array of parameters to match event mask</param> |
304 | public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, object[] param) | 304 | public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, object[] param) |
305 | { | 305 | { |
306 | lock (queueLock) | 306 | lock (queueLock) |
307 | { | 307 | { |
308 | // Create a structure and add data | 308 | // Create a structure and add data |
309 | QueueItemStruct QIS = new QueueItemStruct(); | 309 | QueueItemStruct QIS = new QueueItemStruct(); |
310 | QIS.localID = localID; | 310 | QIS.localID = localID; |
311 | QIS.itemID = itemID; | 311 | QIS.itemID = itemID; |
312 | QIS.functionName = FunctionName; | 312 | QIS.functionName = FunctionName; |
313 | QIS.param = param; | 313 | QIS.param = param; |
314 | 314 | ||
315 | // Add it to queue | 315 | // Add it to queue |
316 | eventQueue.Enqueue(QIS); | 316 | eventQueue.Enqueue(QIS); |
317 | } | 317 | } |
318 | } | 318 | } |
319 | 319 | ||
320 | } | 320 | } |
321 | } | 321 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs index 7ce6556..af8a62e 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs | |||
@@ -1,148 +1,148 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.Threading; | 4 | using System.Threading; |
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | 6 | ||
7 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 7 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
8 | { | 8 | { |
9 | /// <summary> | 9 | /// <summary> |
10 | /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc. | 10 | /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc. |
11 | /// </summary> | 11 | /// </summary> |
12 | class LSLLongCmdHandler | 12 | class LSLLongCmdHandler |
13 | { | 13 | { |
14 | private Thread cmdHandlerThread; | 14 | private Thread cmdHandlerThread; |
15 | private int cmdHandlerThreadCycleSleepms = 100; | 15 | private int cmdHandlerThreadCycleSleepms = 100; |
16 | 16 | ||
17 | private ScriptEngine m_ScriptEngine; | 17 | private ScriptEngine m_ScriptEngine; |
18 | public LSLLongCmdHandler(ScriptEngine _ScriptEngine) | 18 | public LSLLongCmdHandler(ScriptEngine _ScriptEngine) |
19 | { | 19 | { |
20 | m_ScriptEngine = _ScriptEngine; | 20 | m_ScriptEngine = _ScriptEngine; |
21 | 21 | ||
22 | // Start the thread that will be doing the work | 22 | // Start the thread that will be doing the work |
23 | cmdHandlerThread = new Thread(CmdHandlerThreadLoop); | 23 | cmdHandlerThread = new Thread(CmdHandlerThreadLoop); |
24 | cmdHandlerThread.Name = "CmdHandlerThread"; | 24 | cmdHandlerThread.Name = "CmdHandlerThread"; |
25 | cmdHandlerThread.Priority = ThreadPriority.BelowNormal; | 25 | cmdHandlerThread.Priority = ThreadPriority.BelowNormal; |
26 | cmdHandlerThread.IsBackground = true; | 26 | cmdHandlerThread.IsBackground = true; |
27 | cmdHandlerThread.Start(); | 27 | cmdHandlerThread.Start(); |
28 | } | 28 | } |
29 | ~LSLLongCmdHandler() | 29 | ~LSLLongCmdHandler() |
30 | { | 30 | { |
31 | // Shut down thread | 31 | // Shut down thread |
32 | try | 32 | try |
33 | { | 33 | { |
34 | if (cmdHandlerThread != null) | 34 | if (cmdHandlerThread != null) |
35 | { | 35 | { |
36 | if (cmdHandlerThread.IsAlive == true) | 36 | if (cmdHandlerThread.IsAlive == true) |
37 | { | 37 | { |
38 | cmdHandlerThread.Abort(); | 38 | cmdHandlerThread.Abort(); |
39 | cmdHandlerThread.Join(); | 39 | cmdHandlerThread.Join(); |
40 | } | 40 | } |
41 | } | 41 | } |
42 | } | 42 | } |
43 | catch { } | 43 | catch { } |
44 | } | 44 | } |
45 | 45 | ||
46 | private void CmdHandlerThreadLoop() | 46 | private void CmdHandlerThreadLoop() |
47 | { | 47 | { |
48 | while (true) | 48 | while (true) |
49 | { | 49 | { |
50 | // Check timers | 50 | // Check timers |
51 | CheckTimerEvents(); | 51 | CheckTimerEvents(); |
52 | 52 | ||
53 | // Sleep before next cycle | 53 | // Sleep before next cycle |
54 | Thread.Sleep(cmdHandlerThreadCycleSleepms); | 54 | Thread.Sleep(cmdHandlerThreadCycleSleepms); |
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Remove a specific script (and all its pending commands) | 59 | /// Remove a specific script (and all its pending commands) |
60 | /// </summary> | 60 | /// </summary> |
61 | /// <param name="m_localID"></param> | 61 | /// <param name="m_localID"></param> |
62 | /// <param name="m_itemID"></param> | 62 | /// <param name="m_itemID"></param> |
63 | public void RemoveScript(uint m_localID, LLUUID m_itemID) | 63 | public void RemoveScript(uint m_localID, LLUUID m_itemID) |
64 | { | 64 | { |
65 | // Remove a specific script | 65 | // Remove a specific script |
66 | 66 | ||
67 | // Remove from: Timers | 67 | // Remove from: Timers |
68 | UnSetTimerEvents(m_localID, m_itemID); | 68 | UnSetTimerEvents(m_localID, m_itemID); |
69 | } | 69 | } |
70 | 70 | ||
71 | 71 | ||
72 | // | 72 | // |
73 | // TIMER | 73 | // TIMER |
74 | // | 74 | // |
75 | private class TimerClass | 75 | private class TimerClass |
76 | { | 76 | { |
77 | public uint localID; | 77 | public uint localID; |
78 | public LLUUID itemID; | 78 | public LLUUID itemID; |
79 | public double interval; | 79 | public double interval; |
80 | public DateTime next; | 80 | public DateTime next; |
81 | } | 81 | } |
82 | private List<TimerClass> Timers = new List<TimerClass>(); | 82 | private List<TimerClass> Timers = new List<TimerClass>(); |
83 | private object ListLock = new object(); | 83 | private object ListLock = new object(); |
84 | public void SetTimerEvent(uint m_localID, LLUUID m_itemID, double sec) | 84 | public void SetTimerEvent(uint m_localID, LLUUID m_itemID, double sec) |
85 | { | 85 | { |
86 | Console.WriteLine("SetTimerEvent"); | 86 | Console.WriteLine("SetTimerEvent"); |
87 | 87 | ||
88 | // Always remove first, in case this is a re-set | 88 | // Always remove first, in case this is a re-set |
89 | UnSetTimerEvents(m_localID, m_itemID); | 89 | UnSetTimerEvents(m_localID, m_itemID); |
90 | if (sec == 0) // Disabling timer | 90 | if (sec == 0) // Disabling timer |
91 | return; | 91 | return; |
92 | 92 | ||
93 | // Add to timer | 93 | // Add to timer |
94 | TimerClass ts = new TimerClass(); | 94 | TimerClass ts = new TimerClass(); |
95 | ts.localID = m_localID; | 95 | ts.localID = m_localID; |
96 | ts.itemID = m_itemID; | 96 | ts.itemID = m_itemID; |
97 | ts.interval = sec; | 97 | ts.interval = sec; |
98 | ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); | 98 | ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); |
99 | lock (ListLock) | 99 | lock (ListLock) |
100 | { | 100 | { |
101 | Timers.Add(ts); | 101 | Timers.Add(ts); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | public void UnSetTimerEvents(uint m_localID, LLUUID m_itemID) | 104 | public void UnSetTimerEvents(uint m_localID, LLUUID m_itemID) |
105 | { | 105 | { |
106 | // Remove from timer | 106 | // Remove from timer |
107 | lock (ListLock) | 107 | lock (ListLock) |
108 | { | 108 | { |
109 | List<TimerClass> NewTimers = new List<TimerClass>(); | 109 | List<TimerClass> NewTimers = new List<TimerClass>(); |
110 | foreach (TimerClass ts in Timers) | 110 | foreach (TimerClass ts in Timers) |
111 | { | 111 | { |
112 | if (ts.localID != m_localID && ts.itemID != m_itemID) | 112 | if (ts.localID != m_localID && ts.itemID != m_itemID) |
113 | { | 113 | { |
114 | NewTimers.Add(ts); | 114 | NewTimers.Add(ts); |
115 | } | 115 | } |
116 | } | 116 | } |
117 | Timers.Clear(); | 117 | Timers.Clear(); |
118 | Timers = NewTimers; | 118 | Timers = NewTimers; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | public void CheckTimerEvents() | 121 | public void CheckTimerEvents() |
122 | { | 122 | { |
123 | // Nothing to do here? | 123 | // Nothing to do here? |
124 | if (Timers.Count == 0) | 124 | if (Timers.Count == 0) |
125 | return; | 125 | return; |
126 | 126 | ||
127 | lock (ListLock) | 127 | lock (ListLock) |
128 | { | 128 | { |
129 | 129 | ||
130 | // Go through all timers | 130 | // Go through all timers |
131 | foreach (TimerClass ts in Timers) | 131 | foreach (TimerClass ts in Timers) |
132 | { | 132 | { |
133 | // Time has passed? | 133 | // Time has passed? |
134 | if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) | 134 | if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) |
135 | { | 135 | { |
136 | // Add it to queue | 136 | // Add it to queue |
137 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { }); | 137 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { }); |
138 | // set next interval | 138 | // set next interval |
139 | 139 | ||
140 | 140 | ||
141 | ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); | 141 | ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); |
142 | } | 142 | } |
143 | } | 143 | } |
144 | } // lock | 144 | } // lock |
145 | } | 145 | } |
146 | 146 | ||
147 | } | 147 | } |
148 | } | 148 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs index aa76b6a..0aa1a0b 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs | |||
@@ -1,35 +1,35 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Runtime.CompilerServices; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | 4 | ||
5 | // General Information about an assembly is controlled through the following | 5 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 6 | // set of attributes. Change these attribute values to modify the information |
7 | // associated with an assembly. | 7 | // associated with an assembly. |
8 | [assembly: AssemblyTitle("OpenSim.Region.ScriptEngine.DotNetEngine")] | 8 | [assembly: AssemblyTitle("OpenSim.Region.ScriptEngine.DotNetEngine")] |
9 | [assembly: AssemblyDescription("")] | 9 | [assembly: AssemblyDescription("")] |
10 | [assembly: AssemblyConfiguration("")] | 10 | [assembly: AssemblyConfiguration("")] |
11 | [assembly: AssemblyCompany("")] | 11 | [assembly: AssemblyCompany("")] |
12 | [assembly: AssemblyProduct("OpenSim.Region.ScriptEngine.DotNetEngine")] | 12 | [assembly: AssemblyProduct("OpenSim.Region.ScriptEngine.DotNetEngine")] |
13 | [assembly: AssemblyCopyright("Copyright © 2007")] | 13 | [assembly: AssemblyCopyright("Copyright © 2007")] |
14 | [assembly: AssemblyTrademark("")] | 14 | [assembly: AssemblyTrademark("")] |
15 | [assembly: AssemblyCulture("")] | 15 | [assembly: AssemblyCulture("")] |
16 | 16 | ||
17 | // Setting ComVisible to false makes the types in this assembly not visible | 17 | // Setting ComVisible to false makes the types in this assembly not visible |
18 | // to COM components. If you need to access a type in this assembly from | 18 | // to COM components. If you need to access a type in this assembly from |
19 | // COM, set the ComVisible attribute to true on that type. | 19 | // COM, set the ComVisible attribute to true on that type. |
20 | [assembly: ComVisible(false)] | 20 | [assembly: ComVisible(false)] |
21 | 21 | ||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
23 | [assembly: Guid("2842257e-6fde-4460-9368-4cde57fa9cc4")] | 23 | [assembly: Guid("2842257e-6fde-4460-9368-4cde57fa9cc4")] |
24 | 24 | ||
25 | // Version information for an assembly consists of the following four values: | 25 | // Version information for an assembly consists of the following four values: |
26 | // | 26 | // |
27 | // Major Version | 27 | // Major Version |
28 | // Minor Version | 28 | // Minor Version |
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | // You can specify all the values or you can default the Revision and Build Numbers | 32 | // You can specify all the values or you can default the Revision and Build Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | [assembly: AssemblyVersion("1.0.0.0")] | 34 | [assembly: AssemblyVersion("1.0.0.0")] |
35 | [assembly: AssemblyFileVersion("1.0.0.0")] | 35 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 73cf851..c57e56a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -1,132 +1,132 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using OpenSim.Framework.Console; | 32 | using OpenSim.Framework.Console; |
33 | using OpenSim.Region.Environment.Scenes; | 33 | using OpenSim.Region.Environment.Scenes; |
34 | using OpenSim.Region.Environment.Scenes.Scripting; | 34 | using OpenSim.Region.Environment.Scenes.Scripting; |
35 | using OpenSim.Region.Environment.Interfaces; | 35 | using OpenSim.Region.Environment.Interfaces; |
36 | using libsecondlife; | 36 | using libsecondlife; |
37 | 37 | ||
38 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 38 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// This is the root object for ScriptEngine | 41 | /// This is the root object for ScriptEngine |
42 | /// </summary> | 42 | /// </summary> |
43 | [Serializable] | 43 | [Serializable] |
44 | public class ScriptEngine :IRegionModule | 44 | public class ScriptEngine :IRegionModule |
45 | { | 45 | { |
46 | 46 | ||
47 | internal OpenSim.Region.Environment.Scenes.Scene World; | 47 | internal OpenSim.Region.Environment.Scenes.Scene World; |
48 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim | 48 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim |
49 | internal EventQueueManager m_EventQueueManager; // Executes events | 49 | internal EventQueueManager m_EventQueueManager; // Executes events |
50 | internal ScriptManager m_ScriptManager; // Load, unload and execute scripts | 50 | internal ScriptManager m_ScriptManager; // Load, unload and execute scripts |
51 | internal AppDomainManager m_AppDomainManager; | 51 | internal AppDomainManager m_AppDomainManager; |
52 | internal LSLLongCmdHandler m_LSLLongCmdHandler; | 52 | internal LSLLongCmdHandler m_LSLLongCmdHandler; |
53 | 53 | ||
54 | private OpenSim.Framework.Console.LogBase m_log; | 54 | private OpenSim.Framework.Console.LogBase m_log; |
55 | 55 | ||
56 | public ScriptEngine() | 56 | public ScriptEngine() |
57 | { | 57 | { |
58 | //Common.SendToDebug("ScriptEngine Object Initialized"); | 58 | //Common.SendToDebug("ScriptEngine Object Initialized"); |
59 | Common.mySE = this; | 59 | Common.mySE = this; |
60 | } | 60 | } |
61 | 61 | ||
62 | public LogBase Log | 62 | public LogBase Log |
63 | { | 63 | { |
64 | get { return m_log; } | 64 | get { return m_log; } |
65 | } | 65 | } |
66 | 66 | ||
67 | public void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger) | 67 | public void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger) |
68 | { | 68 | { |
69 | 69 | ||
70 | World = Sceneworld; | 70 | World = Sceneworld; |
71 | m_log = logger; | 71 | m_log = logger; |
72 | 72 | ||
73 | Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); | 73 | Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); |
74 | 74 | ||
75 | //m_logger.Status("ScriptEngine", "InitializeEngine"); | 75 | //m_logger.Status("ScriptEngine", "InitializeEngine"); |
76 | 76 | ||
77 | // Create all objects we'll be using | 77 | // Create all objects we'll be using |
78 | m_EventQueueManager = new EventQueueManager(this); | 78 | m_EventQueueManager = new EventQueueManager(this); |
79 | m_EventManager = new EventManager(this); | 79 | m_EventManager = new EventManager(this); |
80 | m_ScriptManager = new ScriptManager(this); | 80 | m_ScriptManager = new ScriptManager(this); |
81 | m_AppDomainManager = new AppDomainManager(); | 81 | m_AppDomainManager = new AppDomainManager(); |
82 | m_LSLLongCmdHandler = new LSLLongCmdHandler(this); | 82 | m_LSLLongCmdHandler = new LSLLongCmdHandler(this); |
83 | 83 | ||
84 | // Should we iterate the region for scripts that needs starting? | 84 | // Should we iterate the region for scripts that needs starting? |
85 | // Or can we assume we are loaded before anything else so we can use proper events? | 85 | // Or can we assume we are loaded before anything else so we can use proper events? |
86 | 86 | ||
87 | 87 | ||
88 | } | 88 | } |
89 | 89 | ||
90 | public void Shutdown() | 90 | public void Shutdown() |
91 | { | 91 | { |
92 | // We are shutting down | 92 | // We are shutting down |
93 | } | 93 | } |
94 | 94 | ||
95 | //// !!!FOR DEBUGGING ONLY!!! (for executing script directly from test app) | 95 | //// !!!FOR DEBUGGING ONLY!!! (for executing script directly from test app) |
96 | //[Obsolete("!!!FOR DEBUGGING ONLY!!!")] | 96 | //[Obsolete("!!!FOR DEBUGGING ONLY!!!")] |
97 | //public void StartScript(string ScriptID, IScriptHost ObjectID) | 97 | //public void StartScript(string ScriptID, IScriptHost ObjectID) |
98 | //{ | 98 | //{ |
99 | // this.myEventManager.TEMP_OBJECT_ID = ObjectID; | 99 | // this.myEventManager.TEMP_OBJECT_ID = ObjectID; |
100 | // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); | 100 | // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); |
101 | // myScriptManager.StartScript(ScriptID, ObjectID); | 101 | // myScriptManager.StartScript(ScriptID, ObjectID); |
102 | //} | 102 | //} |
103 | 103 | ||
104 | #region IRegionModule | 104 | #region IRegionModule |
105 | 105 | ||
106 | public void Initialise(Scene scene) | 106 | public void Initialise(Scene scene) |
107 | { | 107 | { |
108 | this.InitializeEngine(scene, MainLog.Instance); | 108 | this.InitializeEngine(scene, MainLog.Instance); |
109 | } | 109 | } |
110 | 110 | ||
111 | public void PostInitialise() | 111 | public void PostInitialise() |
112 | { | 112 | { |
113 | 113 | ||
114 | } | 114 | } |
115 | 115 | ||
116 | public void CloseDown() | 116 | public void CloseDown() |
117 | { | 117 | { |
118 | } | 118 | } |
119 | 119 | ||
120 | public string GetName() | 120 | public string GetName() |
121 | { | 121 | { |
122 | return "LSLScriptingModule"; | 122 | return "LSLScriptingModule"; |
123 | } | 123 | } |
124 | 124 | ||
125 | public bool IsSharedModule() | 125 | public bool IsSharedModule() |
126 | { | 126 | { |
127 | return false; | 127 | return false; |
128 | } | 128 | } |
129 | 129 | ||
130 | #endregion | 130 | #endregion |
131 | } | 131 | } |
132 | } | 132 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 055acc4..ec50b93 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -1,408 +1,408 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Runtime.Remoting; | 34 | using System.Runtime.Remoting; |
35 | using System.Runtime.Serialization; | 35 | using System.Runtime.Serialization; |
36 | using System.Runtime.Serialization.Formatters.Binary; | 36 | using System.Runtime.Serialization.Formatters.Binary; |
37 | using OpenSim.Region.Environment.Scenes; | 37 | using OpenSim.Region.Environment.Scenes; |
38 | using OpenSim.Region.Environment.Scenes.Scripting; | 38 | using OpenSim.Region.Environment.Scenes.Scripting; |
39 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | 39 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; |
40 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 40 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
41 | using OpenSim.Region.ScriptEngine.Common; | 41 | using OpenSim.Region.ScriptEngine.Common; |
42 | using libsecondlife; | 42 | using libsecondlife; |
43 | 43 | ||
44 | 44 | ||
45 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 45 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
46 | { | 46 | { |
47 | /// <summary> | 47 | /// <summary> |
48 | /// Loads scripts | 48 | /// Loads scripts |
49 | /// Compiles them if necessary | 49 | /// Compiles them if necessary |
50 | /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution) | 50 | /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution) |
51 | /// </summary> | 51 | /// </summary> |
52 | [Serializable] | 52 | [Serializable] |
53 | public class ScriptManager | 53 | public class ScriptManager |
54 | { | 54 | { |
55 | #region Declares | 55 | #region Declares |
56 | private Thread scriptLoadUnloadThread; | 56 | private Thread scriptLoadUnloadThread; |
57 | private int scriptLoadUnloadThread_IdleSleepms = 100; | 57 | private int scriptLoadUnloadThread_IdleSleepms = 100; |
58 | private Queue<LoadStruct> loadQueue = new Queue<LoadStruct>(); | 58 | private Queue<LoadStruct> loadQueue = new Queue<LoadStruct>(); |
59 | private Queue<UnloadStruct> unloadQueue = new Queue<UnloadStruct>(); | 59 | private Queue<UnloadStruct> unloadQueue = new Queue<UnloadStruct>(); |
60 | private struct LoadStruct | 60 | private struct LoadStruct |
61 | { | 61 | { |
62 | public uint localID; | 62 | public uint localID; |
63 | public LLUUID itemID; | 63 | public LLUUID itemID; |
64 | public string script; | 64 | public string script; |
65 | } | 65 | } |
66 | private struct UnloadStruct | 66 | private struct UnloadStruct |
67 | { | 67 | { |
68 | public uint localID; | 68 | public uint localID; |
69 | public LLUUID itemID; | 69 | public LLUUID itemID; |
70 | } | 70 | } |
71 | 71 | ||
72 | // Object<string, Script<string, script>> | 72 | // Object<string, Script<string, script>> |
73 | // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. | 73 | // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. |
74 | // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! | 74 | // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! |
75 | internal Dictionary<uint, Dictionary<LLUUID, LSL_BaseClass>> Scripts = new Dictionary<uint, Dictionary<LLUUID, LSL_BaseClass>>(); | 75 | internal Dictionary<uint, Dictionary<LLUUID, LSL_BaseClass>> Scripts = new Dictionary<uint, Dictionary<LLUUID, LSL_BaseClass>>(); |
76 | public Scene World | 76 | public Scene World |
77 | { | 77 | { |
78 | get | 78 | get |
79 | { | 79 | { |
80 | return m_scriptEngine.World; | 80 | return m_scriptEngine.World; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | #endregion | 83 | #endregion |
84 | #region Object init/shutdown | 84 | #region Object init/shutdown |
85 | private ScriptEngine m_scriptEngine; | 85 | private ScriptEngine m_scriptEngine; |
86 | public ScriptManager(ScriptEngine scriptEngine) | 86 | public ScriptManager(ScriptEngine scriptEngine) |
87 | { | 87 | { |
88 | m_scriptEngine = scriptEngine; | 88 | m_scriptEngine = scriptEngine; |
89 | AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); | 89 | AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); |
90 | scriptLoadUnloadThread = new Thread(ScriptLoadUnloadThreadLoop); | 90 | scriptLoadUnloadThread = new Thread(ScriptLoadUnloadThreadLoop); |
91 | scriptLoadUnloadThread.Name = "ScriptLoadUnloadThread"; | 91 | scriptLoadUnloadThread.Name = "ScriptLoadUnloadThread"; |
92 | scriptLoadUnloadThread.IsBackground = true; | 92 | scriptLoadUnloadThread.IsBackground = true; |
93 | scriptLoadUnloadThread.Priority = ThreadPriority.BelowNormal; | 93 | scriptLoadUnloadThread.Priority = ThreadPriority.BelowNormal; |
94 | scriptLoadUnloadThread.Start(); | 94 | scriptLoadUnloadThread.Start(); |
95 | 95 | ||
96 | } | 96 | } |
97 | ~ScriptManager () | 97 | ~ScriptManager () |
98 | { | 98 | { |
99 | // Abort load/unload thread | 99 | // Abort load/unload thread |
100 | try | 100 | try |
101 | { | 101 | { |
102 | if (scriptLoadUnloadThread != null) | 102 | if (scriptLoadUnloadThread != null) |
103 | { | 103 | { |
104 | if (scriptLoadUnloadThread.IsAlive == true) | 104 | if (scriptLoadUnloadThread.IsAlive == true) |
105 | { | 105 | { |
106 | scriptLoadUnloadThread.Abort(); | 106 | scriptLoadUnloadThread.Abort(); |
107 | scriptLoadUnloadThread.Join(); | 107 | scriptLoadUnloadThread.Join(); |
108 | } | 108 | } |
109 | } | 109 | } |
110 | } | 110 | } |
111 | catch | 111 | catch |
112 | { | 112 | { |
113 | } | 113 | } |
114 | } | 114 | } |
115 | #endregion | 115 | #endregion |
116 | #region Load / Unload scripts (Thread loop) | 116 | #region Load / Unload scripts (Thread loop) |
117 | private void ScriptLoadUnloadThreadLoop() | 117 | private void ScriptLoadUnloadThreadLoop() |
118 | { | 118 | { |
119 | try | 119 | try |
120 | { | 120 | { |
121 | while (true) | 121 | while (true) |
122 | { | 122 | { |
123 | if (loadQueue.Count == 0 && unloadQueue.Count == 0) | 123 | if (loadQueue.Count == 0 && unloadQueue.Count == 0) |
124 | Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); | 124 | Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); |
125 | 125 | ||
126 | if (loadQueue.Count > 0) | 126 | if (loadQueue.Count > 0) |
127 | { | 127 | { |
128 | LoadStruct item = loadQueue.Dequeue(); | 128 | LoadStruct item = loadQueue.Dequeue(); |
129 | _StartScript(item.localID, item.itemID, item.script); | 129 | _StartScript(item.localID, item.itemID, item.script); |
130 | } | 130 | } |
131 | 131 | ||
132 | if (unloadQueue.Count > 0) | 132 | if (unloadQueue.Count > 0) |
133 | { | 133 | { |
134 | UnloadStruct item = unloadQueue.Dequeue(); | 134 | UnloadStruct item = unloadQueue.Dequeue(); |
135 | _StopScript(item.localID, item.itemID); | 135 | _StopScript(item.localID, item.itemID); |
136 | } | 136 | } |
137 | 137 | ||
138 | 138 | ||
139 | 139 | ||
140 | } | 140 | } |
141 | } | 141 | } |
142 | catch (ThreadAbortException tae) | 142 | catch (ThreadAbortException tae) |
143 | { | 143 | { |
144 | string a = tae.ToString(); | 144 | string a = tae.ToString(); |
145 | a = ""; | 145 | a = ""; |
146 | // Expected | 146 | // Expected |
147 | } | 147 | } |
148 | 148 | ||
149 | } | 149 | } |
150 | #endregion | 150 | #endregion |
151 | #region Helper functions | 151 | #region Helper functions |
152 | private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) | 152 | private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) |
153 | { | 153 | { |
154 | 154 | ||
155 | //Console.WriteLine("ScriptManager.CurrentDomain_AssemblyResolve: " + args.Name); | 155 | //Console.WriteLine("ScriptManager.CurrentDomain_AssemblyResolve: " + args.Name); |
156 | return Assembly.GetExecutingAssembly().FullName == args.Name ? Assembly.GetExecutingAssembly() : null; | 156 | return Assembly.GetExecutingAssembly().FullName == args.Name ? Assembly.GetExecutingAssembly() : null; |
157 | 157 | ||
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | ||
161 | #endregion | 161 | #endregion |
162 | #region Internal functions to keep track of script | 162 | #region Internal functions to keep track of script |
163 | internal Dictionary<LLUUID, LSL_BaseClass>.KeyCollection GetScriptKeys(uint localID) | 163 | internal Dictionary<LLUUID, LSL_BaseClass>.KeyCollection GetScriptKeys(uint localID) |
164 | { | 164 | { |
165 | if (Scripts.ContainsKey(localID) == false) | 165 | if (Scripts.ContainsKey(localID) == false) |
166 | return null; | 166 | return null; |
167 | 167 | ||
168 | Dictionary<LLUUID, LSL_BaseClass> Obj; | 168 | Dictionary<LLUUID, LSL_BaseClass> Obj; |
169 | Scripts.TryGetValue(localID, out Obj); | 169 | Scripts.TryGetValue(localID, out Obj); |
170 | 170 | ||
171 | return Obj.Keys; | 171 | return Obj.Keys; |
172 | 172 | ||
173 | } | 173 | } |
174 | 174 | ||
175 | internal LSL_BaseClass GetScript(uint localID, LLUUID itemID) | 175 | internal LSL_BaseClass GetScript(uint localID, LLUUID itemID) |
176 | { | 176 | { |
177 | if (Scripts.ContainsKey(localID) == false) | 177 | if (Scripts.ContainsKey(localID) == false) |
178 | return null; | 178 | return null; |
179 | 179 | ||
180 | Dictionary<LLUUID, LSL_BaseClass> Obj; | 180 | Dictionary<LLUUID, LSL_BaseClass> Obj; |
181 | Scripts.TryGetValue(localID, out Obj); | 181 | Scripts.TryGetValue(localID, out Obj); |
182 | if (Obj.ContainsKey(itemID) == false) | 182 | if (Obj.ContainsKey(itemID) == false) |
183 | return null; | 183 | return null; |
184 | 184 | ||
185 | // Get script | 185 | // Get script |
186 | LSL_BaseClass Script; | 186 | LSL_BaseClass Script; |
187 | Obj.TryGetValue(itemID, out Script); | 187 | Obj.TryGetValue(itemID, out Script); |
188 | 188 | ||
189 | return Script; | 189 | return Script; |
190 | 190 | ||
191 | } | 191 | } |
192 | internal void SetScript(uint localID, LLUUID itemID, LSL_BaseClass Script) | 192 | internal void SetScript(uint localID, LLUUID itemID, LSL_BaseClass Script) |
193 | { | 193 | { |
194 | // Create object if it doesn't exist | 194 | // Create object if it doesn't exist |
195 | if (Scripts.ContainsKey(localID) == false) | 195 | if (Scripts.ContainsKey(localID) == false) |
196 | { | 196 | { |
197 | Scripts.Add(localID, new Dictionary<LLUUID, LSL_BaseClass>()); | 197 | Scripts.Add(localID, new Dictionary<LLUUID, LSL_BaseClass>()); |
198 | } | 198 | } |
199 | 199 | ||
200 | // Delete script if it exists | 200 | // Delete script if it exists |
201 | Dictionary<LLUUID, LSL_BaseClass> Obj; | 201 | Dictionary<LLUUID, LSL_BaseClass> Obj; |
202 | Scripts.TryGetValue(localID, out Obj); | 202 | Scripts.TryGetValue(localID, out Obj); |
203 | if (Obj.ContainsKey(itemID) == true) | 203 | if (Obj.ContainsKey(itemID) == true) |
204 | Obj.Remove(itemID); | 204 | Obj.Remove(itemID); |
205 | 205 | ||
206 | // Add to object | 206 | // Add to object |
207 | Obj.Add(itemID, Script); | 207 | Obj.Add(itemID, Script); |
208 | 208 | ||
209 | } | 209 | } |
210 | internal void RemoveScript(uint localID, LLUUID itemID) | 210 | internal void RemoveScript(uint localID, LLUUID itemID) |
211 | { | 211 | { |
212 | // Don't have that object? | 212 | // Don't have that object? |
213 | if (Scripts.ContainsKey(localID) == false) | 213 | if (Scripts.ContainsKey(localID) == false) |
214 | return; | 214 | return; |
215 | 215 | ||
216 | // Delete script if it exists | 216 | // Delete script if it exists |
217 | Dictionary<LLUUID, LSL_BaseClass> Obj; | 217 | Dictionary<LLUUID, LSL_BaseClass> Obj; |
218 | Scripts.TryGetValue(localID, out Obj); | 218 | Scripts.TryGetValue(localID, out Obj); |
219 | if (Obj.ContainsKey(itemID) == true) | 219 | if (Obj.ContainsKey(itemID) == true) |
220 | Obj.Remove(itemID); | 220 | Obj.Remove(itemID); |
221 | 221 | ||
222 | } | 222 | } |
223 | #endregion | 223 | #endregion |
224 | #region Start/Stop script | 224 | #region Start/Stop script |
225 | /// <summary> | 225 | /// <summary> |
226 | /// Fetches, loads and hooks up a script to an objects events | 226 | /// Fetches, loads and hooks up a script to an objects events |
227 | /// </summary> | 227 | /// </summary> |
228 | /// <param name="itemID"></param> | 228 | /// <param name="itemID"></param> |
229 | /// <param name="localID"></param> | 229 | /// <param name="localID"></param> |
230 | public void StartScript(uint localID, LLUUID itemID, string Script) | 230 | public void StartScript(uint localID, LLUUID itemID, string Script) |
231 | { | 231 | { |
232 | LoadStruct ls = new LoadStruct(); | 232 | LoadStruct ls = new LoadStruct(); |
233 | ls.localID = localID; | 233 | ls.localID = localID; |
234 | ls.itemID = itemID; | 234 | ls.itemID = itemID; |
235 | ls.script = Script; | 235 | ls.script = Script; |
236 | loadQueue.Enqueue(ls); | 236 | loadQueue.Enqueue(ls); |
237 | } | 237 | } |
238 | /// <summary> | 238 | /// <summary> |
239 | /// Disables and unloads a script | 239 | /// Disables and unloads a script |
240 | /// </summary> | 240 | /// </summary> |
241 | /// <param name="localID"></param> | 241 | /// <param name="localID"></param> |
242 | /// <param name="itemID"></param> | 242 | /// <param name="itemID"></param> |
243 | public void StopScript(uint localID, LLUUID itemID) | 243 | public void StopScript(uint localID, LLUUID itemID) |
244 | { | 244 | { |
245 | UnloadStruct ls = new UnloadStruct(); | 245 | UnloadStruct ls = new UnloadStruct(); |
246 | ls.localID = localID; | 246 | ls.localID = localID; |
247 | ls.itemID = itemID; | 247 | ls.itemID = itemID; |
248 | unloadQueue.Enqueue(ls); | 248 | unloadQueue.Enqueue(ls); |
249 | } | 249 | } |
250 | 250 | ||
251 | private void _StartScript(uint localID, LLUUID itemID, string Script) | 251 | private void _StartScript(uint localID, LLUUID itemID, string Script) |
252 | { | 252 | { |
253 | //IScriptHost root = host.GetRoot(); | 253 | //IScriptHost root = host.GetRoot(); |
254 | Console.WriteLine("ScriptManager StartScript: localID: " + localID + ", itemID: " + itemID); | 254 | Console.WriteLine("ScriptManager StartScript: localID: " + localID + ", itemID: " + itemID); |
255 | 255 | ||
256 | // We will initialize and start the script. | 256 | // We will initialize and start the script. |
257 | // It will be up to the script itself to hook up the correct events. | 257 | // It will be up to the script itself to hook up the correct events. |
258 | string FileName = ""; | 258 | string FileName = ""; |
259 | 259 | ||
260 | IScriptHost m_host = World.GetSceneObjectPart(localID); | 260 | IScriptHost m_host = World.GetSceneObjectPart(localID); |
261 | 261 | ||
262 | try | 262 | try |
263 | { | 263 | { |
264 | 264 | ||
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | // Create a new instance of the compiler (currently we don't want reuse) | 268 | // Create a new instance of the compiler (currently we don't want reuse) |
269 | OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler(); | 269 | OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler(); |
270 | // Compile (We assume LSL) | 270 | // Compile (We assume LSL) |
271 | FileName = LSLCompiler.CompileFromLSLText(Script); | 271 | FileName = LSLCompiler.CompileFromLSLText(Script); |
272 | //Console.WriteLine("Compilation of " + FileName + " done"); | 272 | //Console.WriteLine("Compilation of " + FileName + " done"); |
273 | // * Insert yield into code | 273 | // * Insert yield into code |
274 | FileName = ProcessYield(FileName); | 274 | FileName = ProcessYield(FileName); |
275 | 275 | ||
276 | 276 | ||
277 | #if DEBUG | 277 | #if DEBUG |
278 | long before; | 278 | long before; |
279 | before = GC.GetTotalMemory(true); | 279 | before = GC.GetTotalMemory(true); |
280 | #endif | 280 | #endif |
281 | LSL_BaseClass CompiledScript; | 281 | LSL_BaseClass CompiledScript; |
282 | CompiledScript = m_scriptEngine.m_AppDomainManager.LoadScript(FileName); | 282 | CompiledScript = m_scriptEngine.m_AppDomainManager.LoadScript(FileName); |
283 | #if DEBUG | 283 | #if DEBUG |
284 | Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before); | 284 | Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before); |
285 | #endif | 285 | #endif |
286 | 286 | ||
287 | // Add it to our script memstruct | 287 | // Add it to our script memstruct |
288 | SetScript(localID, itemID, CompiledScript); | 288 | SetScript(localID, itemID, CompiledScript); |
289 | 289 | ||
290 | // We need to give (untrusted) assembly a private instance of BuiltIns | 290 | // We need to give (untrusted) assembly a private instance of BuiltIns |
291 | // this private copy will contain Read-Only FullitemID so that it can bring that on to the server whenever needed. | 291 | // this private copy will contain Read-Only FullitemID so that it can bring that on to the server whenever needed. |
292 | 292 | ||
293 | 293 | ||
294 | LSL_BuiltIn_Commands LSLB = new LSL_BuiltIn_Commands(m_scriptEngine, m_host, localID, itemID); | 294 | LSL_BuiltIn_Commands LSLB = new LSL_BuiltIn_Commands(m_scriptEngine, m_host, localID, itemID); |
295 | 295 | ||
296 | // Start the script - giving it BuiltIns | 296 | // Start the script - giving it BuiltIns |
297 | CompiledScript.Start(LSLB); | 297 | CompiledScript.Start(LSLB); |
298 | 298 | ||
299 | // Fire the first start-event | 299 | // Fire the first start-event |
300 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", new object[] { }); | 300 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", new object[] { }); |
301 | 301 | ||
302 | 302 | ||
303 | } | 303 | } |
304 | catch (Exception e) | 304 | catch (Exception e) |
305 | { | 305 | { |
306 | //m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString()); | 306 | //m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString()); |
307 | try | 307 | try |
308 | { | 308 | { |
309 | // DISPLAY ERROR INWORLD | 309 | // DISPLAY ERROR INWORLD |
310 | string text = "Error compiling script:\r\n" + e.Message.ToString(); | 310 | string text = "Error compiling script:\r\n" + e.Message.ToString(); |
311 | if (text.Length > 1500) | 311 | if (text.Length > 1500) |
312 | text = text.Substring(0, 1500); | 312 | text = text.Substring(0, 1500); |
313 | World.SimChat(Helpers.StringToField(text), 1, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 313 | World.SimChat(Helpers.StringToField(text), 1, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
314 | } | 314 | } |
315 | catch (Exception e2) | 315 | catch (Exception e2) |
316 | { | 316 | { |
317 | m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString()); | 317 | m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString()); |
318 | } | 318 | } |
319 | } | 319 | } |
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | } | 323 | } |
324 | 324 | ||
325 | private void _StopScript(uint localID, LLUUID itemID) | 325 | private void _StopScript(uint localID, LLUUID itemID) |
326 | { | 326 | { |
327 | // Stop script | 327 | // Stop script |
328 | Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString()); | 328 | Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString()); |
329 | 329 | ||
330 | 330 | ||
331 | // Stop long command on script | 331 | // Stop long command on script |
332 | m_scriptEngine.m_LSLLongCmdHandler.RemoveScript(localID, itemID); | 332 | m_scriptEngine.m_LSLLongCmdHandler.RemoveScript(localID, itemID); |
333 | 333 | ||
334 | LSL_BaseClass LSLBC = GetScript(localID, itemID); | 334 | LSL_BaseClass LSLBC = GetScript(localID, itemID); |
335 | if (LSLBC == null) | 335 | if (LSLBC == null) |
336 | return; | 336 | return; |
337 | 337 | ||
338 | // TEMP: First serialize it | 338 | // TEMP: First serialize it |
339 | //GetSerializedScript(localID, itemID); | 339 | //GetSerializedScript(localID, itemID); |
340 | 340 | ||
341 | 341 | ||
342 | try | 342 | try |
343 | { | 343 | { |
344 | // Get AppDomain | 344 | // Get AppDomain |
345 | AppDomain ad = LSLBC.Exec.GetAppDomain(); | 345 | AppDomain ad = LSLBC.Exec.GetAppDomain(); |
346 | // Tell script not to accept new requests | 346 | // Tell script not to accept new requests |
347 | GetScript(localID, itemID).Exec.StopScript(); | 347 | GetScript(localID, itemID).Exec.StopScript(); |
348 | // Remove from internal structure | 348 | // Remove from internal structure |
349 | RemoveScript(localID, itemID); | 349 | RemoveScript(localID, itemID); |
350 | // Tell AppDomain that we have stopped script | 350 | // Tell AppDomain that we have stopped script |
351 | m_scriptEngine.m_AppDomainManager.StopScript(ad); | 351 | m_scriptEngine.m_AppDomainManager.StopScript(ad); |
352 | } | 352 | } |
353 | catch(Exception e) | 353 | catch(Exception e) |
354 | { | 354 | { |
355 | Console.WriteLine("Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() + ": " + e.ToString()); | 355 | Console.WriteLine("Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() + ": " + e.ToString()); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | private string ProcessYield(string FileName) | 358 | private string ProcessYield(string FileName) |
359 | { | 359 | { |
360 | // TODO: Create a new assembly and copy old but insert Yield Code | 360 | // TODO: Create a new assembly and copy old but insert Yield Code |
361 | //return TempDotNetMicroThreadingCodeInjector.TestFix(FileName); | 361 | //return TempDotNetMicroThreadingCodeInjector.TestFix(FileName); |
362 | return FileName; | 362 | return FileName; |
363 | } | 363 | } |
364 | #endregion | 364 | #endregion |
365 | #region Perform event execution in script | 365 | #region Perform event execution in script |
366 | /// <summary> | 366 | /// <summary> |
367 | /// Execute a LL-event-function in Script | 367 | /// Execute a LL-event-function in Script |
368 | /// </summary> | 368 | /// </summary> |
369 | /// <param name="localID">Object the script is located in</param> | 369 | /// <param name="localID">Object the script is located in</param> |
370 | /// <param name="itemID">Script ID</param> | 370 | /// <param name="itemID">Script ID</param> |
371 | /// <param name="FunctionName">Name of function</param> | 371 | /// <param name="FunctionName">Name of function</param> |
372 | /// <param name="args">Arguments to pass to function</param> | 372 | /// <param name="args">Arguments to pass to function</param> |
373 | internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args) | 373 | internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args) |
374 | { | 374 | { |
375 | 375 | ||
376 | // Execute a function in the script | 376 | // Execute a function in the script |
377 | //m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); | 377 | //m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); |
378 | LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID); | 378 | LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID); |
379 | if (Script == null) | 379 | if (Script == null) |
380 | return; | 380 | return; |
381 | 381 | ||
382 | // Must be done in correct AppDomain, so leaving it up to the script itself | 382 | // Must be done in correct AppDomain, so leaving it up to the script itself |
383 | Script.Exec.ExecuteEvent(FunctionName, args); | 383 | Script.Exec.ExecuteEvent(FunctionName, args); |
384 | 384 | ||
385 | } | 385 | } |
386 | #endregion | 386 | #endregion |
387 | 387 | ||
388 | #region Script serialization/deserialization | 388 | #region Script serialization/deserialization |
389 | public void GetSerializedScript(uint localID, LLUUID itemID) | 389 | public void GetSerializedScript(uint localID, LLUUID itemID) |
390 | { | 390 | { |
391 | // Serialize the script and return it | 391 | // Serialize the script and return it |
392 | // Should not be a problem | 392 | // Should not be a problem |
393 | System.IO.FileStream fs = System.IO.File.Create("SERIALIZED_SCRIPT_" + itemID); | 393 | System.IO.FileStream fs = System.IO.File.Create("SERIALIZED_SCRIPT_" + itemID); |
394 | BinaryFormatter b = new BinaryFormatter(); | 394 | BinaryFormatter b = new BinaryFormatter(); |
395 | b.Serialize(fs, GetScript(localID,itemID)); | 395 | b.Serialize(fs, GetScript(localID,itemID)); |
396 | fs.Close(); | 396 | fs.Close(); |
397 | 397 | ||
398 | 398 | ||
399 | } | 399 | } |
400 | public void PutSerializedScript(uint localID, LLUUID itemID) | 400 | public void PutSerializedScript(uint localID, LLUUID itemID) |
401 | { | 401 | { |
402 | // Deserialize the script and inject it into an AppDomain | 402 | // Deserialize the script and inject it into an AppDomain |
403 | 403 | ||
404 | // How to inject into an AppDomain? | 404 | // How to inject into an AppDomain? |
405 | } | 405 | } |
406 | #endregion | 406 | #endregion |
407 | } | 407 | } |
408 | } | 408 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs index 64cb7cd..46d438a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs | |||
@@ -1,45 +1,45 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using Rail.Transformation; | 4 | using Rail.Transformation; |
5 | using Rail.Reflect; | 5 | using Rail.Reflect; |
6 | using Rail.Exceptions; | 6 | using Rail.Exceptions; |
7 | using Rail.MSIL; | 7 | using Rail.MSIL; |
8 | 8 | ||
9 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 9 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
10 | { | 10 | { |
11 | /// <summary> | 11 | /// <summary> |
12 | /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes! | 12 | /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes! |
13 | /// Its offspring will be the actual implementation. | 13 | /// Its offspring will be the actual implementation. |
14 | /// </summary> | 14 | /// </summary> |
15 | class TempDotNetMicroThreadingCodeInjector | 15 | class TempDotNetMicroThreadingCodeInjector |
16 | { | 16 | { |
17 | public static string TestFix(string FileName) | 17 | public static string TestFix(string FileName) |
18 | { | 18 | { |
19 | string ret = System.IO.Path.GetFileNameWithoutExtension(FileName + "_fixed.dll"); | 19 | string ret = System.IO.Path.GetFileNameWithoutExtension(FileName + "_fixed.dll"); |
20 | 20 | ||
21 | Console.WriteLine("Loading: \"" + FileName + "\""); | 21 | Console.WriteLine("Loading: \"" + FileName + "\""); |
22 | RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName); | 22 | RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName); |
23 | 23 | ||
24 | 24 | ||
25 | //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe | 25 | //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe |
26 | RTypeDef type = (RTypeDef)rAssembly.RModuleDef.GetType("SecondLife.Script"); | 26 | RTypeDef type = (RTypeDef)rAssembly.RModuleDef.GetType("SecondLife.Script"); |
27 | 27 | ||
28 | //Get the methods in the type | 28 | //Get the methods in the type |
29 | RMethod[] m = type.GetMethods(); | 29 | RMethod[] m = type.GetMethods(); |
30 | 30 | ||
31 | //Create a MethodPrologueAdder visitor object with the method to add | 31 | //Create a MethodPrologueAdder visitor object with the method to add |
32 | //and with the flag that enables local variable creation set to true | 32 | //and with the flag that enables local variable creation set to true |
33 | MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef)m[0], true); | 33 | MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef)m[0], true); |
34 | 34 | ||
35 | //Apply the changes to the assembly | 35 | //Apply the changes to the assembly |
36 | rAssembly.Accept(mpa); | 36 | rAssembly.Accept(mpa); |
37 | 37 | ||
38 | //Save the new assembly | 38 | //Save the new assembly |
39 | rAssembly.SaveAssembly(ret); | 39 | rAssembly.SaveAssembly(ret); |
40 | 40 | ||
41 | return ret; | 41 | return ret; |
42 | 42 | ||
43 | } | 43 | } |
44 | } | 44 | } |
45 | } | 45 | } |