aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs41
-rw-r--r--bin/RAIL.dllbin0 -> 200704 bytes
-rw-r--r--prebuild.xml1
4 files changed, 43 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 5606287..b6debcf 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -190,7 +190,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
190 private string ProcessYield(string FileName) 190 private string ProcessYield(string FileName)
191 { 191 {
192 // TODO: Create a new assembly and copy old but insert Yield Code 192 // TODO: Create a new assembly and copy old but insert Yield Code
193 return FileName; 193 return TempDotNetMicroThreadingCodeInjector.TestFix(FileName);
194 } 194 }
195 195
196 private AppDomain GetFreeAppDomain() 196 private AppDomain GetFreeAppDomain()
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
new file mode 100644
index 0000000..dd3ce09
--- /dev/null
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
@@ -0,0 +1,41 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Rail.Transformation;
5using Rail.Reflect;
6using Rail.Exceptions;
7using Rail.MSIL;
8
9namespace OpenSim.Region.ScriptEngine.DotNetEngine
10{
11 class TempDotNetMicroThreadingCodeInjector
12 {
13 public static string TestFix(string FileName)
14 {
15 string ret = System.IO.Path.GetFileNameWithoutExtension(FileName + "_fixed.dll");
16
17 Console.WriteLine("Loading: \"" + FileName + "\"");
18 RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName);
19
20
21 //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe
22 RTypeDef type = (RTypeDef)rAssembly.RModuleDef.GetType("SecondLife.Script");
23
24 //Get the methods in the type
25 RMethod[] m = type.GetMethods();
26
27 //Create a MethodPrologueAdder visitor object with the method to add
28 //and with the flag that enables local variable creation set to true
29 MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef)m[0], true);
30
31 //Apply the changes to the assembly
32 rAssembly.Accept(mpa);
33
34 //Save the new assembly
35 rAssembly.SaveAssembly(ret);
36
37 return ret;
38
39 }
40 }
41}
diff --git a/bin/RAIL.dll b/bin/RAIL.dll
new file mode 100644
index 0000000..f2632d7
--- /dev/null
+++ b/bin/RAIL.dll
Binary files differ
diff --git a/prebuild.xml b/prebuild.xml
index d1bb30f..1e84541 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -958,6 +958,7 @@
958 <Reference name="OpenSim.Region.Environment" /> 958 <Reference name="OpenSim.Region.Environment" />
959 <Reference name="Axiom.MathLib.dll" localCopy="false"/> 959 <Reference name="Axiom.MathLib.dll" localCopy="false"/>
960 <Reference name="libsecondlife.dll"/> 960 <Reference name="libsecondlife.dll"/>
961 <Reference name="RAIL.dll"/>
961 <Reference name="OpenSim.Framework"/> 962 <Reference name="OpenSim.Framework"/>
962 <Reference name="OpenSim.Framework.Console"/> 963 <Reference name="OpenSim.Framework.Console"/>
963 <Files> 964 <Files>