aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs90
1 files changed, 45 insertions, 45 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
index 64cb7cd..46d438a 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
@@ -1,45 +1,45 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using Rail.Transformation; 4using Rail.Transformation;
5using Rail.Reflect; 5using Rail.Reflect;
6using Rail.Exceptions; 6using Rail.Exceptions;
7using Rail.MSIL; 7using Rail.MSIL;
8 8
9namespace OpenSim.Region.ScriptEngine.DotNetEngine 9namespace OpenSim.Region.ScriptEngine.DotNetEngine
10{ 10{
11 /// <summary> 11 /// <summary>
12 /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes! 12 /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes!
13 /// Its offspring will be the actual implementation. 13 /// Its offspring will be the actual implementation.
14 /// </summary> 14 /// </summary>
15 class TempDotNetMicroThreadingCodeInjector 15 class TempDotNetMicroThreadingCodeInjector
16 { 16 {
17 public static string TestFix(string FileName) 17 public static string TestFix(string FileName)
18 { 18 {
19 string ret = System.IO.Path.GetFileNameWithoutExtension(FileName + "_fixed.dll"); 19 string ret = System.IO.Path.GetFileNameWithoutExtension(FileName + "_fixed.dll");
20 20
21 Console.WriteLine("Loading: \"" + FileName + "\""); 21 Console.WriteLine("Loading: \"" + FileName + "\"");
22 RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName); 22 RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName);
23 23
24 24
25 //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe 25 //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe
26 RTypeDef type = (RTypeDef)rAssembly.RModuleDef.GetType("SecondLife.Script"); 26 RTypeDef type = (RTypeDef)rAssembly.RModuleDef.GetType("SecondLife.Script");
27 27
28 //Get the methods in the type 28 //Get the methods in the type
29 RMethod[] m = type.GetMethods(); 29 RMethod[] m = type.GetMethods();
30 30
31 //Create a MethodPrologueAdder visitor object with the method to add 31 //Create a MethodPrologueAdder visitor object with the method to add
32 //and with the flag that enables local variable creation set to true 32 //and with the flag that enables local variable creation set to true
33 MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef)m[0], true); 33 MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef)m[0], true);
34 34
35 //Apply the changes to the assembly 35 //Apply the changes to the assembly
36 rAssembly.Accept(mpa); 36 rAssembly.Accept(mpa);
37 37
38 //Save the new assembly 38 //Save the new assembly
39 rAssembly.SaveAssembly(ret); 39 rAssembly.SaveAssembly(ret);
40 40
41 return ret; 41 return ret;
42 42
43 } 43 }
44 } 44 }
45} 45}