aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs')
-rw-r--r--OpenSim/Grid/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs22
1 files changed, 9 insertions, 13 deletions
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
index 0498ef3..8a8c96d 100644
--- a/OpenSim/Grid/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
+++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs
@@ -27,12 +27,9 @@
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.IO;
31using System.Text;
32using Rail.Transformation;
33using Rail.Reflect; 31using Rail.Reflect;
34using Rail.Exceptions; 32using Rail.Transformation;
35using Rail.MSIL;
36 33
37namespace OpenSim.Grid.ScriptEngine.DotNetEngine 34namespace OpenSim.Grid.ScriptEngine.DotNetEngine
38{ 35{
@@ -40,26 +37,26 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
40 /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes! 37 /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes!
41 /// Its offspring will be the actual implementation. 38 /// Its offspring will be the actual implementation.
42 /// </summary> 39 /// </summary>
43 class TempDotNetMicroThreadingCodeInjector 40 internal class TempDotNetMicroThreadingCodeInjector
44 { 41 {
45 public static string TestFix(string FileName) 42 public static string TestFix(string FileName)
46 { 43 {
47 string ret = System.IO.Path.GetFileNameWithoutExtension(FileName + "_fixed.dll"); 44 string ret = Path.GetFileNameWithoutExtension(FileName + "_fixed.dll");
48 45
49 Console.WriteLine("Loading: \"" + FileName + "\""); 46 Console.WriteLine("Loading: \"" + FileName + "\"");
50 RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName); 47 RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName);
51 48
52 49
53 //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe 50 //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe
54 RTypeDef type = (RTypeDef)rAssembly.RModuleDef.GetType("SecondLife.Script"); 51 RTypeDef type = (RTypeDef) rAssembly.RModuleDef.GetType("SecondLife.Script");
55 52
56 //Get the methods in the type 53 //Get the methods in the type
57 RMethod[] m = type.GetMethods(); 54 RMethod[] m = type.GetMethods();
58 55
59 //Create a MethodPrologueAdder visitor object with the method to add 56 //Create a MethodPrologueAdder visitor object with the method to add
60 //and with the flag that enables local variable creation set to true 57 //and with the flag that enables local variable creation set to true
61 MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef)m[0], true); 58 MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef) m[0], true);
62 59
63 //Apply the changes to the assembly 60 //Apply the changes to the assembly
64 rAssembly.Accept(mpa); 61 rAssembly.Accept(mpa);
65 62
@@ -67,7 +64,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
67 rAssembly.SaveAssembly(ret); 64 rAssembly.SaveAssembly(ret);
68 65
69 return ret; 66 return ret;
70
71 } 67 }
72 } 68 }
73} 69} \ No newline at end of file