aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Common.cs84
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Engine.cs228
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs56
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs366
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs377
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_CLRInterface.cs79
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs351
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Enums.cs548
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Parser.cs629
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Struct.cs133
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScript.cs33
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScriptEngine.cs27
14 files changed, 2 insertions, 2911 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index b7bc229..5893988 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -119,6 +119,7 @@ namespace OpenSim.Region.Environment.Scenes
119 SceneObjectPart newPart = new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset); 119 SceneObjectPart newPart = new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset);
120 this.m_parts.Add(newPart.UUID, newPart); 120 this.m_parts.Add(newPart.UUID, newPart);
121 this.SetPartAsRoot(newPart); 121 this.SetPartAsRoot(newPart);
122
122 } 123 }
123 124
124 125
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index d0730d7..c711150 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -376,6 +376,7 @@ namespace OpenSim.Region.Environment.Scenes
376 Array.Copy(data, 0, this.m_shape.ExtraParams, i, data.Length); 376 Array.Copy(data, 0, this.m_shape.ExtraParams, i, data.Length);
377 377
378 this.ScheduleFullUpdate(); 378 this.ScheduleFullUpdate();
379
379 } 380 }
380 #endregion 381 #endregion
381 382
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Common.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Common.cs
deleted file mode 100644
index 554ba1a..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Common.cs
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30using System.Collections.Generic;
31using System.Text;
32
33namespace OpenSim.Region.Scripting.LSL
34{
35 public static class Common
36 {
37 static public bool Debug = true;
38 static public bool IL_UseTryCatch = true;
39 static public bool IL_CreateConstructor = true;
40 static public bool IL_CreateFunctionList = true;
41 static public bool IL_ProcessCodeChunks = true;
42
43 public delegate void SendToDebugEventDelegate(string Message);
44 public delegate void SendToLogEventDelegate(string Message);
45 static public event SendToDebugEventDelegate SendToDebugEvent;
46 static public event SendToLogEventDelegate SendToLogEvent;
47
48 static public void SendToDebug(string Message)
49 {
50 //if (Debug == true)
51 Console.WriteLine("Debug: " + Message);
52 SendToDebugEvent(DateTime.Now.ToString("[HH:mm:ss] ") + Message + "\r\n");
53 }
54 static public void SendToLog(string Message)
55 {
56 //if (Debug == true)
57 Console.WriteLine("LOG: " + Message);
58 SendToLogEvent(DateTime.Now.ToString("[HH:mm:ss] ") + Message + "\r\n");
59 }
60 }
61
62 // TEMPORARY TEST THINGIES
63 public static class IL_Helper
64 {
65 public static string ReverseFormatString(string text1, string format)
66 {
67 Common.SendToDebug("ReverseFormatString text1: " + text1);
68 Common.SendToDebug("ReverseFormatString format: " + format);
69 return string.Format(format, text1);
70 }
71 public static string ReverseFormatString(string text1, UInt32 text2, string format)
72 {
73 Common.SendToDebug("ReverseFormatString text1: " + text1);
74 Common.SendToDebug("ReverseFormatString text2: " + text2.ToString());
75 Common.SendToDebug("ReverseFormatString format: " + format);
76 return string.Format(format, text1, text2.ToString());
77 }
78 public static string Cast_ToString(object obj)
79 {
80 Common.SendToDebug("OBJECT TO BE CASTED: " + obj.GetType().ToString());
81 return "ABCDEFGIHJKLMNOPQ123";
82 }
83 }
84}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Engine.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Engine.cs
deleted file mode 100644
index 5cd1f71..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/Engine.cs
+++ /dev/null
@@ -1,228 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30 using System.Reflection;
31 using System.Reflection.Emit;
32 using System.Threading;
33
34 namespace OpenSim.Region.Scripting.LSL
35 {
36
37
38 public class Engine
39 {
40 //private string LSO_FileName = @"LSO\AdditionTest.lso";
41 private string LSO_FileName;// = @"LSO\CloseToDefault.lso";
42 AppDomain appDomain;
43
44 public void Start(string FileName)
45 {
46 LSO_FileName = FileName;
47
48
49 //appDomain = AppDomain.CreateDomain("AlternateAppDomain");
50 appDomain = Thread.GetDomain();
51
52 // Create Assembly Name
53 AssemblyName asmName = new AssemblyName();
54 asmName.Name = System.IO.Path.GetFileNameWithoutExtension(LSO_FileName);
55 //asmName.Name = "TestAssembly";
56
57 string DLL_FileName = asmName.Name + ".dll";
58 string DLL_FileName_WithPath = System.IO.Path.GetDirectoryName(FileName) + @"\" + DLL_FileName;
59
60 Common.SendToLog("LSO File Name: " + System.IO.Path.GetFileName(FileName));
61 Common.SendToLog("Assembly name: " + asmName.Name);
62 Common.SendToLog("Assembly File Name: " + asmName.Name + ".dll");
63 Common.SendToLog("Starting processing of LSL ByteCode...");
64 Common.SendToLog("");
65
66
67
68 // Create Assembly
69 AssemblyBuilder asmBuilder = appDomain.DefineDynamicAssembly(
70 asmName,
71 AssemblyBuilderAccess.RunAndSave
72 );
73 //// Create Assembly
74 //AssemblyBuilder asmBuilder =
75 // Thread.GetDomain().DefineDynamicAssembly
76 //(asmName, AssemblyBuilderAccess.RunAndSave);
77
78 // Create a module (and save to disk)
79 ModuleBuilder modBuilder = asmBuilder.DefineDynamicModule
80 (asmName.Name,
81 DLL_FileName);
82
83 //Common.SendToDebug("asmName.Name is still \"" + asmName.Name + "\"");
84 // Create a Class (/Type)
85 TypeBuilder typeBuilder = modBuilder.DefineType(
86 "LSL_ScriptObject",
87 TypeAttributes.Public | TypeAttributes.BeforeFieldInit);
88 //,
89 // typeof());
90 //, typeof(LSL_BuiltIn_Commands_Interface));
91 //,
92 // typeof(object),
93 // new Type[] { typeof(LSL_CLRInterface.LSLScript) });
94
95
96 if (Common.IL_CreateConstructor)
97 IL_CREATE_CONSTRUCTOR(typeBuilder);
98
99
100 /*
101 * Generate the IL itself
102 */
103
104 LSO_Parser LSOP = new LSO_Parser();
105 LSOP.ParseFile(LSO_FileName, typeBuilder);
106
107 /*
108 * Done generating. Create a type and run it.
109 */
110
111
112
113 Common.SendToLog("Attempting to compile assembly...");
114 // Compile it
115 Type type = typeBuilder.CreateType();
116 Common.SendToLog("Compilation successful!");
117
118 Common.SendToLog("Saving assembly: " + DLL_FileName);
119 asmBuilder.Save(DLL_FileName);
120
121
122 Common.SendToLog("Creating an instance of new assembly...");
123 // Create an instance we can play with
124 //LSLScript hello = (LSLScript)Activator.CreateInstance(type);
125 //LSL_CLRInterface.LSLScript MyScript = (LSL_CLRInterface.LSLScript)Activator.CreateInstance(type);
126 object MyScript = (object)Activator.CreateInstance(type);
127
128
129 Common.SendToLog("");
130
131 System.Reflection.MemberInfo[] Members = type.GetMembers();
132
133 Common.SendToLog("Members of assembly " + type.ToString () + ":");
134 foreach (MemberInfo member in Members )
135 Common.SendToLog(member.ToString());
136
137
138 // Play with it
139 //MyScript.event_state_entry("Test");
140 object[] args = { null } ;
141 //System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, MyScript, null);
142
143 string[] ret = { };
144 if (Common.IL_CreateFunctionList)
145 ret = (string[])type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, MyScript, null);
146
147 foreach (string s in ret)
148 {
149 Common.SendToLog("");
150 Common.SendToLog("*** Executing LSL Server Event: " + s);
151 //object test = type.GetMember(s);
152 //object runner = type.InvokeMember(s, BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Instance, null, MyScript, args);
153 //runner();
154 //objBooks_Late = type.InvokeMember(s, BindingFlags.CreateInstance, null, objApp_Late, null);
155 type.InvokeMember(s, BindingFlags.InvokeMethod, null, MyScript, new object[] { "Test" });
156
157 }
158
159 }
160
161
162 private static void IL_CREATE_CONSTRUCTOR(TypeBuilder typeBuilder)
163 {
164
165
166 Common.SendToDebug("IL_CREATE_CONSTRUCTOR()");
167 //ConstructorBuilder constructor = typeBuilder.DefineConstructor(
168 // MethodAttributes.Public,
169 // CallingConventions.Standard,
170 // new Type[0]);
171 ConstructorBuilder constructor = typeBuilder.DefineConstructor(
172 MethodAttributes.Public |
173 MethodAttributes.SpecialName |
174 MethodAttributes.RTSpecialName,
175 CallingConventions.Standard,
176 new Type[0]);
177
178 //Define the reflection ConstructorInfor for System.Object
179 ConstructorInfo conObj = typeof(object).GetConstructor(new Type[0]);
180
181 //call constructor of base object
182 ILGenerator il = constructor.GetILGenerator();
183
184 Common.SendToDebug("IL_CREATE_CONSTRUCTOR: Creating global: UInt32 State = 0;");
185 string FieldName;
186 // Create state object
187 FieldName = "State";
188 FieldBuilder State_fb = typeBuilder.DefineField(
189 FieldName,
190 typeof(UInt32),
191 FieldAttributes.Public);
192 il.Emit(OpCodes.Ldarg_0);
193 il.Emit(OpCodes.Ldc_I4, 0);
194 il.Emit(OpCodes.Stfld, State_fb);
195
196
197 Common.SendToDebug("IL_CREATE_CONSTRUCTOR: Creating global: LSL_BuiltIn_Commands_TestImplementation LSL_BuiltIns = New LSL_BuiltIn_Commands_TestImplementation();");
198 //Type objType1 = typeof(object);
199 Type objType1 = typeof(LSL_BuiltIn_Commands_TestImplementation);
200
201 FieldName = "LSL_BuiltIns";
202 FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField(
203 FieldName,
204 objType1,
205 FieldAttributes.Public);
206
207 //LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation();
208 il.Emit(OpCodes.Ldarg_0);
209 //il.Emit(OpCodes.Ldstr, "Test 123");
210 il.Emit(OpCodes.Newobj, objType1.GetConstructor(new Type[] { }));
211 il.Emit(OpCodes.Stfld, LSL_BuiltIns_fb);
212
213 il.Emit(OpCodes.Ldarg_0);
214 il.Emit(OpCodes.Call, conObj);
215
216
217
218 ////il.Emit(OpCodes.Newobj, typeof(UInt32));
219 //il.Emit(OpCodes.Starg_0);
220 //// Create LSL function library
221 //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField("LSL_BuiltIns", typeof(LSL_BuiltIn_Commands_Interface), FieldAttributes.Public);
222 //il.Emit(OpCodes.Newobj, typeof(LSL_BuiltIn_Commands_Interface));
223 //il.Emit(OpCodes.Stloc_1);
224
225 il.Emit(OpCodes.Ret);
226 }
227 }
228 }
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs
deleted file mode 100644
index 2f23a91..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/IL_common_functions.cs
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30using System.Collections.Generic;
31using System.Text;
32using System.Reflection;
33using System.Reflection.Emit;
34
35namespace OpenSim.Region.Scripting.LSL
36{
37 partial class LSO_Parser
38 {
39 private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName)
40 {
41 TypeBuilder typeBuilder = modBuilder.DefineType(typeName,
42 TypeAttributes.Public |
43 TypeAttributes.Class |
44 TypeAttributes.AutoClass |
45 TypeAttributes.AnsiClass |
46 TypeAttributes.BeforeFieldInit |
47 TypeAttributes.AutoLayout,
48 typeof(object),
49 new Type[] { typeof(object) });
50 return typeBuilder;
51
52 }
53
54
55 }
56}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs
deleted file mode 100644
index d8a0ce3..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_Interface.cs
+++ /dev/null
@@ -1,366 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30 using System.Collections.Generic;
31 using System.Text;
32
33 namespace OpenSim.Region.Scripting.LSL
34 {
35 public interface LSL_BuiltIn_Commands_Interface
36 {
37 void llSin();
38 void llCos();
39 void llTan();
40 void llAtan2();
41 void llSqrt();
42 void llPow();
43 void llAbs();
44 void llFabs();
45 void llFrand();
46 void llFloor();
47 void llCeil();
48 void llRound();
49 void llVecMag();
50 void llVecNorm();
51 void llVecDist();
52 void llRot2Euler();
53 void llEuler2Rot();
54 void llAxes2Rot();
55 void llRot2Fwd();
56 void llRot2Left();
57 void llRot2Up();
58 void llRotBetween();
59 void llWhisper();
60 void llSay(UInt32 channelID, string text);
61 void llShout();
62 void llListen();
63 void llListenControl();
64 void llListenRemove();
65 void llSensor();
66 void llSensorRepeat();
67 void llSensorRemove();
68 void llDetectedName();
69 void llDetectedKey();
70 void llDetectedOwner();
71 void llDetectedType();
72 void llDetectedPos();
73 void llDetectedVel();
74 void llDetectedGrab();
75 void llDetectedRot();
76 void llDetectedGroup();
77 void llDetectedLinkNumber();
78 void llDie();
79 void llGround();
80 void llCloud();
81 void llWind();
82 void llSetStatus();
83 void llGetStatus();
84 void llSetScale();
85 void llGetScale();
86 void llSetColor();
87 void llGetAlpha();
88 void llSetAlpha();
89 void llGetColor();
90 void llSetTexture();
91 void llScaleTexture();
92 void llOffsetTexture();
93 void llRotateTexture();
94 void llGetTexture();
95 void llSetPos();
96 void llGetPos();
97 void llGetLocalPos();
98 void llSetRot();
99 void llGetRot();
100 void llGetLocalRot();
101 void llSetForce();
102 void llGetForce();
103 void llTarget();
104 void llTargetRemove();
105 void llRotTarget();
106 void llRotTargetRemove();
107 void llMoveToTarget();
108 void llStopMoveToTarget();
109 void llApplyImpulse();
110 void llApplyRotationalImpulse();
111 void llSetTorque();
112 void llGetTorque();
113 void llSetForceAndTorque();
114 void llGetVel();
115 void llGetAccel();
116 void llGetOmega();
117 void llGetTimeOfDay();
118 void llGetWallclock();
119 void llGetTime();
120 void llResetTime();
121 void llGetAndResetTime();
122 void llSound();
123 void llPlaySound();
124 void llLoopSound();
125 void llLoopSoundMaster();
126 void llLoopSoundSlave();
127 void llPlaySoundSlave();
128 void llTriggerSound();
129 void llStopSound();
130 void llPreloadSound();
131 void llGetSubString();
132 void llDeleteSubString();
133 void llInsertString();
134 void llToUpper();
135 void llToLower();
136 void llGiveMoney();
137 void llMakeExplosion();
138 void llMakeFountain();
139 void llMakeSmoke();
140 void llMakeFire();
141 void llRezObject();
142 void llLookAt();
143 void llStopLookAt();
144 void llSetTimerEvent();
145 void llSleep();
146 void llGetMass();
147 void llCollisionFilter();
148 void llTakeControls();
149 void llReleaseControls();
150 void llAttachToAvatar();
151 void llDetachFromAvatar();
152 void llTakeCamera();
153 void llReleaseCamera();
154 void llGetOwner();
155 void llInstantMessage();
156 void llEmail();
157 void llGetNextEmail();
158 void llGetKey();
159 void llSetBuoyancy();
160 void llSetHoverHeight();
161 void llStopHover();
162 void llMinEventDelay();
163 void llSoundPreload();
164 void llRotLookAt();
165 void llStringLength();
166 void llStartAnimation();
167 void llStopAnimation();
168 void llPointAt();
169 void llStopPointAt();
170 void llTargetOmega();
171 void llGetStartParameter();
172 void llGodLikeRezObject();
173 void llRequestPermissions();
174 void llGetPermissionsKey();
175 void llGetPermissions();
176 void llGetLinkNumber();
177 void llSetLinkColor();
178 void llCreateLink();
179 void llBreakLink();
180 void llBreakAllLinks();
181 void llGetLinkKey();
182 void llGetLinkName();
183 void llGetInventoryNumber();
184 void llGetInventoryName();
185 void llSetScriptState();
186 void llGetEnergy();
187 void llGiveInventory();
188 void llRemoveInventory();
189 void llSetText();
190 void llWater();
191 void llPassTouches();
192 void llRequestAgentData();
193 void llRequestInventoryData();
194 void llSetDamage();
195 void llTeleportAgentHome();
196 void llModifyLand();
197 void llCollisionSound();
198 void llCollisionSprite();
199 void llGetAnimation();
200 void llResetScript();
201 void llMessageLinked();
202 void llPushObject();
203 void llPassCollisions();
204 void llGetScriptName();
205 void llGetNumberOfSides();
206 void llAxisAngle2Rot();
207 void llRot2Axis();
208 void llRot2Angle();
209 void llAcos();
210 void llAsin();
211 void llAngleBetween();
212 void llGetInventoryKey();
213 void llAllowInventoryDrop();
214 void llGetSunDirection();
215 void llGetTextureOffset();
216 void llGetTextureScale();
217 void llGetTextureRot();
218 void llSubStringIndex();
219 void llGetOwnerKey();
220 void llGetCenterOfMass();
221 void llListSort();
222 void llGetListLength();
223 void llList2Integer();
224 void llList2Float();
225 void llList2String();
226 void llList2Key();
227 void llList2Vector();
228 void llList2Rot();
229 void llList2List();
230 void llDeleteSubList();
231 void llGetListEntryType();
232 void llList2CSV();
233 void llCSV2List();
234 void llListRandomize();
235 void llList2ListStrided();
236 void llGetRegionCorner();
237 void llListInsertList();
238 void llListFindList();
239 void llGetObjectName();
240 void llSetObjectName();
241 void llGetDate();
242 void llEdgeOfWorld();
243 void llGetAgentInfo();
244 void llAdjustSoundVolume();
245 void llSetSoundQueueing();
246 void llSetSoundRadius();
247 void llKey2Name();
248 void llSetTextureAnim();
249 void llTriggerSoundLimited();
250 void llEjectFromLand();
251 void llParseString2List();
252 void llOverMyLand();
253 void llGetLandOwnerAt();
254 void llGetNotecardLine();
255 void llGetAgentSize();
256 void llSameGroup();
257 void llUnSit();
258 void llGroundSlope();
259 void llGroundNormal();
260 void llGroundContour();
261 void llGetAttached();
262 void llGetFreeMemory();
263 void llGetRegionName();
264 void llGetRegionTimeDilation();
265 void llGetRegionFPS();
266 void llParticleSystem();
267 void llGroundRepel();
268 void llGiveInventoryList();
269 void llSetVehicleType();
270 void llSetVehicleFloatParam();
271 void llSetVehicleVectorParam();
272 void llSetVehicleRotationParam();
273 void llSetVehicleFlags();
274 void llRemoveVehicleFlags();
275 void llSitTarget();
276 void llAvatarOnSitTarget();
277 void llAddToLandPassList();
278 void llSetTouchText();
279 void llSetSitText();
280 void llSetCameraEyeOffset();
281 void llSetCameraAtOffset();
282 void llDumpList2String();
283 void llScriptDanger();
284 void llDialog();
285 void llVolumeDetect();
286 void llResetOtherScript();
287 void llGetScriptState();
288 void llRemoteLoadScript();
289 void llSetRemoteScriptAccessPin();
290 void llRemoteLoadScriptPin();
291 void llOpenRemoteDataChannel();
292 void llSendRemoteData();
293 void llRemoteDataReply();
294 void llCloseRemoteDataChannel();
295 void llMD5String();
296 void llSetPrimitiveParams();
297 void llStringToBase64();
298 void llBase64ToString();
299 void llXorBase64Strings();
300 void llRemoteDataSetRegion();
301 void llLog10();
302 void llLog();
303 void llGetAnimationList();
304 void llSetParcelMusicURL();
305 void llGetRootPosition();
306 void llGetRootRotation();
307 void llGetObjectDesc();
308 void llSetObjectDesc();
309 void llGetCreator();
310 void llGetTimestamp();
311 void llSetLinkAlpha();
312 void llGetNumberOfPrims();
313 void llGetNumberOfNotecardLines();
314 void llGetBoundingBox();
315 void llGetGeometricCenter();
316 void llGetPrimitiveParams();
317 void llIntegerToBase64();
318 void llBase64ToInteger();
319 void llGetGMTclock();
320 void llGetSimulatorHostname();
321 void llSetLocalRot();
322 void llParseStringKeepNulls();
323 void llRezAtRoot();
324 void llGetObjectPermMask();
325 void llSetObjectPermMask();
326 void llGetInventoryPermMask();
327 void llSetInventoryPermMask();
328 void llGetInventoryCreator();
329 void llOwnerSay();
330 void llRequestSimulatorData();
331 void llForceMouselook();
332 void llGetObjectMass();
333 void llListReplaceList();
334 void llLoadURL();
335 void llParcelMediaCommandList();
336 void llParcelMediaQuery();
337 void llModPow();
338 void llGetInventoryType();
339 void llSetPayPrice();
340 void llGetCameraPos();
341 void llGetCameraRot();
342 void llSetPrimURL();
343 void llRefreshPrimURL();
344 void llEscapeURL();
345 void llUnescapeURL();
346 void llMapDestination();
347 void llAddToLandBanList();
348 void llRemoveFromLandPassList();
349 void llRemoveFromLandBanList();
350 void llSetCameraParams();
351 void llClearCameraParams();
352 void llListStatistics();
353 void llGetUnixTime();
354 void llGetParcelFlags();
355 void llGetRegionFlags();
356 void llXorBase64StringsCorrect();
357 void llHTTPRequest();
358 void llResetLandBanList();
359 void llResetLandPassList();
360 void llGetParcelPrimCount();
361 void llGetParcelPrimOwners();
362 void llGetObjectPrimCount();
363 void llGetParcelMaxPrims();
364 void llGetParcelDetails();
365 }
366 }
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs
deleted file mode 100644
index 4b0fa7e..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_BuiltIn_Commands_TestImplementation.cs
+++ /dev/null
@@ -1,377 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30using System.Collections.Generic;
31using System.Text;
32
33namespace OpenSim.Region.Scripting.LSL
34{
35 public class LSL_BuiltIn_Commands_TestImplementation: LSL_BuiltIn_Commands_Interface
36 {
37 public LSL_BuiltIn_Commands_TestImplementation()
38 {
39 Common.SendToDebug("LSL_BuiltIn_Commands_TestImplementation: Creating object");
40 }
41
42 public void llSin() { }
43 public void llCos() { }
44 public void llTan() { }
45 public void llAtan2() { }
46 public void llSqrt() { }
47 public void llPow() { }
48 public void llAbs() { }
49 public void llFabs() { }
50 public void llFrand() { }
51 public void llFloor() { }
52 public void llCeil() { }
53 public void llRound() { }
54 public void llVecMag() { }
55 public void llVecNorm() { }
56 public void llVecDist() { }
57 public void llRot2Euler() { }
58 public void llEuler2Rot() { }
59 public void llAxes2Rot() { }
60 public void llRot2Fwd() { }
61 public void llRot2Left() { }
62 public void llRot2Up() { }
63 public void llRotBetween() { }
64 public void llWhisper() { }
65 public void llSay(UInt32 channelID, string text)
66 {
67 Common.SendToDebug("INTERNAL FUNCTION llSay(" + channelID + ", \"" + text + "\");");
68 }
69 public void llShout() { }
70 public void llListen() { }
71 public void llListenControl() { }
72 public void llListenRemove() { }
73 public void llSensor() { }
74 public void llSensorRepeat() { }
75 public void llSensorRemove() { }
76 public void llDetectedName() { }
77 public void llDetectedKey() { }
78 public void llDetectedOwner() { }
79 public void llDetectedType() { }
80 public void llDetectedPos() { }
81 public void llDetectedVel() { }
82 public void llDetectedGrab() { }
83 public void llDetectedRot() { }
84 public void llDetectedGroup() { }
85 public void llDetectedLinkNumber() { }
86 public void llDie() { }
87 public void llGround() { }
88 public void llCloud() { }
89 public void llWind() { }
90 public void llSetStatus() { }
91 public void llGetStatus() { }
92 public void llSetScale() { }
93 public void llGetScale() { }
94 public void llSetColor() { }
95 public void llGetAlpha() { }
96 public void llSetAlpha() { }
97 public void llGetColor() { }
98 public void llSetTexture() { }
99 public void llScaleTexture() { }
100 public void llOffsetTexture() { }
101 public void llRotateTexture() { }
102 public void llGetTexture() { }
103 public void llSetPos() { }
104 public void llGetPos() { }
105 public void llGetLocalPos() { }
106 public void llSetRot() { }
107 public void llGetRot() { }
108 public void llGetLocalRot() { }
109 public void llSetForce() { }
110 public void llGetForce() { }
111 public void llTarget() { }
112 public void llTargetRemove() { }
113 public void llRotTarget() { }
114 public void llRotTargetRemove() { }
115 public void llMoveToTarget() { }
116 public void llStopMoveToTarget() { }
117 public void llApplyImpulse() { }
118 public void llApplyRotationalImpulse() { }
119 public void llSetTorque() { }
120 public void llGetTorque() { }
121 public void llSetForceAndTorque() { }
122 public void llGetVel() { }
123 public void llGetAccel() { }
124 public void llGetOmega() { }
125 public void llGetTimeOfDay() { }
126 public void llGetWallclock() { }
127 public void llGetTime() { }
128 public void llResetTime() { }
129 public void llGetAndResetTime() { }
130 public void llSound() { }
131 public void llPlaySound() { }
132 public void llLoopSound() { }
133 public void llLoopSoundMaster() { }
134 public void llLoopSoundSlave() { }
135 public void llPlaySoundSlave() { }
136 public void llTriggerSound() { }
137 public void llStopSound() { }
138 public void llPreloadSound() { }
139 public void llGetSubString() { }
140 public void llDeleteSubString() { }
141 public void llInsertString() { }
142 public void llToUpper() { }
143 public void llToLower() { }
144 public void llGiveMoney() { }
145 public void llMakeExplosion() { }
146 public void llMakeFountain() { }
147 public void llMakeSmoke() { }
148 public void llMakeFire() { }
149 public void llRezObject() { }
150 public void llLookAt() { }
151 public void llStopLookAt() { }
152 public void llSetTimerEvent() { }
153 public void llSleep() { }
154 public void llGetMass() { }
155 public void llCollisionFilter() { }
156 public void llTakeControls() { }
157 public void llReleaseControls() { }
158 public void llAttachToAvatar() { }
159 public void llDetachFromAvatar() { }
160 public void llTakeCamera() { }
161 public void llReleaseCamera() { }
162 public void llGetOwner() { }
163 public void llInstantMessage() { }
164 public void llEmail() { }
165 public void llGetNextEmail() { }
166 public void llGetKey() { }
167 public void llSetBuoyancy() { }
168 public void llSetHoverHeight() { }
169 public void llStopHover() { }
170 public void llMinEventDelay() { }
171 public void llSoundPreload() { }
172 public void llRotLookAt() { }
173 public void llStringLength() { }
174 public void llStartAnimation() { }
175 public void llStopAnimation() { }
176 public void llPointAt() { }
177 public void llStopPointAt() { }
178 public void llTargetOmega() { }
179 public void llGetStartParameter() { }
180 public void llGodLikeRezObject() { }
181 public void llRequestPermissions() { }
182 public void llGetPermissionsKey() { }
183 public void llGetPermissions() { }
184 public void llGetLinkNumber() { }
185 public void llSetLinkColor() { }
186 public void llCreateLink() { }
187 public void llBreakLink() { }
188 public void llBreakAllLinks() { }
189 public void llGetLinkKey() { }
190 public void llGetLinkName() { }
191 public void llGetInventoryNumber() { }
192 public void llGetInventoryName() { }
193 public void llSetScriptState() { }
194 public void llGetEnergy() { }
195 public void llGiveInventory() { }
196 public void llRemoveInventory() { }
197 public void llSetText() { }
198 public void llWater() { }
199 public void llPassTouches() { }
200 public void llRequestAgentData() { }
201 public void llRequestInventoryData() { }
202 public void llSetDamage() { }
203 public void llTeleportAgentHome() { }
204 public void llModifyLand() { }
205 public void llCollisionSound() { }
206 public void llCollisionSprite() { }
207 public void llGetAnimation() { }
208 public void llResetScript() { }
209 public void llMessageLinked() { }
210 public void llPushObject() { }
211 public void llPassCollisions() { }
212 public void llGetScriptName() { }
213 public void llGetNumberOfSides() { }
214 public void llAxisAngle2Rot() { }
215 public void llRot2Axis() { }
216 public void llRot2Angle() { }
217 public void llAcos() { }
218 public void llAsin() { }
219 public void llAngleBetween() { }
220 public void llGetInventoryKey() { }
221 public void llAllowInventoryDrop() { }
222 public void llGetSunDirection() { }
223 public void llGetTextureOffset() { }
224 public void llGetTextureScale() { }
225 public void llGetTextureRot() { }
226 public void llSubStringIndex() { }
227 public void llGetOwnerKey() { }
228 public void llGetCenterOfMass() { }
229 public void llListSort() { }
230 public void llGetListLength() { }
231 public void llList2Integer() { }
232 public void llList2Float() { }
233 public void llList2String() { }
234 public void llList2Key() { }
235 public void llList2Vector() { }
236 public void llList2Rot() { }
237 public void llList2List() { }
238 public void llDeleteSubList() { }
239 public void llGetListEntryType() { }
240 public void llList2CSV() { }
241 public void llCSV2List() { }
242 public void llListRandomize() { }
243 public void llList2ListStrided() { }
244 public void llGetRegionCorner() { }
245 public void llListInsertList() { }
246 public void llListFindList() { }
247 public void llGetObjectName() { }
248 public void llSetObjectName() { }
249 public void llGetDate() { }
250 public void llEdgeOfWorld() { }
251 public void llGetAgentInfo() { }
252 public void llAdjustSoundVolume() { }
253 public void llSetSoundQueueing() { }
254 public void llSetSoundRadius() { }
255 public void llKey2Name() { }
256 public void llSetTextureAnim() { }
257 public void llTriggerSoundLimited() { }
258 public void llEjectFromLand() { }
259 public void llParseString2List() { }
260 public void llOverMyLand() { }
261 public void llGetLandOwnerAt() { }
262 public void llGetNotecardLine() { }
263 public void llGetAgentSize() { }
264 public void llSameGroup() { }
265 public void llUnSit() { }
266 public void llGroundSlope() { }
267 public void llGroundNormal() { }
268 public void llGroundContour() { }
269 public void llGetAttached() { }
270 public void llGetFreeMemory() { }
271 public void llGetRegionName() { }
272 public void llGetRegionTimeDilation() { }
273 public void llGetRegionFPS() { }
274 public void llParticleSystem() { }
275 public void llGroundRepel() { }
276 public void llGiveInventoryList() { }
277 public void llSetVehicleType() { }
278 public void llSetVehicleFloatParam() { }
279 public void llSetVehicleVectorParam() { }
280 public void llSetVehicleRotationParam() { }
281 public void llSetVehicleFlags() { }
282 public void llRemoveVehicleFlags() { }
283 public void llSitTarget() { }
284 public void llAvatarOnSitTarget() { }
285 public void llAddToLandPassList() { }
286 public void llSetTouchText() { }
287 public void llSetSitText() { }
288 public void llSetCameraEyeOffset() { }
289 public void llSetCameraAtOffset() { }
290 public void llDumpList2String() { }
291 public void llScriptDanger() { }
292 public void llDialog() { }
293 public void llVolumeDetect() { }
294 public void llResetOtherScript() { }
295 public void llGetScriptState() { }
296 public void llRemoteLoadScript() { }
297 public void llSetRemoteScriptAccessPin() { }
298 public void llRemoteLoadScriptPin() { }
299 public void llOpenRemoteDataChannel() { }
300 public void llSendRemoteData() { }
301 public void llRemoteDataReply() { }
302 public void llCloseRemoteDataChannel() { }
303 public void llMD5String() { }
304 public void llSetPrimitiveParams() { }
305 public void llStringToBase64() { }
306 public void llBase64ToString() { }
307 public void llXorBase64Strings() { }
308 public void llRemoteDataSetRegion() { }
309 public void llLog10() { }
310 public void llLog() { }
311 public void llGetAnimationList() { }
312 public void llSetParcelMusicURL() { }
313 public void llGetRootPosition() { }
314 public void llGetRootRotation() { }
315 public void llGetObjectDesc() { }
316 public void llSetObjectDesc() { }
317 public void llGetCreator() { }
318 public void llGetTimestamp() { }
319 public void llSetLinkAlpha() { }
320 public void llGetNumberOfPrims() { }
321 public void llGetNumberOfNotecardLines() { }
322 public void llGetBoundingBox() { }
323 public void llGetGeometricCenter() { }
324 public void llGetPrimitiveParams() { }
325 public void llIntegerToBase64() { }
326 public void llBase64ToInteger() { }
327 public void llGetGMTclock() { }
328 public void llGetSimulatorHostname() { }
329 public void llSetLocalRot() { }
330 public void llParseStringKeepNulls() { }
331 public void llRezAtRoot() { }
332 public void llGetObjectPermMask() { }
333 public void llSetObjectPermMask() { }
334 public void llGetInventoryPermMask() { }
335 public void llSetInventoryPermMask() { }
336 public void llGetInventoryCreator() { }
337 public void llOwnerSay() { }
338 public void llRequestSimulatorData() { }
339 public void llForceMouselook() { }
340 public void llGetObjectMass() { }
341 public void llListReplaceList() { }
342 public void llLoadURL() { }
343 public void llParcelMediaCommandList() { }
344 public void llParcelMediaQuery() { }
345 public void llModPow() { }
346 public void llGetInventoryType() { }
347 public void llSetPayPrice() { }
348 public void llGetCameraPos() { }
349 public void llGetCameraRot() { }
350 public void llSetPrimURL() { }
351 public void llRefreshPrimURL() { }
352 public void llEscapeURL() { }
353 public void llUnescapeURL() { }
354 public void llMapDestination() { }
355 public void llAddToLandBanList() { }
356 public void llRemoveFromLandPassList() { }
357 public void llRemoveFromLandBanList() { }
358 public void llSetCameraParams() { }
359 public void llClearCameraParams() { }
360 public void llListStatistics() { }
361 public void llGetUnixTime() { }
362 public void llGetParcelFlags() { }
363 public void llGetRegionFlags() { }
364 public void llXorBase64StringsCorrect() { }
365 public void llHTTPRequest() { }
366 public void llResetLandBanList() { }
367 public void llResetLandPassList() { }
368 public void llGetParcelPrimCount() { }
369 public void llGetParcelPrimOwners() { }
370 public void llGetObjectPrimCount() { }
371 public void llGetParcelMaxPrims() { }
372 public void llGetParcelDetails() { }
373
374
375
376 }
377}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_CLRInterface.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_CLRInterface.cs
deleted file mode 100644
index ed22c8c..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_CLRInterface.cs
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30using System.Collections.Generic;
31using System.Text;
32
33namespace OpenSim.Region.Scripting.LSL
34{
35 public class LSL_CLRInterface
36 {
37 public interface LSLScript
38 {
39 //public virtual void Run(object arg)
40 //{
41 //}
42 //void Run(object arg);
43
44 //void event_state_entry(object arg);
45 //void event_state_exit();
46 //void event_touch_start(object arg);
47 //void event_touch();
48 //void event_touch_end();
49 //void event_collision_start();
50 //void event_collision();
51 //void event_collision_end();
52 //void event_land_collision_start();
53 //void event_land_collision();
54 //void event_land_collision_end();
55 //void event_timer();
56 //void event_listen();
57 //void event_on_rez();
58 //void event_sensor();
59 //void event_no_sensor();
60 //void event_control();
61 //void event_money();
62 //void event_email();
63 //void event_at_target();
64 //void event_not_at_target();
65 //void event_at_rot_target();
66 //void event_not_at_rot_target();
67 //void event_run_time_permissions();
68 //void event_changed();
69 //void event_attach();
70 //void event_dataserver();
71 //void event_link_message();
72 //void event_moving_start();
73 //void event_moving_end();
74 //void event_object_rez();
75 //void event_remote_data();
76 //void event_http_response();
77 }
78 }
79}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs
deleted file mode 100644
index e85c1d0..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSL_OPCODE_IL_processor.cs
+++ /dev/null
@@ -1,351 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30using System.Collections.Generic;
31using System.Text;
32using System.Reflection;
33using System.Reflection.Emit;
34
35namespace OpenSim.Region.Scripting.LSL
36{
37 partial class LSO_Parser
38 {
39 //LSO_Enums MyLSO_Enums = new LSO_Enums();
40
41 internal bool LSL_PROCESS_OPCODE(ILGenerator il)
42 {
43
44 byte bp1;
45 UInt32 u32p1;
46 UInt16 opcode = br_read(1)[0];
47 Common.SendToDebug("OPCODE: " + ((LSO_Enums.Operation_Table)opcode).ToString());
48 string idesc = ((LSO_Enums.Operation_Table)opcode).ToString();
49 switch ((LSO_Enums.Operation_Table)opcode)
50 {
51
52 case LSO_Enums.Operation_Table.POP:
53 case LSO_Enums.Operation_Table.POPL:
54 case LSO_Enums.Operation_Table.POPV:
55 case LSO_Enums.Operation_Table.POPQ:
56 case LSO_Enums.Operation_Table.POPIP:
57 case LSO_Enums.Operation_Table.POPBP:
58 case LSO_Enums.Operation_Table.POPSP:
59 case LSO_Enums.Operation_Table.POPSLR:
60 // ignore -- builds callframe
61 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Pop);");
62 il.Emit(OpCodes.Pop);
63 break;
64 case LSO_Enums.Operation_Table.POPARG:
65 Common.SendToDebug("Instruction " + idesc + ": Ignored");
66 Common.SendToDebug("Instruction " + idesc + ": Description: Drop x bytes from the stack ");
67 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
68 break;
69
70 // LONG
71 case LSO_Enums.Operation_Table.STORE:
72 case LSO_Enums.Operation_Table.STORES:
73 case LSO_Enums.Operation_Table.STOREL:
74 case LSO_Enums.Operation_Table.STOREV:
75 case LSO_Enums.Operation_Table.STOREQ:
76 case LSO_Enums.Operation_Table.STOREG:
77 case LSO_Enums.Operation_Table.STOREGS:
78 case LSO_Enums.Operation_Table.STOREGL:
79 case LSO_Enums.Operation_Table.STOREGV:
80 case LSO_Enums.Operation_Table.STOREGQ:
81 case LSO_Enums.Operation_Table.LOADP:
82 case LSO_Enums.Operation_Table.LOADSP:
83 case LSO_Enums.Operation_Table.LOADLP:
84 case LSO_Enums.Operation_Table.LOADVP:
85 case LSO_Enums.Operation_Table.LOADQP:
86 case LSO_Enums.Operation_Table.PUSH:
87 case LSO_Enums.Operation_Table.PUSHS:
88 case LSO_Enums.Operation_Table.PUSHL:
89 case LSO_Enums.Operation_Table.PUSHV:
90 case LSO_Enums.Operation_Table.PUSHQ:
91 case LSO_Enums.Operation_Table.PUSHG:
92 case LSO_Enums.Operation_Table.PUSHGS:
93 case LSO_Enums.Operation_Table.PUSHGL:
94 case LSO_Enums.Operation_Table.PUSHGV:
95 case LSO_Enums.Operation_Table.PUSHGQ:
96 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
97 break;
98 // None
99 case LSO_Enums.Operation_Table.PUSHIP:
100 case LSO_Enums.Operation_Table.PUSHBP:
101 case LSO_Enums.Operation_Table.PUSHSP:
102 // Push Stack Top (Memory Address) to stack
103 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldc_I4, " + myHeader.SP + ");");
104 Common.SendToDebug("Instruction " + idesc + ": Description: Pushing Stack Top (Memory Address from header) to stack");
105 il.Emit(OpCodes.Ldc_I4, myHeader.SP);
106 break;
107 // BYTE
108 case LSO_Enums.Operation_Table.PUSHARGB:
109 Common.SendToDebug("Param1: " + br_read(1)[0]);
110 break;
111 // INTEGER
112 case LSO_Enums.Operation_Table.PUSHARGI:
113 // TODO: What is size of integer?
114 u32p1 = BitConverter.ToUInt32(br_read(4), 0);
115 Common.SendToDebug("Instruction PUSHSP: il.Emit(OpCodes.Ldc_I4, " + u32p1 + ");");
116 Common.SendToDebug("Param1: " + u32p1);
117 il.Emit(OpCodes.Ldc_I4, u32p1);
118 break;
119 // FLOAT
120 case LSO_Enums.Operation_Table.PUSHARGF:
121 // TODO: What is size of float?
122 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
123 break;
124 // STRING
125 case LSO_Enums.Operation_Table.PUSHARGS:
126 string s = Read_String();
127 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldstr, \"" + s + "\");");
128 Common.SendToDebug("Param1: " + s);
129 il.Emit(OpCodes.Ldstr, s);
130 break;
131 // VECTOR z,y,x
132 case LSO_Enums.Operation_Table.PUSHARGV:
133 Common.SendToDebug("Param1 Z: " + BitConverter.ToUInt32(br_read(4), 0));
134 Common.SendToDebug("Param1 Y: " + BitConverter.ToUInt32(br_read(4), 0));
135 Common.SendToDebug("Param1 X: " + BitConverter.ToUInt32(br_read(4), 0));
136 break;
137 // ROTATION s,z,y,x
138 case LSO_Enums.Operation_Table.PUSHARGQ:
139 Common.SendToDebug("Param1 S: " + BitConverter.ToUInt32(br_read(4), 0));
140 Common.SendToDebug("Param1 Z: " + BitConverter.ToUInt32(br_read(4), 0));
141 Common.SendToDebug("Param1 Y: " + BitConverter.ToUInt32(br_read(4), 0));
142 Common.SendToDebug("Param1 X: " + BitConverter.ToUInt32(br_read(4), 0));
143 break;
144 // LONG
145 case LSO_Enums.Operation_Table.PUSHARGE:
146 u32p1 = BitConverter.ToUInt32(br_read(4), 0);
147 //Common.SendToDebug("Instruction PUSHSP: il.Emit(OpCodes., " + u32p1 + ");");
148 Common.SendToDebug("Instruction " + idesc + ": Ignoring (not in use according to doc)");
149 //Common.SendToDebug("Instruction " + idesc + ": Description: Pushes X bytes of $00 onto the stack (used to put space for local variable memory for a call)");
150 Common.SendToDebug("Param1: " + u32p1);
151 //il.Emit(OpCodes.ldc_i4, u32p1);
152 //if (u32p1 > 0) {
153 //for (int _ic=0; _ic < u32p1; _ic++)
154 //{
155 // Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldnull);");
156 // il.Emit(OpCodes.Ldnull);
157 //}
158 break;
159 // BYTE
160 case LSO_Enums.Operation_Table.ADD:
161 bp1 = br_read(1)[0];
162 Common.SendToDebug("Instruction " + idesc + ": Add type: " + ((LSO_Enums.OpCode_Add_TypeDefs)bp1).ToString());
163 Common.SendToDebug("Param1: " + bp1);
164 switch ((LSO_Enums.OpCode_Add_TypeDefs)bp1)
165 {
166 case LSO_Enums.OpCode_Add_TypeDefs.String:
167 Common.SendToDebug("Instruction " + idesc
168 + ": il.Emit(OpCodes.Call, typeof(System.String).GetMethod(\"Concat\", new Type[] { typeof(object), typeof(object) }));");
169 il.Emit(OpCodes.Call, typeof(System.String).GetMethod
170 ("Concat", new Type[] { typeof(object), typeof(object) }));
171
172 break;
173 case LSO_Enums.OpCode_Add_TypeDefs.UInt32:
174 default:
175 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Add);");
176 il.Emit(OpCodes.Add);
177 break;
178 }
179
180
181 //il.Emit(OpCodes.Add, p1);
182 break;
183 case LSO_Enums.Operation_Table.SUB:
184 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Sub);");
185 bp1 = br_read(1)[0];
186 Common.SendToDebug("Param1: " + bp1);
187 il.Emit(OpCodes.Sub);
188 //il.Emit(OpCodes.Sub, p1);
189 break;
190 case LSO_Enums.Operation_Table.MUL:
191 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Mul);");
192 bp1 = br_read(1)[0];
193 Common.SendToDebug("Param1: " + bp1);
194 il.Emit(OpCodes.Mul);
195 //il.Emit(OpCodes.Mul, p1);
196 break;
197 case LSO_Enums.Operation_Table.DIV:
198 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Div);");
199 bp1 = br_read(1)[0];
200 Common.SendToDebug("Param1: " + bp1);
201 il.Emit(OpCodes.Div);
202 //il.Emit(OpCodes.Div, p1);
203 break;
204 case LSO_Enums.Operation_Table.EQ:
205 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ceq);");
206 bp1 = br_read(1)[0];
207 Common.SendToDebug("Param1: " + bp1);
208 il.Emit(OpCodes.Ceq);
209 //il.Emit(OpCodes.Ceq, p1);
210 break;
211 case LSO_Enums.Operation_Table.NEQ:
212 case LSO_Enums.Operation_Table.LEQ:
213 case LSO_Enums.Operation_Table.GEQ:
214 case LSO_Enums.Operation_Table.LESS:
215 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Clt_Un);");
216 bp1 = br_read(1)[0];
217 Common.SendToDebug("Param1: " + bp1);
218 il.Emit(OpCodes.Clt_Un);
219 //il.Emit(OpCodes.Clt, p1);
220 break;
221 case LSO_Enums.Operation_Table.GREATER:
222 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Cgt_Un);");
223 bp1 = br_read(1)[0];
224 Common.SendToDebug("Param1: " + bp1);
225 il.Emit(OpCodes.Cgt_Un);
226 //il.Emit(OpCodes.Cgt, p1);
227 break;
228 case LSO_Enums.Operation_Table.MOD:
229 case LSO_Enums.Operation_Table.BOOLOR:
230 bp1 = br_read(1)[0];
231 Common.SendToDebug("Param1: " + bp1);
232 break;
233 // LONG
234 case LSO_Enums.Operation_Table.JUMP:
235 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
236 break;
237 // BYTE, LONG
238 case LSO_Enums.Operation_Table.JUMPIF:
239 case LSO_Enums.Operation_Table.JUMPNIF:
240 Common.SendToDebug("Param1: " + br_read(1)[0]);
241 Common.SendToDebug("Param2: " + BitConverter.ToUInt32(br_read(4), 0));
242 break;
243 // LONG
244 case LSO_Enums.Operation_Table.STATE:
245 bp1 = br_read(1)[0];
246 //il.Emit(OpCodes.Ld); // Load local variable 0 onto stack
247 //il.Emit(OpCodes.Ldc_I4, 0); // Push index position
248 //il.Emit(OpCodes.Ldstr, EventList[p1]); // Push value
249 //il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value
250 break;
251 case LSO_Enums.Operation_Table.CALL:
252 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
253 break;
254 // BYTE
255 case LSO_Enums.Operation_Table.CAST:
256 bp1 = br_read(1)[0];
257 Common.SendToDebug("Instruction " + idesc + ": Cast to type: " + ((LSO_Enums.OpCode_Cast_TypeDefs)bp1));
258 Common.SendToDebug("Param1: " + bp1);
259 switch ((LSO_Enums.OpCode_Cast_TypeDefs)bp1)
260 {
261 case LSO_Enums.OpCode_Cast_TypeDefs.String:
262 Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Calli, typeof(System.Convert).GetMethod(\"ToString\", new Type[] { typeof(object) }));");
263 //il.Emit(OpCodes.Box, typeof (UInt32));
264 il.Emit(OpCodes.Calli, typeof(Common).GetMethod
265 ("Cast_ToString", new Type[] { typeof(object) }));
266
267 //il.Emit(OpCodes.Box, typeof(System.UInt32) );
268 //il.Emit(OpCodes.Box, typeof(string));
269
270 //il.Emit(OpCodes.Conv_R8);
271 //il.Emit(OpCodes.Call, typeof(System.Convert).GetMethod
272 // ("ToString", new Type[] { typeof(float) }));
273
274 break;
275 default:
276 Common.SendToDebug("Instruction " + idesc + ": Unknown cast type!");
277 break;
278 }
279 break;
280 // LONG
281 case LSO_Enums.Operation_Table.STACKTOS:
282 case LSO_Enums.Operation_Table.STACKTOL:
283 Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0));
284 break;
285 // BYTE
286 case LSO_Enums.Operation_Table.PRINT:
287 case LSO_Enums.Operation_Table.CALLLIB:
288 Common.SendToDebug("Param1: " + br_read(1)[0]);
289 break;
290 // SHORT
291 case LSO_Enums.Operation_Table.CALLLIB_TWO_BYTE:
292 // TODO: What is size of short?
293 UInt16 U16p1 = BitConverter.ToUInt16(br_read(2), 0);
294 Common.SendToDebug("Instruction " + idesc + ": Builtin Command: " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString());
295 Common.SendToDebug("Param1: " + U16p1);
296 switch ((LSO_Enums.BuiltIn_Functions)U16p1)
297 {
298 case LSO_Enums.BuiltIn_Functions.llSay:
299 Common.SendToDebug("Instruction " + idesc + " " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString()
300 + ": Mapped to internal function");
301
302 //il.Emit(OpCodes.Ldstr, "INTERNAL COMMAND: llSay({0}, \"{1}\"");
303 //il.Emit(OpCodes.Call, typeof(IL_Helper).GetMethod("ReverseFormatString",
304 // new Type[] { typeof(string), typeof(UInt32), typeof(string) }
305 //));
306
307
308 //il.Emit(OpCodes.Pop);
309 //il.Emit(OpCodes.Call,
310 // typeof(Console).GetMethod("WriteLine",
311 // new Type[] { typeof(string) }
312 //));
313
314
315 il.Emit(OpCodes.Call,
316 typeof(Common).GetMethod("SendToLog",
317 new Type[] { typeof(string) }
318 ));
319
320
321
322 //il.Emit(OpCodes.Pop);
323
324 //il.Emit(OpCodes.Ldind_I2, 0);
325
326 //il.Emit(OpCodes.Call, typeof(string).GetMethod("Format", new Type[] { typeof(string), typeof(object) }));
327 //il.EmitCalli(OpCodes.Calli,
328 //il.Emit(OpCodes.Call, typeof().GetMethod
329 // ("llSay", new Type[] { typeof(UInt32), typeof(string) }));
330 break;
331 default:
332 Common.SendToDebug("Instruction " + idesc + ": " + ((LSO_Enums.BuiltIn_Functions)U16p1).ToString() + ": INTERNAL COMMAND NOT IMPLEMENTED");
333 break;
334 }
335
336 //Common.SendToDebug("Instruction " + idesc + ": DEBUG: Faking return code:");
337 //Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Ldc_I4, 0);");
338 //il.Emit(OpCodes.Ldc_I4, 0);
339 break;
340
341 // RETURN
342 case LSO_Enums.Operation_Table.RETURN:
343
344 Common.SendToDebug("Last OPCODE was return command. Code chunk execution complete.");
345 return true;
346 }
347 return false;
348 }
349
350 }
351}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Enums.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Enums.cs
deleted file mode 100644
index 7cac152..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Enums.cs
+++ /dev/null
@@ -1,548 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30using System.Collections.Generic;
31using System.Text;
32
33namespace OpenSim.Region.Scripting.LSL
34{
35 static class LSO_Enums
36 {
37 //public System.Collections.Generic.Dictionary<Byte, Type> OpCode_Add_Types;
38
39 //LSO_Enums() {
40 // OpCode_Add_Types.Add(51, typeof(String));
41 // OpCode_Add_Types.Add(17, typeof(UInt32));
42 //}
43
44 public enum OpCode_Add_TypeDefs
45 {
46 String = 51,
47 UInt32 = 17
48 }
49 public enum OpCode_Cast_TypeDefs
50 {
51 String = 19
52 }
53
54#pragma warning disable 649
55
56 public struct Vector
57 {
58 public UInt32 Z;
59 public UInt32 Y;
60 public UInt32 X;
61 }
62
63 public struct Rotation
64 {
65 public UInt32 S;
66 public UInt32 Z;
67 public UInt32 Y;
68 public UInt32 X;
69 }
70
71#pragma warning restore 649
72
73 public enum Variable_Type_Codes
74 {
75 Void = 0,
76 Integer = 1,
77 Float = 2,
78 String = 3,
79 Key = 4,
80 Vector = 5,
81 Rotation = 6,
82 List = 7
83 }
84 public enum Event_Mask_Values
85 {
86 state_entry = 0,
87 state_exit = 1,
88 touch_start = 2,
89 touch = 3,
90 touch_end = 4,
91 collision_start = 5,
92 collision = 6,
93 collision_end = 7,
94 land_collision_start = 8,
95 land_collision = 9,
96 land_collision_end = 10,
97 timer = 11,
98 listen = 12,
99 on_rez = 13,
100 sensor = 14,
101 no_sensor = 15,
102 control = 16,
103 money = 17,
104 email = 18,
105 at_target = 19,
106 not_at_target = 20,
107 at_rot_target = 21,
108 not_at_rot_target = 22,
109 run_time_permissions = 23,
110 changed = 24,
111 attach = 25,
112 dataserver = 26,
113 link_message = 27,
114 moving_start = 28,
115 moving_end = 29,
116 object_rez = 30,
117 remote_data = 31,
118 http_response = 32
119 }
120 public enum Operation_Table
121 {
122 NOOP = 0x0,
123 POP = 0x1,
124 POPS = 0x2,
125 POPL = 0x3,
126 POPV = 0x4,
127 POPQ = 0x5,
128 POPARG = 0x6,
129 POPIP = 0x7,
130 POPBP = 0x8,
131 POPSP = 0x9,
132 POPSLR = 0xa,
133 DUP = 0x20,
134 DUPS = 0x21,
135 DUPL = 0x22,
136 DUPV = 0x23,
137 DUPQ = 0x24,
138 STORE = 0x30,
139 STORES = 0x31,
140 STOREL = 0x32,
141 STOREV = 0x33,
142 STOREQ = 0x34,
143 STOREG = 0x35,
144 STOREGS = 0x36,
145 STOREGL = 0x37,
146 STOREGV = 0x38,
147 STOREGQ = 0x39,
148 LOADP = 0x3a,
149 LOADSP = 0x3b,
150 LOADLP = 0x3c,
151 LOADVP = 0x3d,
152 LOADQP = 0x3e,
153 LOADGP = 0x3f,
154 LOADGSP = 0x40,
155 LOADGLP = 0x41,
156 LOADGVP = 0x42,
157 LOADGQP = 0x43,
158 PUSH = 0x50,
159 PUSHS = 0x51,
160 PUSHL = 0x52,
161 PUSHV = 0x53,
162 PUSHQ = 0x54,
163 PUSHG = 0x55,
164 PUSHGS = 0x56,
165 PUSHGL = 0x57,
166 PUSHGV = 0x58,
167 PUSHGQ = 0x59,
168 PUSHIP = 0x5a,
169 PUSHBP = 0x5b,
170 PUSHSP = 0x5c,
171 PUSHARGB = 0x5d,
172 PUSHARGI = 0x5e,
173 PUSHARGF = 0x5f,
174 PUSHARGS = 0x60,
175 PUSHARGV = 0x61,
176 PUSHARGQ = 0x62,
177 PUSHE = 0x63,
178 PUSHEV = 0x64,
179 PUSHEQ = 0x65,
180 PUSHARGE = 0x66,
181 ADD = 0x70,
182 SUB = 0x71,
183 MUL = 0x72,
184 DIV = 0x73,
185 MOD = 0x74,
186 EQ = 0x75,
187 NEQ = 0x76,
188 LEQ = 0x77,
189 GEQ = 0x78,
190 LESS = 0x79,
191 GREATER = 0x7a,
192 BITAND = 0x7b,
193 BITOR = 0x7c,
194 BITXOR = 0x7d,
195 BOOLAND = 0x7e,
196 BOOLOR = 0x7f,
197 NEG = 0x80,
198 BITNOT = 0x81,
199 BOOLNOT = 0x82,
200 JUMP = 0x90,
201 JUMPIF = 0x91,
202 JUMPNIF = 0x92,
203 STATE = 0x93,
204 CALL = 0x94,
205 RETURN = 0x95,
206 CAST = 0xa0,
207 STACKTOS = 0xb0,
208 STACKTOL = 0xb1,
209 PRINT = 0xc0,
210 CALLLIB = 0xd0,
211 CALLLIB_TWO_BYTE = 0xd1,
212 SHL = 0xe0,
213 SHR = 0xe1
214 }
215 public enum BuiltIn_Functions
216 {
217 llSin = 0,
218 llCos = 1,
219 llTan = 2,
220 llAtan2 = 3,
221 llSqrt = 4,
222 llPow = 5,
223 llAbs = 6,
224 llFabs = 7,
225 llFrand = 8,
226 llFloor = 9,
227 llCeil = 10,
228 llRound = 11,
229 llVecMag = 12,
230 llVecNorm = 13,
231 llVecDist = 14,
232 llRot2Euler = 15,
233 llEuler2Rot = 16,
234 llAxes2Rot = 17,
235 llRot2Fwd = 18,
236 llRot2Left = 19,
237 llRot2Up = 20,
238 llRotBetween = 21,
239 llWhisper = 22,
240 llSay = 23,
241 llShout = 24,
242 llListen = 25,
243 llListenControl = 26,
244 llListenRemove = 27,
245 llSensor = 28,
246 llSensorRepeat = 29,
247 llSensorRemove = 30,
248 llDetectedName = 31,
249 llDetectedKey = 32,
250 llDetectedOwner = 33,
251 llDetectedType = 34,
252 llDetectedPos = 35,
253 llDetectedVel = 36,
254 llDetectedGrab = 37,
255 llDetectedRot = 38,
256 llDetectedGroup = 39,
257 llDetectedLinkNumber = 40,
258 llDie = 41,
259 llGround = 42,
260 llCloud = 43,
261 llWind = 44,
262 llSetStatus = 45,
263 llGetStatus = 46,
264 llSetScale = 47,
265 llGetScale = 48,
266 llSetColor = 49,
267 llGetAlpha = 50,
268 llSetAlpha = 51,
269 llGetColor = 52,
270 llSetTexture = 53,
271 llScaleTexture = 54,
272 llOffsetTexture = 55,
273 llRotateTexture = 56,
274 llGetTexture = 57,
275 llSetPos = 58,
276 llGetPos = 59,
277 llGetLocalPos = 60,
278 llSetRot = 61,
279 llGetRot = 62,
280 llGetLocalRot = 63,
281 llSetForce = 64,
282 llGetForce = 65,
283 llTarget = 66,
284 llTargetRemove = 67,
285 llRotTarget = 68,
286 llRotTargetRemove = 69,
287 llMoveToTarget = 70,
288 llStopMoveToTarget = 71,
289 llApplyImpulse = 72,
290 llApplyRotationalImpulse = 73,
291 llSetTorque = 74,
292 llGetTorque = 75,
293 llSetForceAndTorque = 76,
294 llGetVel = 77,
295 llGetAccel = 78,
296 llGetOmega = 79,
297 llGetTimeOfDay = 80,
298 llGetWallclock = 81,
299 llGetTime = 82,
300 llResetTime = 83,
301 llGetAndResetTime = 84,
302 llSound = 85,
303 llPlaySound = 86,
304 llLoopSound = 87,
305 llLoopSoundMaster = 88,
306 llLoopSoundSlave = 89,
307 llPlaySoundSlave = 90,
308 llTriggerSound = 91,
309 llStopSound = 92,
310 llPreloadSound = 93,
311 llGetSubString = 94,
312 llDeleteSubString = 95,
313 llInsertString = 96,
314 llToUpper = 97,
315 llToLower = 98,
316 llGiveMoney = 99,
317 llMakeExplosion = 100,
318 llMakeFountain = 101,
319 llMakeSmoke = 102,
320 llMakeFire = 103,
321 llRezObject = 104,
322 llLookAt = 105,
323 llStopLookAt = 106,
324 llSetTimerEvent = 107,
325 llSleep = 108,
326 llGetMass = 109,
327 llCollisionFilter = 110,
328 llTakeControls = 111,
329 llReleaseControls = 112,
330 llAttachToAvatar = 113,
331 llDetachFromAvatar = 114,
332 llTakeCamera = 115,
333 llReleaseCamera = 116,
334 llGetOwner = 117,
335 llInstantMessage = 118,
336 llEmail = 119,
337 llGetNextEmail = 120,
338 llGetKey = 121,
339 llSetBuoyancy = 122,
340 llSetHoverHeight = 123,
341 llStopHover = 124,
342 llMinEventDelay = 125,
343 llSoundPreload = 126,
344 llRotLookAt = 127,
345 llStringLength = 128,
346 llStartAnimation = 129,
347 llStopAnimation = 130,
348 llPointAt = 131,
349 llStopPointAt = 132,
350 llTargetOmega = 133,
351 llGetStartParameter = 134,
352 llGodLikeRezObject = 135,
353 llRequestPermissions = 136,
354 llGetPermissionsKey = 137,
355 llGetPermissions = 138,
356 llGetLinkNumber = 139,
357 llSetLinkColor = 140,
358 llCreateLink = 141,
359 llBreakLink = 142,
360 llBreakAllLinks = 143,
361 llGetLinkKey = 144,
362 llGetLinkName = 145,
363 llGetInventoryNumber = 146,
364 llGetInventoryName = 147,
365 llSetScriptState = 148,
366 llGetEnergy = 149,
367 llGiveInventory = 150,
368 llRemoveInventory = 151,
369 llSetText = 152,
370 llWater = 153,
371 llPassTouches = 154,
372 llRequestAgentData = 155,
373 llRequestInventoryData = 156,
374 llSetDamage = 157,
375 llTeleportAgentHome = 158,
376 llModifyLand = 159,
377 llCollisionSound = 160,
378 llCollisionSprite = 161,
379 llGetAnimation = 162,
380 llResetScript = 163,
381 llMessageLinked = 164,
382 llPushObject = 165,
383 llPassCollisions = 166,
384 llGetScriptName = 167,
385 llGetNumberOfSides = 168,
386 llAxisAngle2Rot = 169,
387 llRot2Axis = 170,
388 llRot2Angle = 171,
389 llAcos = 172,
390 llAsin = 173,
391 llAngleBetween = 174,
392 llGetInventoryKey = 175,
393 llAllowInventoryDrop = 176,
394 llGetSunDirection = 177,
395 llGetTextureOffset = 178,
396 llGetTextureScale = 179,
397 llGetTextureRot = 180,
398 llSubStringIndex = 181,
399 llGetOwnerKey = 182,
400 llGetCenterOfMass = 183,
401 llListSort = 184,
402 llGetListLength = 185,
403 llList2Integer = 186,
404 llList2Float = 187,
405 llList2String = 188,
406 llList2Key = 189,
407 llList2Vector = 190,
408 llList2Rot = 191,
409 llList2List = 192,
410 llDeleteSubList = 193,
411 llGetListEntryType = 194,
412 llList2CSV = 195,
413 llCSV2List = 196,
414 llListRandomize = 197,
415 llList2ListStrided = 198,
416 llGetRegionCorner = 199,
417 llListInsertList = 200,
418 llListFindList = 201,
419 llGetObjectName = 202,
420 llSetObjectName = 203,
421 llGetDate = 204,
422 llEdgeOfWorld = 205,
423 llGetAgentInfo = 206,
424 llAdjustSoundVolume = 207,
425 llSetSoundQueueing = 208,
426 llSetSoundRadius = 209,
427 llKey2Name = 210,
428 llSetTextureAnim = 211,
429 llTriggerSoundLimited = 212,
430 llEjectFromLand = 213,
431 llParseString2List = 214,
432 llOverMyLand = 215,
433 llGetLandOwnerAt = 216,
434 llGetNotecardLine = 217,
435 llGetAgentSize = 218,
436 llSameGroup = 219,
437 llUnSit = 220,
438 llGroundSlope = 221,
439 llGroundNormal = 222,
440 llGroundContour = 223,
441 llGetAttached = 224,
442 llGetFreeMemory = 225,
443 llGetRegionName = 226,
444 llGetRegionTimeDilation = 227,
445 llGetRegionFPS = 228,
446 llParticleSystem = 229,
447 llGroundRepel = 230,
448 llGiveInventoryList = 231,
449 llSetVehicleType = 232,
450 llSetVehicleFloatParam = 233,
451 llSetVehicleVectorParam = 234,
452 llSetVehicleRotationParam = 235,
453 llSetVehicleFlags = 236,
454 llRemoveVehicleFlags = 237,
455 llSitTarget = 238,
456 llAvatarOnSitTarget = 239,
457 llAddToLandPassList = 240,
458 llSetTouchText = 241,
459 llSetSitText = 242,
460 llSetCameraEyeOffset = 243,
461 llSetCameraAtOffset = 244,
462 llDumpList2String = 245,
463 llScriptDanger = 246,
464 llDialog = 247,
465 llVolumeDetect = 248,
466 llResetOtherScript = 249,
467 llGetScriptState = 250,
468 llRemoteLoadScript = 251,
469 llSetRemoteScriptAccessPin = 252,
470 llRemoteLoadScriptPin = 253,
471 llOpenRemoteDataChannel = 254,
472 llSendRemoteData = 255,
473 llRemoteDataReply = 256,
474 llCloseRemoteDataChannel = 257,
475 llMD5String = 258,
476 llSetPrimitiveParams = 259,
477 llStringToBase64 = 260,
478 llBase64ToString = 261,
479 llXorBase64Strings = 262,
480 llRemoteDataSetRegion = 263,
481 llLog10 = 264,
482 llLog = 265,
483 llGetAnimationList = 266,
484 llSetParcelMusicURL = 267,
485 llGetRootPosition = 268,
486 llGetRootRotation = 269,
487 llGetObjectDesc = 270,
488 llSetObjectDesc = 271,
489 llGetCreator = 272,
490 llGetTimestamp = 273,
491 llSetLinkAlpha = 274,
492 llGetNumberOfPrims = 275,
493 llGetNumberOfNotecardLines = 276,
494 llGetBoundingBox = 277,
495 llGetGeometricCenter = 278,
496 llGetPrimitiveParams = 279,
497 llIntegerToBase64 = 280,
498 llBase64ToInteger = 281,
499 llGetGMTclock = 282,
500 llGetSimulatorHostname = 283,
501 llSetLocalRot = 284,
502 llParseStringKeepNulls = 285,
503 llRezAtRoot = 286,
504 llGetObjectPermMask = 287,
505 llSetObjectPermMask = 288,
506 llGetInventoryPermMask = 289,
507 llSetInventoryPermMask = 290,
508 llGetInventoryCreator = 291,
509 llOwnerSay = 292,
510 llRequestSimulatorData = 293,
511 llForceMouselook = 294,
512 llGetObjectMass = 295,
513 llListReplaceList = 296,
514 llLoadURL = 297,
515 llParcelMediaCommandList = 298,
516 llParcelMediaQuery = 299,
517 llModPow = 300,
518 llGetInventoryType = 301,
519 llSetPayPrice = 302,
520 llGetCameraPos = 303,
521 llGetCameraRot = 304,
522 llSetPrimURL = 305,
523 llRefreshPrimURL = 306,
524 llEscapeURL = 307,
525 llUnescapeURL = 308,
526 llMapDestination = 309,
527 llAddToLandBanList = 310,
528 llRemoveFromLandPassList = 311,
529 llRemoveFromLandBanList = 312,
530 llSetCameraParams = 313,
531 llClearCameraParams = 314,
532 llListStatistics = 315,
533 llGetUnixTime = 316,
534 llGetParcelFlags = 317,
535 llGetRegionFlags = 318,
536 llXorBase64StringsCorrect = 319,
537 llHTTPRequest = 320,
538 llResetLandBanList = 321,
539 llResetLandPassList = 322,
540 llGetParcelPrimCount = 323,
541 llGetParcelPrimOwners = 324,
542 llGetObjectPrimCount = 325,
543 llGetParcelMaxPrims = 326,
544 llGetParcelDetails = 327
545 }
546
547 }
548}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Parser.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Parser.cs
deleted file mode 100644
index 4ad1f83..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Parser.cs
+++ /dev/null
@@ -1,629 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29using System;
30using System.Collections.Generic;
31using System.Text;
32using System.IO;
33using System.Reflection;
34using System.Reflection.Emit;
35
36namespace OpenSim.Region.Scripting.LSL
37{
38 partial class LSO_Parser
39 {
40 private FileStream fs;
41 private BinaryReader br;
42 private LSO_Struct.Header myHeader;
43
44 private TypeBuilder typeBuilder;
45 private System.Collections.Generic.List<string> EventList = new System.Collections.Generic.List<string>();
46
47 /// <summary>
48 /// Parse LSO file.
49 /// Reads LSO ByteCode into memory structures.
50 /// TODO: What else does it do?
51 /// </summary>
52 /// <param name="FileName">FileName of LSO ByteCode file</param>
53 public void ParseFile(string FileName, TypeBuilder _typeBuilder)
54 {
55 typeBuilder = _typeBuilder;
56 //WorldAPI = _WorldAPI;
57 // Open
58 Common.SendToDebug("Opening filename: " + FileName);
59 fs = File.Open(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
60 br = new BinaryReader(fs, Encoding.BigEndianUnicode);
61
62
63 // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack.
64
65
66 // HEADER BLOCK
67 Common.SendToDebug("Reading HEADER BLOCK at: 0");
68 fs.Seek(0, SeekOrigin.Begin);
69 myHeader = new LSO_Struct.Header();
70 myHeader.TM = BitConverter.ToUInt32(br_read(4), 0);
71 myHeader.IP = BitConverter.ToUInt32(br_read(4), 0);
72 myHeader.VN = BitConverter.ToUInt32(br_read(4), 0);
73 myHeader.BP = BitConverter.ToUInt32(br_read(4), 0);
74 myHeader.SP = BitConverter.ToUInt32(br_read(4), 0);
75 myHeader.HR = BitConverter.ToUInt32(br_read(4), 0);
76 myHeader.HP = BitConverter.ToUInt32(br_read(4), 0);
77 myHeader.CS = BitConverter.ToUInt32(br_read(4), 0);
78 myHeader.NS = BitConverter.ToUInt32(br_read(4), 0);
79 myHeader.CE = BitConverter.ToUInt32(br_read(4), 0);
80 myHeader.IE = BitConverter.ToUInt32(br_read(4), 0);
81 myHeader.ER = BitConverter.ToUInt32(br_read(4), 0);
82 myHeader.FR = BitConverter.ToUInt32(br_read(4), 0);
83 myHeader.SLR = BitConverter.ToUInt32(br_read(4), 0);
84 myHeader.GVR = BitConverter.ToUInt32(br_read(4), 0);
85 myHeader.GFR = BitConverter.ToUInt32(br_read(4), 0);
86 myHeader.PR = BitConverter.ToUInt32(br_read(4), 0);
87 myHeader.ESR = BitConverter.ToUInt32(br_read(4), 0);
88 myHeader.SR = BitConverter.ToUInt32(br_read(4), 0);
89 myHeader.NCE = BitConverter.ToUInt64(br_read(8), 0);
90 myHeader.NIE = BitConverter.ToUInt64(br_read(8), 0);
91 myHeader.NER = BitConverter.ToUInt64(br_read(8), 0);
92
93 // Print Header Block to debug
94 Common.SendToDebug("TM - Top of memory (size): " + myHeader.TM);
95 Common.SendToDebug("IP - Instruction Pointer (0=not running): " + myHeader.IP);
96 Common.SendToDebug("VN - Version number: " + myHeader.VN);
97 Common.SendToDebug("BP - Local Frame Pointer: " + myHeader.BP);
98 Common.SendToDebug("SP - Stack Pointer: " + myHeader.SP);
99 Common.SendToDebug("HR - Heap Register: " + myHeader.HR);
100 Common.SendToDebug("HP - Heap Pointer: " + myHeader.HP);
101 Common.SendToDebug("CS - Current State: " + myHeader.CS);
102 Common.SendToDebug("NS - Next State: " + myHeader.NS);
103 Common.SendToDebug("CE - Current Events: " + myHeader.CE);
104 Common.SendToDebug("IE - In Event: " + myHeader.IE);
105 Common.SendToDebug("ER - Event Register: " + myHeader.ER);
106 Common.SendToDebug("FR - Fault Register: " + myHeader.FR);
107 Common.SendToDebug("SLR - Sleep Register: " + myHeader.SLR);
108 Common.SendToDebug("GVR - Global Variable Register: " + myHeader.GVR);
109 Common.SendToDebug("GFR - Global Function Register: " + myHeader.GFR);
110 Common.SendToDebug("PR - Parameter Register: " + myHeader.PR);
111 Common.SendToDebug("ESR - Energy Supply Register: " + myHeader.ESR);
112 Common.SendToDebug("SR - State Register: " + myHeader.SR);
113 Common.SendToDebug("NCE - 64-bit Current Events: " + myHeader.NCE);
114 Common.SendToDebug("NIE - 64-bit In Events: " + myHeader.NIE);
115 Common.SendToDebug("NER - 64-bit Event Register: " + myHeader.NER);
116 Common.SendToDebug("Read position when exiting HEADER BLOCK: " + fs.Position);
117
118 // STATIC BLOCK
119 Common.SendToDebug("Reading STATIC BLOCK at: " + myHeader.GVR);
120 fs.Seek(myHeader.GVR, SeekOrigin.Begin);
121 int StaticBlockCount = 0;
122 // Read function blocks until we hit GFR
123 while (fs.Position < myHeader.GFR)
124 {
125 StaticBlockCount++;
126 Common.SendToDebug("Reading Static Block " + StaticBlockCount + " at: " + fs.Position);
127 //fs.Seek(myHeader.GVR, SeekOrigin.Begin);
128 LSO_Struct.StaticBlock myStaticBlock = new LSO_Struct.StaticBlock();
129 myStaticBlock.Static_Chunk_Header_Size = BitConverter.ToUInt32(br_read(4), 0);
130 myStaticBlock.ObjectType = br_read(1)[0];
131 Common.SendToDebug("Static Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myStaticBlock.ObjectType).ToString());
132 myStaticBlock.Unknown = br_read(1)[0];
133 // Size of datatype varies
134 if (myStaticBlock.ObjectType != 0)
135 myStaticBlock.BlockVariable = br_read(getObjectSize(myStaticBlock.ObjectType));
136 }
137 Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount);
138
139
140 // FUNCTION BLOCK
141 // Always right after STATIC BLOCK
142 LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock();
143 if (myHeader.GFR == myHeader.SR)
144 {
145 // If GFR and SR are at same position then there is no fuction block
146 Common.SendToDebug("No FUNCTION BLOCK found");
147 }
148 else
149 {
150 Common.SendToDebug("Reading FUNCTION BLOCK at: " + myHeader.GFR);
151 fs.Seek(myHeader.GFR, SeekOrigin.Begin);
152 myFunctionBlock.FunctionCount = BitConverter.ToUInt32(br_read(4), 0);
153 Common.SendToDebug("Number of functions in Fuction Block: " + myFunctionBlock.FunctionCount);
154 if (myFunctionBlock.FunctionCount > 0)
155 {
156 myFunctionBlock.CodeChunkPointer = new UInt32[myFunctionBlock.FunctionCount];
157 for (int i = 0; i < myFunctionBlock.FunctionCount; i++)
158 {
159 Common.SendToDebug("Reading function " + i + " at: " + fs.Position);
160 // TODO: ADD TO FUNCTION LIST (How do we identify it later?)
161 // Note! Absolute position
162 myFunctionBlock.CodeChunkPointer[i] = BitConverter.ToUInt32(br_read(4), 0) + myHeader.GFR;
163 Common.SendToDebug("Fuction " + i + " code chunk position: " + myFunctionBlock.CodeChunkPointer[i]);
164 }
165 }
166 }
167
168
169 // STATE FRAME BLOCK
170 // Always right after FUNCTION BLOCK
171 Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR);
172 fs.Seek(myHeader.SR, SeekOrigin.Begin);
173 LSO_Struct.StateFrameBlock myStateFrameBlock = new LSO_Struct.StateFrameBlock();
174 myStateFrameBlock.StateCount = BitConverter.ToUInt32(br_read(4), 0);
175 if (myStateFrameBlock.StateCount > 0)
176 {
177 // Initialize array
178 myStateFrameBlock.StatePointer = new LSO_Struct.StatePointerBlock[myStateFrameBlock.StateCount];
179 for (int i = 0; i < myStateFrameBlock.StateCount; i++)
180 {
181 Common.SendToDebug("Reading STATE POINTER BLOCK " + (i + 1) + " at: " + fs.Position);
182 // Position is relative to state frame
183 myStateFrameBlock.StatePointer[i].Location = myHeader.SR + BitConverter.ToUInt32(br_read(4), 0);
184 myStateFrameBlock.StatePointer[i].EventMask = new System.Collections.BitArray(br_read(8));
185 Common.SendToDebug("Pointer: " + myStateFrameBlock.StatePointer[i].Location);
186 Common.SendToDebug("Total potential EventMask bits: " + myStateFrameBlock.StatePointer[i].EventMask.Count);
187
188 //// Read STATE BLOCK
189 //long CurPos = fs.Position;
190 //fs.Seek(CurPos, SeekOrigin.Begin);
191
192 }
193 }
194
195
196 // STATE BLOCK
197 // For each StateFrameBlock there is one StateBlock with multiple event handlers
198
199 if (myStateFrameBlock.StateCount > 0)
200 {
201 // Go through all State Frame Pointers found
202 for (int i = 0; i < myStateFrameBlock.StateCount; i++)
203 {
204
205 fs.Seek(myStateFrameBlock.StatePointer[i].Location, SeekOrigin.Begin);
206 Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " at: " + fs.Position);
207
208 // READ: STATE BLOCK HEADER
209 myStateFrameBlock.StatePointer[i].StateBlock = new LSO_Struct.StateBlock();
210 myStateFrameBlock.StatePointer[i].StateBlock.StartPos = (UInt32)fs.Position; // Note
211 myStateFrameBlock.StatePointer[i].StateBlock.HeaderSize = BitConverter.ToUInt32(br_read(4), 0);
212 myStateFrameBlock.StatePointer[i].StateBlock.Unknown = br_read(1)[0];
213 myStateFrameBlock.StatePointer[i].StateBlock.EndPos = (UInt32)fs.Position; // Note
214 Common.SendToDebug("State block Start Pos: " + myStateFrameBlock.StatePointer[i].StateBlock.StartPos);
215 Common.SendToDebug("State block Header Size: " + myStateFrameBlock.StatePointer[i].StateBlock.HeaderSize);
216 Common.SendToDebug("State block Header End Pos: " + myStateFrameBlock.StatePointer[i].StateBlock.EndPos);
217
218 // We need to count number of bits flagged in EventMask?
219
220
221 // for each bit in myStateFrameBlock.StatePointer[i].EventMask
222
223 // ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE
224 //TODO: Create event hooks
225 myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers = new LSO_Struct.StateBlockHandler[myStateFrameBlock.StatePointer[i].EventMask.Count - 1];
226 for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++)
227 {
228
229 if (myStateFrameBlock.StatePointer[i].EventMask.Get(ii) == true)
230 {
231 // We got an event
232 // READ: STATE BLOCK HANDLER
233 Common.SendToDebug("Reading STATE BLOCK " + (i + 1) + " HANDLER matching EVENT MASK " + ii + " (" + ((LSO_Enums.Event_Mask_Values)ii).ToString() + ") at: " + fs.Position);
234 myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer = myStateFrameBlock.StatePointer[i].StateBlock.EndPos + BitConverter.ToUInt32(br_read(4), 0);
235 myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CallFrameSize = BitConverter.ToUInt32(br_read(4), 0);
236 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);
237 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);
238 }
239 }
240 }
241 }
242
243
244
245
246 //// READ FUNCTION CODE CHUNKS
247 //// Functions + Function start pos (GFR)
248 //// TODO: Somehow be able to identify and reference this
249 //LSO_Struct.CodeChunk[] myFunctionCodeChunk;
250 //if (myFunctionBlock.FunctionCount > 0)
251 //{
252 // myFunctionCodeChunk = new LSO_Struct.CodeChunk[myFunctionBlock.FunctionCount];
253 // for (int i = 0; i < myFunctionBlock.FunctionCount; i++)
254 // {
255 // Common.SendToDebug("Reading Function Code Chunk " + i);
256 // myFunctionCodeChunk[i] = GetCodeChunk((UInt32)myFunctionBlock.CodeChunkPointer[i]);
257 // }
258
259 //}
260 // READ EVENT CODE CHUNKS
261 LSO_Struct.CodeChunk[] myEventCodeChunk;
262 if (myStateFrameBlock.StateCount > 0)
263 {
264 myEventCodeChunk = new LSO_Struct.CodeChunk[myStateFrameBlock.StateCount];
265 for (int i = 0; i < myStateFrameBlock.StateCount; i++)
266 {
267 // TODO: Somehow organize events and functions so they can be found again,
268 // two level search ain't no good
269 for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++)
270 {
271
272
273 if (myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer > 0)
274 {
275 Common.SendToDebug("Reading Event Code Chunk state " + i + ", event " + (LSO_Enums.Event_Mask_Values)ii);
276
277
278 // Override a Method / Function
279 string eventname = i + "_event_" + (LSO_Enums.Event_Mask_Values)ii;
280 Common.SendToDebug("Event Name: " + eventname);
281 if (Common.IL_ProcessCodeChunks)
282 {
283 EventList.Add(eventname);
284
285 // JUMP TO CODE PROCESSOR
286 ProcessCodeChunk(myStateFrameBlock.StatePointer[i].StateBlock.StateBlockHandlers[ii].CodeChunkPointer, typeBuilder, eventname);
287 }
288 }
289
290 }
291
292 }
293
294 }
295
296
297 // Close
298 br.Close();
299 fs.Close();
300
301 if (Common.IL_CreateFunctionList)
302 IL_INSERT_FUNCTIONLIST();
303
304 }
305
306 private LSO_Struct.HeapBlock GetHeap(UInt32 pos)
307 {
308 // HEAP BLOCK
309 // TODO:? Special read for strings/keys (null terminated) and lists (pointers to other HEAP entries)
310 Common.SendToDebug("Reading HEAP BLOCK at: " + pos);
311 fs.Seek(pos, SeekOrigin.Begin);
312
313 LSO_Struct.HeapBlock myHeapBlock = new LSO_Struct.HeapBlock();
314 myHeapBlock.DataBlockSize = BitConverter.ToUInt32(br_read(4), 0);
315 myHeapBlock.ObjectType = br_read(1)[0];
316 myHeapBlock.ReferenceCount = BitConverter.ToUInt16(br_read(2), 0);
317 myHeapBlock.Data = br_read(getObjectSize(myHeapBlock.ObjectType));
318
319 Common.SendToDebug("Heap Block Data Block Size: " + myHeapBlock.DataBlockSize);
320 Common.SendToDebug("Heap Block ObjectType: " + ((LSO_Enums.Variable_Type_Codes)myHeapBlock.ObjectType).ToString());
321 Common.SendToDebug("Heap Block Reference Count: " + myHeapBlock.ReferenceCount);
322
323 return myHeapBlock;
324 }
325 private byte[] br_read(int len)
326 {
327 if (len <= 0)
328 return null;
329
330 try
331 {
332 byte[] bytes = new byte[len];
333 for (int i = len - 1; i > -1; i--)
334 bytes[i] = br.ReadByte();
335 return bytes;
336 }
337 catch (Exception e)
338 {
339 Common.SendToDebug("Exception: " + e.ToString());
340 throw (e);
341 }
342 }
343 //private byte[] br_read_smallendian(int len)
344 //{
345 // byte[] bytes = new byte[len];
346 // br.Read(bytes,0, len);
347 // return bytes;
348 //}
349 private Type getLLObjectType(byte objectCode)
350 {
351 switch ((LSO_Enums.Variable_Type_Codes)objectCode)
352 {
353 case LSO_Enums.Variable_Type_Codes.Void: return typeof(void);
354 case LSO_Enums.Variable_Type_Codes.Integer: return typeof(UInt32);
355 case LSO_Enums.Variable_Type_Codes.Float: return typeof(float);
356 case LSO_Enums.Variable_Type_Codes.String: return typeof(string);
357 case LSO_Enums.Variable_Type_Codes.Key: return typeof(string);
358 case LSO_Enums.Variable_Type_Codes.Vector: return typeof(LSO_Enums.Vector);
359 case LSO_Enums.Variable_Type_Codes.Rotation: return typeof(LSO_Enums.Rotation);
360 case LSO_Enums.Variable_Type_Codes.List:
361 Common.SendToDebug("TODO: List datatype not implemented yet!");
362 return typeof(System.Collections.ArrayList);
363 default:
364 Common.SendToDebug("Lookup of LSL datatype " + objectCode + " to .Net datatype failed: Unknown LSL datatype. Defaulting to object.");
365 return typeof(object);
366 }
367 }
368 private int getObjectSize(byte ObjectType)
369 {
370 switch (ObjectType)
371 {
372 case 1:
373 case 2:
374 case 3:
375 case 4:
376 case 7:
377 return 4;
378 case 5:
379 return 12;
380 case 6:
381 return 16;
382 default:
383 return 0;
384 }
385 }
386 private string Read_String()
387 {
388 string ret = "";
389 byte reader = br_read(1)[0];
390 while (reader != 0x000)
391 {
392 ret += (char)reader;
393 reader = br_read(1)[0];
394 }
395 return ret;
396 }
397
398 /// <summary>
399 /// Reads a code chunk and creates IL
400 /// </summary>
401 /// <param name="pos">Absolute position in file. REMEMBER TO ADD myHeader.GFR!</param>
402 /// <param name="typeBuilder">TypeBuilder for assembly</param>
403 /// <param name="eventname">Name of event (function) to generate</param>
404 private void ProcessCodeChunk(UInt32 pos, TypeBuilder typeBuilder, string eventname)
405 {
406
407 LSO_Struct.CodeChunk myCodeChunk = new LSO_Struct.CodeChunk();
408
409 Common.SendToDebug("Reading Function Code Chunk at: " + pos);
410 fs.Seek(pos, SeekOrigin.Begin);
411 myCodeChunk.CodeChunkHeaderSize = BitConverter.ToUInt32(br_read(4), 0);
412 Common.SendToDebug("CodeChunk Header Size: " + myCodeChunk.CodeChunkHeaderSize);
413 // Read until null
414 myCodeChunk.Comment = Read_String();
415 Common.SendToDebug("Function comment: " + myCodeChunk.Comment);
416 myCodeChunk.ReturnType = br_read(1)[0];
417 Common.SendToDebug("Return type #" + myCodeChunk.ReturnType + ": " + (getLLObjectType(myCodeChunk.ReturnType).ToString()));
418
419 // TODO: How to determine number of codechunks -- does this method work?
420 myCodeChunk.CodeChunkArguments = new System.Collections.Generic.List<LSO_Struct.CodeChunkArgument>();
421 byte reader = br_read(1)[0];
422 reader = br_read(1)[0];
423
424 // NOTE ON CODE CHUNK ARGUMENTS
425 // This determins type definition
426 int ccount = 0;
427 while (reader != 0x000)
428 {
429 ccount++;
430 Common.SendToDebug("Reading Code Chunk Argument " + ccount);
431 LSO_Struct.CodeChunkArgument CCA = new LSO_Struct.CodeChunkArgument();
432 CCA.FunctionReturnType = reader;
433 reader = br_read(1)[0];
434 CCA.NullString = reader;
435 myCodeChunk.CodeChunkArguments.Add(CCA);
436 Common.SendToDebug("Code Chunk Argument " + ccount + " type: " + (LSO_Enums.Variable_Type_Codes)CCA.FunctionReturnType);
437 }
438 // Create string array
439 Type[] MethodArgs = new Type[myCodeChunk.CodeChunkArguments.Count];
440 for (int _ic = 0; _ic < myCodeChunk.CodeChunkArguments.Count; _ic++)
441 {
442 MethodArgs[_ic] = getLLObjectType(myCodeChunk.CodeChunkArguments[_ic].FunctionReturnType);
443 Common.SendToDebug("Method argument " + _ic + ": " + getLLObjectType(myCodeChunk.CodeChunkArguments[_ic].FunctionReturnType).ToString());
444 }
445 // End marker is 0x000
446 myCodeChunk.EndMarker = reader;
447
448
449 //
450 // Emit: START OF METHOD (FUNCTION)
451 //
452
453 Common.SendToDebug("CLR:" + eventname + ":MethodBuilder methodBuilder = typeBuilder.DefineMethod...");
454 MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname,
455 MethodAttributes.Public,
456 typeof(void),
457 MethodArgs);
458 //typeof(void), //getLLObjectType(myCodeChunk.ReturnType),
459 // new Type[] { typeof(object) }, //);
460
461 //Common.SendToDebug("CLR:" + eventname + ":typeBuilder.DefineMethodOverride(methodBuilder...");
462 //typeBuilder.DefineMethodOverride(methodBuilder,
463 // typeof(LSL_CLRInterface.LSLScript).GetMethod(eventname));
464
465 // Create the IL generator
466
467 Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();");
468 ILGenerator il = methodBuilder.GetILGenerator();
469
470
471 if (Common.IL_UseTryCatch)
472 IL_INSERT_TRY(il, eventname);
473
474
475
476 // Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!");
477 //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call...");
478 //il.Emit(OpCodes.Call, typeof(Console).GetMethod
479 // ("WriteLine", new Type[] { typeof(string) }));
480
481 //Common.SendToDebug("STARTUP: il.Emit(OpCodes.Ldc_I4_S, 0);");
482
483 //il.Emit(OpCodes.Ldc_I4_S, 0);
484 for (int _ic = 0; _ic < myCodeChunk.CodeChunkArguments.Count; _ic++)
485 {
486 Common.SendToDebug("PARAMS: il.Emit(OpCodes.Ldarg, " + _ic + ");");
487 il.Emit(OpCodes.Ldarg, _ic);
488 }
489
490
491
492 //
493 // CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL
494 //
495 bool FoundRet = false;
496 while (FoundRet == false)
497 {
498 FoundRet = LSL_PROCESS_OPCODE(il);
499 }
500
501
502 if (Common.IL_UseTryCatch)
503 IL_INSERT_END_TRY(il, eventname);
504
505 // Emit: RETURN FROM METHOD
506 il.Emit(OpCodes.Ret);
507
508 return;
509
510 }
511
512 private void IL_INSERT_FUNCTIONLIST()
513 {
514
515 Common.SendToDebug("Creating function list");
516
517
518 string eventname = "GetFunctions";
519
520 Common.SendToDebug("Creating IL " + eventname);
521 // Define a private String field.
522 //FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public);
523
524
525 //FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private);
526
527
528
529 MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname,
530 MethodAttributes.Public,
531 typeof(string[]),
532 null);
533
534 //typeBuilder.DefineMethodOverride(methodBuilder,
535 // typeof(LSL_CLRInterface.LSLScript).GetMethod(eventname));
536
537 ILGenerator il = methodBuilder.GetILGenerator();
538
539
540
541
542 // IL_INSERT_TRY(il, eventname);
543
544 // // Push string to stack
545 // il.Emit(OpCodes.Ldstr, "Inside " + eventname);
546
547 //// Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!");
548 //il.Emit(OpCodes.Call, typeof(Console).GetMethod
549 // ("WriteLine", new Type[] { typeof(string) }));
550
551 //initIL.Emit(OpCodes.Newobj, typeof(string[]));
552
553 //string[] MyArray = new string[2] { "TestItem1" , "TestItem2" };
554
555 il.DeclareLocal(typeof(string[]));
556
557 //il.Emit(OpCodes.Ldarg_0);
558 il.Emit(OpCodes.Ldc_I4, EventList.Count); // Specify array length
559 il.Emit(OpCodes.Newarr, typeof(String)); // create new string array
560 il.Emit(OpCodes.Stloc_0); // Store array as local variable 0 in stack
561
562 for (int lv = 0; lv < EventList.Count; lv++)
563 {
564 il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack
565 il.Emit(OpCodes.Ldc_I4, lv); // Push index position
566 il.Emit(OpCodes.Ldstr, EventList[lv]); // Push value
567 il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value
568 }
569
570
571
572 // IL_INSERT_END_TRY(il, eventname);
573
574 il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack
575 il.Emit(OpCodes.Ret); // Return
576
577 }
578
579
580 private void IL_INSERT_TRY(ILGenerator il, string eventname)
581 {
582 /*
583 * CLR TRY
584 */
585 //Common.SendToDebug("CLR:" + eventname + ":il.BeginExceptionBlock()");
586 il.BeginExceptionBlock();
587
588 // Push "Hello World!" string to stack
589 //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Ldstr...");
590 il.Emit(OpCodes.Ldstr, "Starting CLR dynamic execution of: " + eventname);
591
592 }
593
594 private void IL_INSERT_END_TRY(ILGenerator il, string eventname)
595 {
596 /*
597 * CATCH
598 */
599 Common.SendToDebug("CLR:" + eventname + ":il.BeginCatchBlock(typeof(Exception));");
600 il.BeginCatchBlock(typeof(Exception));
601
602 // Push "Hello World!" string to stack
603 Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Ldstr...");
604 il.Emit(OpCodes.Ldstr, "Execption executing dynamic CLR function " + eventname + ": ");
605
606 //call void [mscorlib]System.Console::WriteLine(string)
607 Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call...");
608 il.Emit(OpCodes.Call, typeof(Console).GetMethod
609 ("Write", new Type[] { typeof(string) }));
610
611 //callvirt instance string [mscorlib]System.Exception::get_Message()
612 Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Callvirt...");
613 il.Emit(OpCodes.Callvirt, typeof(Exception).GetMethod
614 ("get_Message"));
615
616 //call void [mscorlib]System.Console::WriteLine(string)
617 Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call...");
618 il.Emit(OpCodes.Call, typeof(Console).GetMethod
619 ("WriteLine", new Type[] { typeof(string) }));
620
621 /*
622 * CLR END TRY
623 */
624 //Common.SendToDebug("CLR:" + eventname + ":il.EndExceptionBlock();");
625 il.EndExceptionBlock();
626 }
627
628 }
629}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Struct.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Struct.cs
deleted file mode 100644
index 4d9be5d..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLHandler/LSO_Struct.cs
+++ /dev/null
@@ -1,133 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
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
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
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28/* Original code: Tedd Hansen */
29
30using System;
31using System.Collections.Generic;
32using System.Text;
33
34namespace OpenSim.Region.Scripting.LSL
35{
36 static class LSO_Struct
37 {
38
39 public struct Header
40 {
41 public UInt32 TM;
42 public UInt32 IP;
43 public UInt32 VN;
44 public UInt32 BP;
45 public UInt32 SP;
46 public UInt32 HR;
47 public UInt32 HP;
48 public UInt32 CS;
49 public UInt32 NS;
50 public UInt32 CE;
51 public UInt32 IE;
52 public UInt32 ER;
53 public UInt32 FR;
54 public UInt32 SLR;
55 public UInt32 GVR;
56 public UInt32 GFR;
57 public UInt32 PR;
58 public UInt32 ESR;
59 public UInt32 SR;
60 public UInt64 NCE;
61 public UInt64 NIE;
62 public UInt64 NER;
63 }
64
65 public struct StaticBlock
66 {
67 public UInt32 Static_Chunk_Header_Size;
68 public byte ObjectType;
69 public byte Unknown;
70 public byte[] BlockVariable;
71 }
72 /* Not actually a structure
73 public struct StaticBlockVariable
74 {
75 public UInt32 Integer1;
76 public UInt32 Float1;
77 public UInt32 HeapPointer_String;
78 public UInt32 HeapPointer_Key;
79 public byte[] Vector_12;
80 public byte[] Rotation_16;
81 public UInt32 Pointer_List_Structure;
82 } */
83 public struct HeapBlock
84 {
85 public UInt32 DataBlockSize;
86 public byte ObjectType;
87 public UInt16 ReferenceCount;
88 public byte[] Data;
89 }
90 public struct StateFrameBlock
91 {
92 public UInt32 StateCount;
93 public StatePointerBlock[] StatePointer;
94 }
95 public struct StatePointerBlock
96 {
97 public UInt32 Location;
98 public System.Collections.BitArray EventMask;
99 public StateBlock StateBlock;
100 }
101 public struct StateBlock
102 {
103 public UInt32 StartPos;
104 public UInt32 EndPos;
105 public UInt32 HeaderSize;
106 public byte Unknown;
107 public StateBlockHandler[] StateBlockHandlers;
108 }
109 public struct StateBlockHandler
110 {
111 public UInt32 CodeChunkPointer;
112 public UInt32 CallFrameSize;
113 }
114 public struct FunctionBlock
115 {
116 public UInt32 FunctionCount;
117 public UInt32[] CodeChunkPointer;
118 }
119 public struct CodeChunk
120 {
121 public UInt32 CodeChunkHeaderSize;
122 public string Comment;
123 public System.Collections.Generic.List<CodeChunkArgument> CodeChunkArguments;
124 public byte EndMarker;
125 public byte ReturnType;
126 }
127 public struct CodeChunkArgument
128 {
129 public byte FunctionReturnType;
130 public byte NullString;
131 }
132 }
133}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScript.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScript.cs
deleted file mode 100644
index 71d4c7e..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScript.cs
+++ /dev/null
@@ -1,33 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using OpenSim.Region.Scripting;
6using OpenSim.Region.Scripting.LSL;
7
8namespace OpenSim.Region.Scripting.LSL
9{
10 class LSLScript : IScript
11 {
12 ScriptInfo scriptInfo;
13 Engine lindenScriptEngine;
14
15 public LSLScript(string filename, libsecondlife.LLUUID taskObject)
16 {
17 scriptInfo.CreateTaskAPI(taskObject);
18
19 lindenScriptEngine = new Engine();
20 lindenScriptEngine.Start(filename);
21 }
22
23 public void Initialise(ScriptInfo info)
24 {
25 scriptInfo = info;
26 }
27
28 public string Name
29 {
30 get { return "LSL Script"; }
31 }
32 }
33}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScriptEngine.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScriptEngine.cs
deleted file mode 100644
index c232c2f..0000000
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/LSLEngine/LSLScriptEngine.cs
+++ /dev/null
@@ -1,27 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using OpenSim.Region.Scripting;
6using OpenSim.Region.Scripting.LSL;
7
8namespace OpenSim.Region.Scripting
9{
10 public class LSLEngine : IScriptCompiler
11 {
12 public string FileExt()
13 {
14 return ".lso";
15 }
16
17 public Dictionary<string, IScript> compile(string filename)
18 {
19 LSLScript script = new LSLScript(filename, libsecondlife.LLUUID.Zero);
20 Dictionary<string, IScript> returns = new Dictionary<string, IScript>();
21
22 returns.Add(filename, script);
23
24 return returns;
25 }
26 }
27} \ No newline at end of file